From f3e34eddc9727d4f676233452d3a00c7a96d0c11 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Thu, 9 Nov 2017 17:39:56 +1100 Subject: [PATCH] EKF: do not attempt to align FW yaw using GPS method if on ground --- EKF/control.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EKF/control.cpp b/EKF/control.cpp index dee0f44360..3cfa2311d8 100644 --- a/EKF/control.cpp +++ b/EKF/control.cpp @@ -483,8 +483,8 @@ void Ekf::controlGpsFusion() do_reset = do_reset || (_time_last_imu - _time_last_pos_fuse > 2 * _params.no_gps_timeout_max); if (do_reset) { - // Reset states to the last GPS measurement - if (_control_status.flags.fixed_wing) { + // use GPS velocity data to cehck and correct yaw angle if a FW vehicle + if (_control_status.flags.fixed_wing && _control_status.flags.in_air) { // if flying a fixed wing aircraft, do a complete reset that includes yaw realignYawGPS(); }