mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 08:03:34 +08:00
ekf2: request mag yaw reset after calibration or sensor change
This commit is contained in:
@@ -1818,14 +1818,14 @@ void EKF2::UpdateMagSample(ekf2_timestamps_s &ekf2_timestamps)
|
||||
|
||||
reset = true;
|
||||
|
||||
} else if (magnetometer.calibration_count > _mag_calibration_count) {
|
||||
} else if (magnetometer.calibration_count != _mag_calibration_count) {
|
||||
// existing calibration has changed, reset saved mag bias
|
||||
PX4_DEBUG("%d - mag %" PRIu32 " calibration updated, resetting bias", _instance, _device_id_mag);
|
||||
reset = true;
|
||||
}
|
||||
|
||||
if (reset) {
|
||||
_ekf.resetMagBias();
|
||||
_ekf.resetMagBiasAndYaw();
|
||||
_device_id_mag = magnetometer.device_id;
|
||||
_mag_calibration_count = magnetometer.calibration_count;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user