Browse Source

EKF: Update declination fusion logic

We do not need to run declination fusion if 3-axis mag fusion is not being used.
master
Paul Riseborough 9 years ago
parent
commit
5ea0ef39cd
  1. 6
      EKF/control.cpp

6
EKF/control.cpp

@ -111,11 +111,11 @@ void Ekf::controlFusionModes()
} }
// if we are using 3-axis magnetometer fusion, but without external aiding, then the declination needs to be fused as an observation to prevent long term heading drift // if we are using 3-axis magnetometer fusion, but without external aiding, then the declination needs to be fused as an observation to prevent long term heading drift
if (_control_status.flags.mag_3D && _control_status.flags.gps) { if (_control_status.flags.mag_3D && !_control_status.flags.gps) {
_control_status.flags.mag_dec = false; _control_status.flags.mag_dec = true;
} else { } else {
_control_status.flags.mag_dec = true; _control_status.flags.mag_dec = false;
} }
} }

Loading…
Cancel
Save