ekf2: stop mag fusion when there is no data anymore

This commit is contained in:
bresch
2023-02-17 08:51:55 -05:00
committed by Daniel Agar
parent deabe9a38d
commit 8ebf47edb1
2 changed files with 6 additions and 1 deletions
+4
View File
@@ -107,6 +107,10 @@ void Ekf::controlMagFusion()
_aid_src_mag.timestamp_sample = mag_sample.time_us;
mag_observation.copyTo(_aid_src_mag.observation);
mag_innov.copyTo(_aid_src_mag.innovation);
} else if (!isNewestSampleRecent(_time_last_mag_buffer_push, 2 * MAG_MAX_INTERVAL)) {
// No data anymore. Stop until it comes back.
stopMagFusion();
}
}