mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-26 16:10:35 +08:00
ekf2: mag fusion don't update all states if mag_fault or mag_field_disturbed
This commit is contained in:
@@ -363,7 +363,8 @@ void Ekf::run3DMagAndDeclFusions(const Vector3f &mag)
|
||||
{
|
||||
// For the first few seconds after in-flight alignment we allow the magnetic field state estimates to stabilise
|
||||
// before they are used to constrain heading drift
|
||||
const bool update_all_states = ((_imu_sample_delayed.time_us - _flt_mag_align_start_time) > (uint64_t)5e6);
|
||||
const bool update_all_states = ((_imu_sample_delayed.time_us - _flt_mag_align_start_time) > (uint64_t)5e6)
|
||||
&& !_control_status.flags.mag_fault && !_control_status.flags.mag_field_disturbed;
|
||||
|
||||
if (!_mag_decl_cov_reset) {
|
||||
// After any magnetic field covariance reset event the earth field state
|
||||
|
||||
Reference in New Issue
Block a user