From fe378fd761d57430b32b6de2c4db8c95b3a65843 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Tue, 22 Jan 2019 10:29:42 +1100 Subject: [PATCH] EKF: Prevent unwanted declination fusion when re-starting 3-axis fusion --- EKF/control.cpp | 2 +- EKF/covariance.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/EKF/control.cpp b/EKF/control.cpp index 71385c50df..bf5766c3e0 100644 --- a/EKF/control.cpp +++ b/EKF/control.cpp @@ -1608,7 +1608,7 @@ void Ekf::controlMagFusion() _mag_decl_cov_reset = true; fuseMag(); } else { - // The normal sequence is to fuse the magnetmer data first before fusing + // The normal sequence is to fuse the magnetometer data first before fusing // declination angle at a higher uncertainty to allow some learning of // declination angle over time. fuseMag(); diff --git a/EKF/covariance.cpp b/EKF/covariance.cpp index c24fe84e60..ba0847252c 100644 --- a/EKF/covariance.cpp +++ b/EKF/covariance.cpp @@ -847,7 +847,6 @@ void Ekf::fixCovarianceErrors() if (!_control_status.flags.mag_3D) { zeroRows(P, 16, 21); zeroCols(P, 16, 21); - _mag_decl_cov_reset = false; } else { // constrain variances