From eb2afc522d5f5ffe3b4964d451a6d1ff0a7f9366 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Tue, 7 Jun 2016 18:51:55 +1000 Subject: [PATCH] EKF: fix bug preventing use of baro as a backup height source --- EKF/control.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EKF/control.cpp b/EKF/control.cpp index 7897722412..fd3cc7d8bd 100644 --- a/EKF/control.cpp +++ b/EKF/control.cpp @@ -671,7 +671,7 @@ void Ekf::controlBaroFusion() if (_baro_data_ready) { // determine if we should use the baro as our height source uint64_t last_baro_time_us = _baro_sample_delayed.time_us; - if ((_params.vdist_sensor_type == VDIST_SENSOR_BARO) && !_baro_hgt_faulty) { + if (((_params.vdist_sensor_type == VDIST_SENSOR_BARO) || _control_status.flags.baro_hgt) && !_baro_hgt_faulty) { _control_status.flags.baro_hgt = true; _control_status.flags.gps_hgt = false; _control_status.flags.rng_hgt = false;