mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 07:33:35 +08:00
ekf2: reset heading when mag calibration changed
This commit is contained in:
@@ -75,6 +75,12 @@ void Ekf::controlMagFusion(const imuSample &imu_sample)
|
|||||||
_mag_lpf.reset(mag_sample.mag);
|
_mag_lpf.reset(mag_sample.mag);
|
||||||
_mag_counter = 1;
|
_mag_counter = 1;
|
||||||
|
|
||||||
|
if (!_control_status.flags.in_air) {
|
||||||
|
// Assume that a reset on the ground is caused by a change in mag calibration
|
||||||
|
// Clear alignment to force a clean reset
|
||||||
|
_control_status.flags.yaw_align = false;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
_mag_lpf.update(mag_sample.mag);
|
_mag_lpf.update(mag_sample.mag);
|
||||||
_mag_counter++;
|
_mag_counter++;
|
||||||
|
|||||||
Reference in New Issue
Block a user