Beat Küng
d1343b0ccb
calibration_routines: fix 'Command denied during calibration' error message
...
The uorb subscribe logic got changed for queued topics with
https://github.com/PX4/Firmware/pull/9436 , meaning an orb_subscribe will
return past messages as well now.
This lead to an error 'Command denied during calibration' for the previously
received calibration start command.
2018-06-18 15:06:58 +02:00
Beat Küng
ff365cad08
rtl: change "RTL: land at home" message from critical to info
2018-06-15 15:53:28 +02:00
Beat Küng
04db56638e
ecl: update submodule
...
contains:
- https://github.com/PX4/ecl/pull/460
- https://github.com/PX4/ecl/pull/462
2018-06-15 15:53:28 +02:00
Beat Küng
229b1274d0
fix camera_trigger gpio: _pins[i] == 0 is valid
...
Because _pins[i] is set from parameter value - 1
2018-06-14 15:03:39 -04:00
Beat Küng
b66f0f36a5
ros tests: add an interactive flag & disable the PX4 shell for ROS tests ( #9672 )
2018-06-14 12:37:47 -04:00
Beat Küng
036b59f3de
posix main: convert c to a char when extending add_string
2018-06-13 16:19:34 +02:00
Beat Küng
f241e49ebf
voted_sensors_update: initialize _last_magnetometer & _last_airdata
2018-06-13 16:19:34 +02:00
Beat Küng
20f2303e8a
test_mixer: fix resource leak (unclosed dp)
2018-06-13 16:19:34 +02:00
Beat Küng
76c94b08f1
PositionControl: use constant references instead of pass-by-value for structs
2018-06-13 16:19:34 +02:00
Beat Küng
5cc450c7cb
srf02: fix resource leak (unclosed fd)
2018-06-13 16:19:34 +02:00
Beat Küng
ab94bf1d60
batt_smbus: initialize _last_report
2018-06-13 16:19:34 +02:00
Beat Küng
4eda0ed782
posix main shell: fix getchar() return value and check for EOF to avoid busy loop
2018-06-13 16:19:34 +02:00
Beat Küng
226d7c79da
sensors: initialize adc only if BOARD_NUMBER_BRICKS > 0
...
Fixes the SITL startup error:
ERROR [sensors] no ADC found: /dev/adc0 (9)
Introduced in 8404889098
2018-06-13 15:54:45 +02:00
Beat Küng
08064c2b71
mavlink_main: remove nonexisting streams
...
Removes SITL startup warnings:
WARN [mavlink] stream SCALED_IMU2 not found
WARN [mavlink] stream SCALED_IMU3 not found
Introduced in 9122725052
2018-06-13 15:54:45 +02:00
Beat Küng
9151351b8d
l3gd20: add argc check and use px4_getopt
2018-06-12 11:02:50 +02:00
Beat Küng
a76c82f5f2
airframes: update 4050 generic 250 racer defaults
...
- P and D gains are too high for a racer
- default I gain is too low (0.25 is still quite low)
- use the thrust curve param instead of TPA
- improve responsiveness in Manual & increase max tilt angle to 60 degrees
- enable one-shot
- enable high-rate logging profile
- disable RC filter
2018-06-09 17:00:35 +02:00
Beat Küng
a62a71f48f
gps: reopen the gps port on failed auto-detection
...
work-around for https://github.com/PX4/Firmware/issues/9461
2018-06-07 22:20:47 +02:00
Beat Küng
2fa8783795
mavlink_receiver: implement MAV_CMD_REQUEST_STORAGE_INFORMATION
2018-06-05 14:40:01 +02:00
Beat Küng
d1a7a367ac
fix px4_getopt: add argc check for options that take an argument
...
Fixes the following corner case:
mpu9250 start -R
This would return a valid result (myoptind < argc), but myoptind pointed
to a NULL argument (and thus mpu9250 would crash).
With this patch, px4_getopt will return '?', indicating a parser error.
2018-06-04 16:33:55 +02:00
Beat Küng
2de6192f66
position_estimator_inav: add missing return
2018-06-04 16:33:55 +02:00
Beat Küng
ad587def24
test_ppm: add argc check
2018-06-04 16:33:55 +02:00
Beat Küng
dc7db9d793
iridiumsbd: add argc check
2018-06-04 16:33:55 +02:00
Beat Küng
7c79c1ae9f
pwm_input: add argc check
2018-06-04 16:33:55 +02:00
Beat Küng
cce3c270c3
lis3mdl: add argc check and use px4_getopt
2018-06-04 16:33:55 +02:00
Beat Küng
ffccba12e2
bmm150: add argc check and use px4_getopt
2018-06-04 16:33:55 +02:00
Beat Küng
009b2d4d6b
mpu9250: add argc check and use px4_getopt
2018-06-04 16:33:55 +02:00
Beat Küng
c2c3780918
mpu6000: add argc check and use px4_getopt
2018-06-04 16:33:55 +02:00
Beat Küng
a0d4e7aa90
bmi160: add argc check and use px4_getopt
2018-06-04 16:33:55 +02:00
Beat Küng
8f5fb3d0e5
bma180: add argc check
2018-06-04 16:33:55 +02:00
Beat Küng
7a3b34be74
tfmini: add argc check and fix argv index
2018-06-04 16:33:55 +02:00
Beat Küng
eabfac71d6
teraranger: add argc check and fix argv index
2018-06-04 16:33:55 +02:00
Beat Küng
554003b3f1
srf02: add argc check
2018-06-04 16:33:55 +02:00
Beat Küng
490ccc0076
sf1xx: add argc check
2018-06-04 16:33:55 +02:00
Beat Küng
2a7cd392b1
sf0x: add argc check and fix argv index
2018-06-04 16:33:55 +02:00
Beat Küng
85c676316c
mb12xx: add argc check and fix argv index
2018-06-04 16:33:55 +02:00
Beat Küng
19933b4d3b
sdp3x: add argc check and use px4_getopt
2018-06-04 16:33:55 +02:00
Beat Küng
4b8658a318
ms5525: add argc check and use px4_getopt
2018-06-04 16:33:55 +02:00
Beat Küng
d3f9f419f1
ms4525: add argc check and use px4_getopt
2018-06-04 16:33:55 +02:00
Beat Küng
61b4b2df88
ets_airspeed: add argc check and use px4_getopt
2018-06-04 16:33:55 +02:00
Beat Küng
ae8439f0af
ms5611: add argc check
2018-06-04 16:33:55 +02:00
Beat Küng
7e7905acd1
lps22hb: add argc check and use px4_getopt
2018-06-04 16:33:55 +02:00
Beat Küng
22bc35c048
bmp280: add argc check and use px4_getopt
2018-06-04 16:33:55 +02:00
Beat Küng
5f87545e48
mavlink_messages: fill in all 16 servo channels
2018-06-04 10:55:29 +02:00
Beat Küng
537451c2a0
Debug/Nuttx.py: fix 'mon reg' does not exist
...
Also there was no register xPSR.
Stack usage calculation is still broken...
2018-06-01 19:27:30 +02:00
Beat Küng
f8dd833a14
onmibus-f4sd: add ADC support
2018-05-31 19:13:00 +02:00
Beat Küng
acc1cb08d4
omnibus-f4sd cmake config: minor cleanup
2018-05-31 19:13:00 +02:00
Beat Küng
77cea8844f
ROMFS: fix SYS_USE_IO==0
...
When SYS_USE_IO was disabled, px4io would not start and thus there was no
RC. SYS_USE_IO=0 is interesting on Quads to avoid the IO and reduce output
latency.
Tested on Pixhawk 1 and Pixhawk 4
2018-05-28 19:03:33 +02:00
Beat Küng
ae75ff6c72
px4fmu-v5/board_config.h: update BOARD_BATTERY1_V_DIV
2018-05-28 15:38:29 +02:00
Beat Küng
3f00e2e6c2
mavlink mission: send an ack on duplicated last uploaded mission item
2018-05-28 11:57:35 +02:00
Beat Küng
4f1c01de7f
fmu params: add MOT_ORDERING to adjust the motor ordering
...
Useful for 4-in-1 ESCs such as the Hobbywing XRotor Micro 40A 4in1
where the FC can be directly plugged on top.
2018-05-28 08:37:08 +02:00
Beat Küng
c9d179676e
simple mixer: make output scalers O: optional and use default values instead
...
Reduces FLASH usage by about 4KB
Command to replace:
for i in *.mix; do sed -r -i '/O: +10000 +10000 +0 +-10000 +10000/d' $i; done
2018-05-25 07:57:08 +02:00
Beat Küng
527070bb35
rcS: update default params for Omnibus F4 SD
2018-05-20 11:54:17 +02:00
Beat Küng
d99b72ea41
attitude_estimator_q: set mag weight to 0 if SYS_HAS_MAG is not set
2018-05-20 11:54:17 +02:00
Beat Küng
f2516bbf5f
system_params: add SYS_HAS_MAG and SYS_HAS_BARO params
...
This allows to use PX4 on systems that do not have a mag or a baro,
such as the Omnibus F4 SD.
2018-05-20 11:54:17 +02:00
Beat Küng
9b5df10631
logger watchdog: avoid using printf from IRQ context
...
PX4_ERR calls printf, which calls lib_sem_initialize, which calls sem_wait
2018-05-18 22:23:32 +02:00
Beat Küng
b8a94bf8d4
logger: move pthread_t cast to pid_t into watchdog_initialize
...
avoids compile error on OSX, trying to cast pthread_t to pid_t
2018-05-18 22:23:32 +02:00
Beat Küng
f2703abce0
top: increase process priority to 255
...
Helps debugging busy-looping tasks.
2018-05-18 22:23:32 +02:00
Beat Küng
bda237b368
logger: ensure that fsync is called at least every second
...
In case a log ends abruptly, we will know that we have everything up to the
last second.
A test showed that CPU load and the amount of logging drops are unaffected
by this.
2018-05-18 22:23:32 +02:00
Beat Küng
dd30012b27
logger: add watchdog that boosts its priority when the writer is blocked for >1s
...
This is to guard against busy-looping tasks, so that we at least have a
log. In case the watchdog is triggered, it also logs CPU load of all
tasks.
2018-05-18 22:23:32 +02:00
Beat Küng
401eefd39b
refactor logger: add struct timer_callback_data_s used in the timer callback
2018-05-18 22:23:32 +02:00
Beat Küng
9b72080ec1
refactor logger: add an enum for the reason of printing the cpu load
2018-05-18 22:23:32 +02:00
Beat Küng
11f4631b2a
fix commander: initialize tune_durations ( #9468 )
...
Fixes #9451
2018-05-16 10:20:28 -04:00
Beat Küng
873e036e85
px_romfs_pruner: reduce multiple consecutive spaces into a single space for mixers ( #9457 )
...
Reduces FLASH usage by about 3kb.
Plus add a missing cmake dependency.
2018-05-14 14:05:29 -04:00
Beat Küng
12436c1d64
fix attitude_estimator_q: swap quaternion multiplication & fix from_dcm init
...
Quaterion::from_dcm does not set *this, but just returns the resulting
Quaterion.
2018-05-11 09:34:26 +02:00
Beat Küng
9e24875131
attitude_estimator_q: fuse accel data only if close to 1g if GPS velocity not used
...
This reduces attitude drift on vehicles w/o GPS. The default behavior is
unchanged, to use it, disable ATT_ACC_COMP.
2018-05-11 09:34:26 +02:00
Beat Küng
f77b8d9aa8
attitude_estimator_q: remove double initialization
2018-05-11 09:34:26 +02:00
Beat Küng
54fac26327
attitude_estimator_q: allow it to be used on boards w/o a mag
...
By setting ATT_W_MAG to 0
2018-05-11 09:34:26 +02:00
Beat Küng
c6b0d5c76a
navigator: don't complain 'Using minimum takeoff altitude' in case of numerical inaccuracies
...
Happend in SITL.
2018-05-09 07:59:46 +02:00
Beat Küng
473fa15026
BlockParam: : ensure result of strncpy is null-terminated
2018-05-09 07:59:46 +02:00
Beat Küng
258b1ea473
navigator: ensure result of strncpy is null-terminated
2018-05-09 07:59:46 +02:00
Beat Küng
8c638ac88c
sdlog2: check result of snprintf and ensure result of strncpy is null-terminated
2018-05-09 07:59:46 +02:00
Beat Küng
f2092dd690
mixer_test: use snprintf instead of strncpy to fix compiler warning
...
compiler warning:
../../src/systemcmds/tests/test_mixer.cpp: In member function ‘bool MixerTest::loadAllTest()’:
../../src/systemcmds/tests/test_mixer.cpp:202:18: error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying 1 byte from a string of the same length [-Werror=stringop-truncation]
(void)strncpy(&buf[strlen(MIXER_ONBOARD_PATH)], "/", 1);
2018-05-09 07:59:46 +02:00
Beat Küng
289e618b6c
mavlink: fix compiler warnings with GCC 8.0.1
...
-Wno-extra-semi is not valid for C code
2018-05-09 07:59:46 +02:00
Beat Küng
8bd61a9330
uORBDevices: avoid memset, use braced initializer instead
2018-05-09 07:59:46 +02:00
Beat Küng
19a12ba75d
logger: avoid memset, use braced initializer instead
2018-05-09 07:59:46 +02:00
Beat Küng
3dd791c92c
vfile: rename fops to fix shadowing warning
...
for GCC 8.0.1
2018-05-09 07:59:46 +02:00
Beat Küng
13ab5ed0d0
px4_main_t: fix method declaration throughout the code base
...
px4_main_t is defined as:
typedef int (*px4_main_t)(int argc, char *argv[]);
which matches with the definition in NuttX, given to task_create
2018-05-09 07:59:46 +02:00
Beat Küng
9772380779
posix main: avoid declaring px4_main_t, include the correct header instead
2018-05-09 07:59:46 +02:00
Beat Küng
71b4ad62a1
ekf2 replay: handle multi multiple GPS instances ( #9433 )
2018-05-09 10:00:59 +10:00
Beat Küng
c7c3e23f0d
MC acro: update param descriptions
2018-04-27 22:34:55 +02:00
Beat Küng
12e967173d
MC: set default MPC_THR_MAX & MPC_MANTHR_MAX to 1
...
With the updated mixer (#9062 ) it's safe to set maximum thrust to 1 (in
both cases, if MC_AIRMODE is set, or not set).
So I see no reason to limit the maximum thrust.
2018-04-26 14:37:48 +02:00
Beat Küng
f2cee9970c
MC acro: add separate params to configure yaw expo
...
So that it can be customized better according to personal preferences.
The limitation of 16 chars did not allow to use a better param name.
2018-04-26 14:17:16 +02:00
Beat Küng
58c757a9db
mc_att_control_params: increase max acro rates to 1800
...
This matches the maximum rates for the attitude controller.
2018-04-26 14:17:16 +02:00
Beat Küng
332a612f35
mc_att_control_main: do not apply the yaw weight for the feedforward term
...
The meaning of the yaw weight changed with #8003 :
- before, the yaw weight decreased with increasing tilt angle error, so
it was mostly 1
- now, it is constant and depends on the tuning gains (around 0.4 by default)
It means that #8003 reduced the feedforward term, and we get the closer
behavior as before with this change.
It also reduces coupling between different parameters.
2018-04-25 16:33:09 +02:00
Beat Küng
202505fd73
mixer_multirotor: fix initialization of _outputs_prev
...
memset (http://www.cplusplus.com/reference/cstring/memset/ ) interprets
the value argument as unsigned char, so passing a float will not work.
2018-04-25 16:33:09 +02:00
Beat Küng
4ef3d258eb
imu drivers: do not set on-chip filter based on driver filter setting
...
The description of IMU_GYRO_CUTOFF was incorrectly saying that it only
affects the driver filtering, but in fact it also set the on-chip filter
to the next higher supported value. This patch fixes that.
And because the IMU_GYRO_CUTOFF and not the IMU_ACCEL_CUTOFF was used for
the on-chip filter, after #9070 which sets the default gyro filter to 80,
we were effectively using a dlpf of 98 Hz.
For this reason this patch changes the on-chip cutoff frequency to 98 as
well, so that the overall default behavior is unchanged.
2018-04-25 16:32:06 +02:00
Beat Küng
e46e6f99f3
module template: move documentation to a new category 'template' ( #9324 )
2018-04-18 08:53:52 -04:00
Beat Küng
64aab8a685
rcS: do not reset COM_FLTMODE* on airframe change
...
An airframe change keeps all RC params except the flight modes. This fixes
that.
2018-04-17 14:17:20 +02:00
Beat Küng
123f11fcdd
land_detector: use user-defined literals for time constants
2018-04-14 13:45:57 +02:00
Beat Küng
e98919cf3c
drv_hrt: add user-defined integer literals for time constants
...
The goal is to improve the readability for expressions like:
if (hrt_elapsed_time(&start_time) > 8000000)
Available since C++11
2018-04-14 13:45:57 +02:00
Beat Küng
d4faaff854
logger: remove some unneeded SITL topics
...
We got over the limit
2018-04-12 11:32:15 +02:00
Beat Küng
f02ef20a23
commander: set timestamp for vehicle_command publication
2018-04-11 15:19:47 +02:00
Beat Küng
b52a8de5ff
nuttx_px4fmu-v2_test.cmake: enable modules required to build mc_pos_control
...
due to param dependencies
2018-04-11 07:47:06 +02:00
Beat Küng
90513e719e
ASSERT: remove some inappropriate asserts
...
Since assertions lead to crashes, we need better failure handling. In all
the cases in this patch, the assert is not required.
All the ones with the task id should be replaced with the module base
class.
Ah yes, and this reduces flash space, since the ASSERT macro will expand to
a printf that contains the source file name.
2018-04-11 07:47:06 +02:00
Beat Küng
a8645b51d5
voted_sensors_update: reduce flash usage by allowing compiler to dedup equal strings
...
reduces roughly 130 bytes. Almost enough to pass CI.
2018-04-11 07:47:06 +02:00
Beat Küng
b97d432844
px4_param.h: add override to _DEFINE_PARAMETER_UPDATE_METHOD_CUSTOM_PARENT
2018-04-11 07:47:06 +02:00
Beat Küng
5eb7d8ec5f
flight tasks smoothing: refactor param_find -> Param
...
Plus some style fixes
2018-04-11 07:47:06 +02:00
Beat Küng
398d511fd9
flight tasks smoothing: fix style issues
2018-04-11 07:47:06 +02:00
Beat Küng
0eaa6222a2
flight tasks: refactor BlockParam -> Param and handle param updates
2018-04-11 07:47:06 +02:00
Beat Küng
2e620cf1d4
mc_pos_control: refactor BlockParam -> Param
2018-04-11 07:47:06 +02:00