Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
do not reset yaw if vehicle on ground
Browse files Browse the repository at this point in the history
  • Loading branch information
mrivi authored and priseborough committed Apr 9, 2019
1 parent 14227ea commit c4492b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion EKF/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ void Ekf::controlMagFusion()

// We need to reset the yaw angle after climbing away from the ground to enable
// recovery from ground level magnetic interference.
if (!_control_status.flags.mag_align_complete) {
if (!_control_status.flags.mag_align_complete && _control_status.flags.in_air) {
// Check if height has increased sufficiently to be away from ground magnetic anomalies
// and request a yaw reset if not already requested.
float terrain_vpos_estimate = get_terrain_valid() ? _terrain_vpos : _last_on_ground_posD;
Expand Down

0 comments on commit c4492b1

Please sign in to comment.