ekf2: mag in air reset fall back to regular resetMagHeading() if realignYawGPS() fails

This commit is contained in:
Daniel Agar
2022-04-04 10:42:54 -04:00
parent 4234e9a390
commit 9a929e0857
+2 -1
View File
@@ -197,8 +197,9 @@ void Ekf::runInAirYawReset(const Vector3f &mag_sample)
if (_control_status.flags.gps && _control_status.flags.fixed_wing) {
has_realigned_yaw = realignYawGPS(mag_sample);
}
} else if (canResetMagHeading()) {
if (!has_realigned_yaw && canResetMagHeading()) {
has_realigned_yaw = resetMagHeading();
}