- centralize logic for selecting a preferred calibration slot
- automatically use existing calibration slot if it exists, otherwise
find first available slot, with a preference for a requested index
- existing commander calibration methods rewrite all calibration slots
to match current sensor ordering
Before: in_ground_effect was always true with the default settings (LNDMC_ALT_GND =-1)
and when a distance sensor was present with valid data.
Now: default of LNDMC_ALT_GND is set to 2m by default, and if set to a negative value
then in_ground_effect is never set to true
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Since the same parameter is used to generate the trajectory and to
saturate the controller, there is no additional space for the output of
the position controller once it is filled with the feedforward, letting
the altitude grow uncontrolled.
This changes the way RC is handled for the Mantis:
- The RC values are re-written when arriving over MAVLink. They are
rescaled from 0..4095 to 1000..2000 and the channel bits added to
separate channels. This makes the downstream handling easier.
- Gimbal pitch is moved from Aux1 to Aux2 as that should be the default.
- Aux3 and Aux4 are used for the photo and video trigger.
- The speed button is used as the FLTMODE channel and set to switch
between POSCTL and ALTCTL.
From what I can see the CONFIG_BOARDCTL_POWEROFF is not really used
anywhere, however, the BOARD_HAS_POWER_CONTROL is something that is set,
e.g. for the Mantis, to allow power off.
- this simplifies the reset by allowing a notch filter to reset as
needed
- improves cascade initialization, on reset each filter will reset
properly from the previous
To avoid weird cases where the altitude is different enough and
the offtrack state flies to the target altitude instead of the closest
point on the track between the waypoints.
- sensors/vehicle_imu: reset learned cal on any calibration change
during parameter update
- sensors/vehicle_imu: cleanup logic estimated bias -> calibration offset
saving
- don't invalidate saved calibration (the point is to keep the last valid)
- remove old debug code, etc
- sensors/vehicle_imu: notify parameter changes if accel or gyro
calibration has changed
- lib/sensor_calibration: add calibrated() and calibration_index()
getters, keep Accelerometer/Gyroscope/Magnetometer in sync
The imu and sensor_combined data should not be used when it has not been
updated yet, otherwise this triggers a memory sanitizer warning:
Conditional jump or move depends on uninitialised value(s)
at 0x2DA7AA: __sanitizer_cov_trace_const_cmp1 (in build/px4_sitl_default-clang/bin/px4)
by 0x3C4E79: EKF2::Run() (src/modules/ekf2/EKF2.cpp:401)
by 0x6EB881: px4::WorkQueue::Run() (platforms/common/px4_work_queue/WorkQueue.cpp:187)
by 0x6ECB9D: px4::WorkQueueRunner(void*) (platforms/common/px4_work_queue/WorkQueueManager.cpp:230)
by 0x4C07258: start_thread (in /usr/lib/libpthread-2.33.so)
by 0x4D415E2: clone (in /usr/lib/libc-2.33.so)
Conditional jump or move depends on uninitialised value(s)
at 0x3C4E7C: EKF2::Run() (src/modules/ekf2/EKF2.cpp:401)
by 0x6EB881: px4::WorkQueue::Run() (platforms/common/px4_work_queue/WorkQueue.cpp:187)
by 0x6ECB9D: px4::WorkQueueRunner(void*) (platforms/common/px4_work_queue/WorkQueueManager.cpp:230)
by 0x4C07258: start_thread (in /usr/lib/libpthread-2.33.so)
by 0x4D415E2: clone (in /usr/lib/libc-2.33.so)
- introuce slew rate limiting of airspeed setpoint (with slew rate of 1 m/s/s)
- some refactoring and clean up
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This prevents a memory sanitizer/valgrind warning:
Conditional jump or move depends on uninitialised value(s)
at 0x2DA536: __sanitizer_cov_trace_cmp4 (in build/px4_sitl_default-clang/bin/px4)
by 0x6590D8: FailureDetector::update(vehicle_status_s const&, vehicle_control_mode_s const&) (src/modules/commander/failure_detector/FailureDetector.cpp:76) by 0x3817DF: Commander::run() (src/modules/commander/Commander.cpp:2605)
by 0x38B10B: ModuleBase<Commander>::run_trampoline(int, char**) (platforms/common/include/px4_platform_common/module.h:180)