AP_NavEKF2: prevent NaN if RNGFND_GNDCLEAR is zero
This commit is contained in:
parent
bf51da224a
commit
5cd403c0b9
@ -24,7 +24,8 @@ void NavEKF2_core::readRangeFinder(void)
|
||||
uint8_t maxIndex;
|
||||
uint8_t minIndex;
|
||||
// get theoretical correct range when the vehicle is on the ground
|
||||
rngOnGnd = frontend->_rng.ground_clearance_cm() * 0.01f;
|
||||
// don't allow range to go below 5cm becasue this can cause problems with optical flow processing
|
||||
rngOnGnd = MAX(frontend->_rng.ground_clearance_cm() * 0.01f, 0.05f);
|
||||
|
||||
// read range finder at 20Hz
|
||||
// TODO better way of knowing if it has new data
|
||||
|
Loading…
Reference in New Issue
Block a user