AP_NavEKF3: Prevent on ground range to ground being used in flight

This commit is contained in:
Paul Riseborough 2022-11-21 20:28:20 +11:00 committed by Randy Mackay
parent 74ff64f440
commit ab8c30a282
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ void NavEKF3_core::readRangeFinder(void)
// indicate we have updated the measurement
rngValidMeaTime_ms = imuSampleTime_ms;
} else if (!takeOffDetected && ((imuSampleTime_ms - rngValidMeaTime_ms) > 200)) {
} else if (onGround && ((imuSampleTime_ms - rngValidMeaTime_ms) > 200)) {
// before takeoff we assume on-ground range value if there is no data
rangeDataNew.time_ms = imuSampleTime_ms;
rangeDataNew.rng = rngOnGnd;