mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
EKF: use hagl estimate if valid for when to trigger yaw reset on takeoff
This commit is contained in:
committed by
Paul Riseborough
parent
8b4ae48c69
commit
938c8ad9ad
+2
-1
@@ -1385,7 +1385,8 @@ void Ekf::controlMagFusion()
|
||||
if (!_control_status.flags.mag_align_complete) {
|
||||
// Check if height has increased sufficiently to be away from ground magnetic anomalies
|
||||
// and request a yaw reset if not already requested.
|
||||
_mag_yaw_reset_req |= ((_last_on_ground_posD - _state.pos(2)) > 1.5f);
|
||||
float terrain_vpos_estimate = get_terrain_valid() ? _terrain_vpos : _last_on_ground_posD;
|
||||
_mag_yaw_reset_req |= (terrain_vpos_estimate - _state.pos(2)) > 1.5f;
|
||||
}
|
||||
|
||||
// perform a yaw reset if requested by other functions
|
||||
|
||||
Reference in New Issue
Block a user