From 171e80d8dc0192328cb688221eb0992552c354ef Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Thu, 14 Dec 2017 00:01:53 +0100 Subject: [PATCH] AP_NavEKF2: only report terrain estimator innovations with valid rng value --- libraries/AP_NavEKF2/AP_NavEKF2_Outputs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_NavEKF2/AP_NavEKF2_Outputs.cpp b/libraries/AP_NavEKF2/AP_NavEKF2_Outputs.cpp index 87140b193f..4f4710d7bd 100644 --- a/libraries/AP_NavEKF2/AP_NavEKF2_Outputs.cpp +++ b/libraries/AP_NavEKF2/AP_NavEKF2_Outputs.cpp @@ -579,7 +579,7 @@ void NavEKF2_core::send_status_report(mavlink_channel_t chan) // height estimation or optical flow operation. This prevents false alarms at the GCS if a // range finder is fitted for other applications float temp; - if ((frontend->_useRngSwHgt > 0) || PV_AidingMode == AID_RELATIVE || flowDataValid) { + if (((frontend->_useRngSwHgt > 0) && activeHgtSource == HGT_SOURCE_RNG) || (PV_AidingMode == AID_RELATIVE && flowDataValid)) { temp = sqrtf(auxRngTestRatio); } else { temp = 0.0f;