diff --git a/src/modules/ekf2/ekf2_main.cpp b/src/modules/ekf2/ekf2_main.cpp index 833b0a1fe9..765c55ba93 100644 --- a/src/modules/ekf2/ekf2_main.cpp +++ b/src/modules/ekf2/ekf2_main.cpp @@ -578,7 +578,13 @@ void Ekf2::run() // check if distance sensor is within working boundaries if (range_finder.min_distance >= range_finder.current_distance || range_finder.max_distance <= range_finder.current_distance) { - range_finder_updated = false; + // use rng_gnd_clearance if on ground + if (_ekf.get_in_air_status()) { + range_finder_updated = false; + + } else { + range_finder.current_distance = _params->rng_gnd_clearance; + } } }