mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 05:13:34 +08:00
EKF: Fix yaw reset for fixed wing
Ensures that a complete reset of velocity and position states will always be performed if yaw has had to be reset using GPS velocity. Ensures that the yaw_align status cannot be set to false once the filter has aligned.
This commit is contained in:
+3
-2
@@ -411,6 +411,9 @@ bool Ekf::realignYawGPS()
|
||||
// calculate new filter quaternion states using corected yaw angle
|
||||
_state.quat_nominal = Quatf(euler321);
|
||||
|
||||
// If heading was bad, then we alos need to reset the velocity and position states
|
||||
_velpos_reset_request = badMagYaw;
|
||||
|
||||
// update transformation matrix from body to world frame using the current state estimate
|
||||
_R_to_earth = quat_to_invrotmat(_state.quat_nominal);
|
||||
|
||||
@@ -453,8 +456,6 @@ bool Ekf::realignYawGPS()
|
||||
// capture the reset event
|
||||
_state_reset_status.quat_counter++;
|
||||
|
||||
// the alignment using GPS has been successful
|
||||
_control_status.flags.yaw_align = true;
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user