Skip to content

Commit

Permalink
EKF: remove check for faulty flag in fake rng
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Nico van Duijn authored and priseborough committed Sep 12, 2019
1 parent 933189e commit 267195a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion EKF/terrain_estimator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 267195a

Please sign in to comment.