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)
- mavlink in PX4/Firmware (395eeb440a2ca7503591f872d4f733fcd9867218): bfaf605bd6
- mavlink current upstream: 4bc0de9c38
- Changes: bfaf605bd6...4bc0de9c38
4bc0de9c 2021-12-27 olliw42 - Component Information Basics: add camera cap flag (#1752)
8035ad4d 2021-12-27 Hamish Willee - GIMBAL_DEVICE_FLAGS_NEUTRAL - note that this can be any angle (#1758)
Using make tests in docker will fail, because the current basic image used by px4io/px4-dev-simulation-bionic is ubuntu18.04, the default version of cmake is 3.10, and the add_compile_definitions command is only available in cmake 3.12+(ubuntu 20.04).
The existing implementation had a flaw: when the buffer was getting full,
mavlink started to busy-loop, as the uart has data (poll returns immediately)
but no new data was read from the uart due to the buffer being full.
As rtps is running at lower prio, it never got the chance to read again,
making the problem even worse.
After 1s the timeout triggered and the buffer was cleared, so it recovered.
Instead of allowing for CPU spikes, we now immediately clear the buffer
(only as much as we have to), ensuring that new data is read from the uart.
In the tiltrotor case, beside an F_z thrust setpoint also a F_x setpoint must be passed
to the allocator as the matrix has non-zero thrust-x effectiveness when tilts are applied.
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>