ekf2: Make stuck detector optional

This commit is contained in:
Sverre Velten Rothmund
2023-11-07 08:53:09 +01:00
committed by Mathieu Bresciani
parent 3d16383bb4
commit 94d4dc85f8
3 changed files with 18 additions and 3 deletions
@@ -114,6 +114,12 @@ inline bool SensorRangeFinder::isDataInRange() const
void SensorRangeFinder::updateStuckCheck()
{
if(!isStuckDetectorEnabled()){
// Stuck detector disabled
_is_stuck = false;
return;
}
// Check for "stuck" range finder measurements when range was not valid for certain period
// This handles a failure mode observed with some lidar sensors
if (((_sample.time_us - _time_last_valid_us) > (uint64_t)10e6)) {