mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 20:53:34 +08:00
EKF2: improve resilience against incorrect mag data
- when GNSS is used require low mag heading innovations during horizontal acceleration (yaw observable) to validate the mag - only fuse mag heading just enough to constrain the yaw estimate variance to a sane value. Leave enough uncertainty to allow for a correction when the yaw is observable through GNSS fusion
This commit is contained in:
@@ -63,6 +63,7 @@ void Ekf::controlMag3DFusion(const magSample &mag_sample, const bool common_star
|
||||
_control_status.flags.mag_3D = (_params.mag_fusion_type == MagFuseType::AUTO)
|
||||
&& _control_status.flags.mag
|
||||
&& _control_status.flags.mag_aligned_in_flight
|
||||
&& (_control_status.flags.mag_heading_consistent || !_control_status.flags.gps)
|
||||
&& !_control_status.flags.mag_fault
|
||||
&& isRecent(aid_src.time_last_fuse, 500'000)
|
||||
&& getMagBiasVariance().longerThan(0.f) && !getMagBiasVariance().longerThan(sq(0.02f))
|
||||
|
||||
Reference in New Issue
Block a user