From f8a33e551cbc14c7f0d3fc51db90486a9aa58f8a Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Fri, 25 Mar 2022 11:26:27 -0400 Subject: [PATCH] ekf2: allow yaw estimator to run when disarmed (if not at rest) --- src/modules/ekf2/EKF/ekf_helper.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/ekf2/EKF/ekf_helper.cpp b/src/modules/ekf2/EKF/ekf_helper.cpp index 7ff2c973f9..88530272da 100644 --- a/src/modules/ekf2/EKF/ekf_helper.cpp +++ b/src/modules/ekf2/EKF/ekf_helper.cpp @@ -1802,8 +1802,10 @@ void Ekf::runYawEKFGSF() } } + const bool run_yaw_estimator = _control_status.flags.in_air || !_control_status.flags.vehicle_at_rest; const Vector3f imu_gyro_bias = getGyroBias(); - _yawEstimator.update(_imu_sample_delayed, _control_status.flags.in_air, TAS, imu_gyro_bias); + + _yawEstimator.update(_imu_sample_delayed, run_yaw_estimator, TAS, imu_gyro_bias); // basic sanity check on GPS velocity data if (_gps_data_ready && _gps_sample_delayed.vacc > FLT_EPSILON &&