From df571202c53a8f8d066d79bd276b1677e1d368c1 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Wed, 14 Nov 2018 07:19:23 +1100 Subject: [PATCH] EKF: Fix bug preventing saved declination being used for first alignment --- EKF/ekf.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/EKF/ekf.cpp b/EKF/ekf.cpp index 1d49580f36..ae524295d3 100644 --- a/EKF/ekf.cpp +++ b/EKF/ekf.cpp @@ -257,6 +257,8 @@ bool Ekf::initialiseFilter() Vector3f mag_init = _mag_filt_state; // calculate the initial magnetic field and yaw alignment + // Get the magnetic declination + calcMagDeclination(); _control_status.flags.yaw_align = resetMagHeading(mag_init); if (_control_status.flags.rng_hgt) {