EKF: fix bug preventing use of baro as a backup height source

This commit is contained in:
Paul Riseborough 2016-06-07 18:51:55 +10:00
parent 573f252b73
commit eb2afc522d

View File

@ -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;