Skip to content

Commit

Permalink
ekf2-mag: with NE aiding, constrain heading drift only before takeoff
Browse files Browse the repository at this point in the history
After takeoff, the heading is easily observable
  • Loading branch information
bresch committed May 27, 2024
1 parent bb98040 commit dd0eb77
Show file tree
Hide file tree
Showing 3 changed files with 318 additions and 318 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void Ekf::controlMagFusion()

// if we are using 3-axis magnetometer fusion, but without external NE aiding,
// then the declination must be fused as an observation to prevent long term heading drift
const bool no_ne_aiding_or_pre_takeoff = !using_ne_aiding || !_control_status.flags.mag_aligned_in_flight;
const bool no_ne_aiding_or_pre_takeoff = !using_ne_aiding || !_control_status.flags.in_air;
_control_status.flags.mag_dec = _control_status.flags.mag && no_ne_aiding_or_pre_takeoff;

if (_control_status.flags.mag) {
Expand Down
Loading

0 comments on commit dd0eb77

Please sign in to comment.