From 70e95812e701e707dbc2af344a6cb8fcc0a6367a Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Mon, 21 Mar 2022 21:12:41 -0400 Subject: [PATCH] ekf2: reset mag_lpf (by zeroing _mag_counter) when resetting mag bias (or changing mags) - so that there's new filtered data avaiable for reset --- src/modules/ekf2/EKF/ekf_helper.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/ekf2/EKF/ekf_helper.cpp b/src/modules/ekf2/EKF/ekf_helper.cpp index 6d5b26aa2d..b6eb79aa9a 100644 --- a/src/modules/ekf2/EKF/ekf_helper.cpp +++ b/src/modules/ekf2/EKF/ekf_helper.cpp @@ -915,6 +915,8 @@ void Ekf::resetMagBiasAndYaw() } _control_status.flags.mag_fault = false; + + _mag_counter = 0; } // get EKF innovation consistency check status information comprising of: