mag: synchronize calibration count with newly calibrated data

The data contained a mix between the old and new calibration. This
caused the EKF to reset to an incorrect (intermediate) heading.
This commit is contained in:
bresch
2025-03-25 17:37:30 +01:00
committed by Daniel Agar
parent 7acd2e93eb
commit 49624a6457
@@ -191,6 +191,13 @@ bool VehicleMagnetometer::ParametersUpdate(bool force)
if (calibration_updated) {
_last_calibration_update = hrt_absolute_time();
for (int instance = 0; instance < MAX_SENSOR_COUNT; instance++) {
// avoid mixing data currected using old calibration
_timestamp_sample_sum[instance] = 0;
_data_sum[instance].zero();
_data_sum_count[instance] = 0;
}
}
}