From 4f19d457c40eb14237f9299cf50b44488541b1f4 Mon Sep 17 00:00:00 2001 From: Andreas Antener Date: Wed, 31 Jul 2019 17:41:56 +0200 Subject: [PATCH] ekf, control: make sure mag fusion doesn't start anymore when we have GPS heading fusion active --- EKF/control.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EKF/control.cpp b/EKF/control.cpp index aa5ae33cad..4c2ab0d986 100644 --- a/EKF/control.cpp +++ b/EKF/control.cpp @@ -1384,7 +1384,7 @@ void Ekf::controlMagFusion() // check for new magnetometer data that has fallen behind the fusion time horizon // If we are using external vision data for heading then no magnetometer fusion is used - if (!_control_status.flags.ev_yaw && _mag_data_ready) { + if (!_control_status.flags.ev_yaw && !_control_status.flags.gps_yaw && _mag_data_ready) { // We need to reset the yaw angle after climbing away from the ground to enable // recovery from ground level magnetic interference.