ekf2: mag control reset mag_lpf on first sample

This commit is contained in:
Daniel Agar 2023-02-02 10:14:22 -05:00
parent c2f13dbccf
commit e3d73cd837
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ void Ekf::controlMagFusion()
if (mag_data_ready) {
// sensor or calibration has changed, clear any mag bias and reset low pass filter
if (mag_sample.reset) {
if (mag_sample.reset || (_mag_counter == 0)) {
// Zero the magnetometer bias states
_state.mag_B.zero();