From 1222559da0fa0804b495b85793c0c1bc330f507a Mon Sep 17 00:00:00 2001 From: priseborough Date: Thu, 16 Oct 2014 17:28:00 +1100 Subject: [PATCH] AP_NavEKF : Fix bug affecting sonar fusion --- libraries/AP_NavEKF/AP_NavEKF.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/AP_NavEKF/AP_NavEKF.cpp b/libraries/AP_NavEKF/AP_NavEKF.cpp index 4c2f4e87f9..8dd9d075f2 100644 --- a/libraries/AP_NavEKF/AP_NavEKF.cpp +++ b/libraries/AP_NavEKF/AP_NavEKF.cpp @@ -3996,6 +3996,7 @@ void NavEKF::writeOptFlowMeas(uint8_t &rawFlowQuality, Vector2f &rawFlowRates, V } // Use range finder if 3 or more consecutive good samples. This reduces likelihood of using bad data. if (rangeHealth >= 3) { + statesAtRngTime = statesAtFlowTime; rngMea = rawSonarRange; newDataRng = true; } else {