From 30c7a596af473c39bc0d478ef1ac04acde4f89bb Mon Sep 17 00:00:00 2001 From: bresch Date: Mon, 2 Aug 2021 14:23:09 +0200 Subject: [PATCH] GNSS yaw: allow unlimited resets on ground --- src/modules/ekf2/EKF/control.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/ekf2/EKF/control.cpp b/src/modules/ekf2/EKF/control.cpp index 462af77631..e4b9e14f15 100644 --- a/src/modules/ekf2/EKF/control.cpp +++ b/src/modules/ekf2/EKF/control.cpp @@ -784,7 +784,10 @@ void Ekf::controlGpsYawFusion(bool gps_checks_passing, bool gps_checks_failing) if (_nb_gps_yaw_reset_available > 0) { // Data seems good, attempt a reset resetYawToGps(); - _nb_gps_yaw_reset_available--; + + if (_control_status.flags.in_air) { + _nb_gps_yaw_reset_available--; + } } else if (starting_conditions_passing) { // Data seems good, but previous reset did not fix the issue