From 5f21723efc58e93370629318ce1927e2a05301f3 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Thu, 3 May 2018 13:00:03 +1000 Subject: [PATCH] EKF: Fix bug causing simultaneous range and baro heigh fusion --- EKF/control.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/EKF/control.cpp b/EKF/control.cpp index 71394aebfb..38a1406973 100644 --- a/EKF/control.cpp +++ b/EKF/control.cpp @@ -836,8 +836,7 @@ void Ekf::controlHeightFusion() } } - } else if (_baro_data_ready && !_baro_hgt_faulty && - !(_in_range_aid_mode && !_range_data_ready && !_rng_hgt_faulty)) { + } else if (!_in_range_aid_mode && _baro_data_ready && !_baro_hgt_faulty) { setControlBaroHeight(); _fuse_height = true; _in_range_aid_mode = false; @@ -920,8 +919,7 @@ void Ekf::controlHeightFusion() } } - } else if (_gps_data_ready && !_gps_hgt_faulty && - !(_in_range_aid_mode && !_range_data_ready && !_rng_hgt_faulty)) { + } else if (!_in_range_aid_mode && _gps_data_ready && !_gps_hgt_faulty) { setControlGPSHeight(); _fuse_height = true; _in_range_aid_mode = false;