mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-22 22:32:11 +08:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user