EKF2: RNG_USE_HGT param only used when ALT_SOURCE = rangefinder

This commit is contained in:
Randy Mackay 2019-09-10 10:14:26 +09:00 committed by Andrew Tridgell
parent 00247e9d6a
commit 94a52b3525

View File

@ -829,7 +829,7 @@ void NavEKF2_core::selectHeightForFusion()
if (extNavUsedForPos) {
// always use external vision as the height source if using for position.
activeHgtSource = HGT_SOURCE_EV;
} else if (((frontend->_useRngSwHgt > 0) || (frontend->_altSource == 1)) && (imuSampleTime_ms - rngValidMeaTime_ms < 500)) {
} else if (((frontend->_useRngSwHgt > 0) && (frontend->_altSource == 1)) && (imuSampleTime_ms - rngValidMeaTime_ms < 500)) {
if (frontend->_altSource == 1) {
// always use range finder
activeHgtSource = HGT_SOURCE_RNG;