EKF: remove check for faulty flag in fake rng

This removes the check for _rng_hgt_faulty in the decision of publishing
a fake range measurement. The reason for this is that some distance sensors
don't populate the quality flag, even if they are saturated. Hence, if we
are on the ground and not moving, it is safe to publish a fake measurement
of the distance sensor and overwrite the actual sensor data.
This commit is contained in:
Nico van Duijn
2019-09-12 17:45:37 +10:00
committed by Paul Riseborough
parent 933189eac0
commit 267195a11b
+1 -1
View File
@@ -99,7 +99,7 @@ void Ekf::runTerrainEstimator()
// if stationary on the ground and no range data for over a second, fake a measurement
// to handle bad range finder data when on ground
if (_rng_hgt_faulty && !_range_data_ready && !_control_status.flags.in_air && _vehicle_at_rest && (_time_last_imu - _time_last_hagl_fuse) > (uint64_t)1E6) {
if (!_range_data_ready && !_control_status.flags.in_air && _vehicle_at_rest && (_time_last_imu - _time_last_hagl_fuse) > (uint64_t)1E6) {
_range_data_ready = true;
_rng_hgt_faulty = false;
_range_sample_delayed.rng = _params.rng_gnd_clearance;