From 51c8715638245f64b7b01e41414df8c0fb5cc82b Mon Sep 17 00:00:00 2001 From: CarlOlsson Date: Tue, 9 Aug 2016 15:46:16 +0200 Subject: [PATCH] fixed issue with airspeed never fused --- EKF/control.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/EKF/control.cpp b/EKF/control.cpp index a717f5b169..a0556872ae 100644 --- a/EKF/control.cpp +++ b/EKF/control.cpp @@ -744,7 +744,9 @@ void Ekf::controlAirDataFusion() // if the airspeed measurements have timed out for 10 seconds we declare the wind estimate to be invalid _control_status.flags.wind = false; - } else if (_tas_data_ready) { + } + + if (_tas_data_ready) { // if we have airspeed data to fuse and winds states are inactive, then // they need to be activated and the corresponding states and covariances reset if (!_control_status.flags.wind) { @@ -753,14 +755,9 @@ void Ekf::controlAirDataFusion() resetWindCovariance(); } - } - - // always fuse airspeed if available and the wind states are active - if (_tas_data_ready && _control_status.flags.wind) { fuseAirspeed(); } - } void Ekf::controlMagFusion()