From c03212674595df849a8a40b806fdcdcce367a1a5 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Fri, 4 Jan 2019 20:30:51 +1100 Subject: [PATCH] EKF: Fix bug causing incorrect yaw variance value to be used This bug causes the variance of the Z axis rotation vector uncertainty to not be reset to the correct value. --- EKF/ekf_helper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EKF/ekf_helper.cpp b/EKF/ekf_helper.cpp index 0e84690115..6bd63cbc30 100644 --- a/EKF/ekf_helper.cpp +++ b/EKF/ekf_helper.cpp @@ -729,7 +729,7 @@ bool Ekf::resetMagHeading(Vector3f &mag_init) } // update the yaw angle variance using the variance of the measurement - if (!_control_status.flags.ev_yaw) { + if (_control_status.flags.ev_yaw) { // using error estimate from external vision data angle_err_var_vec(2) = sq(fmaxf(_ev_sample_delayed.angErr, 1.0e-2f));