Browse Source

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.
master
Nico van Duijn 5 years ago committed by Paul Riseborough
parent
commit
267195a11b
  1. 2
      EKF/terrain_estimator.cpp

2
EKF/terrain_estimator.cpp

@ -99,7 +99,7 @@ void Ekf::runTerrainEstimator() @@ -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;

Loading…
Cancel
Save