added rng_stuck to filter control status flags (#392)

This commit is contained in:
Carl Olsson
2018-03-21 01:46:27 +01:00
committed by Paul Riseborough
parent 7964820412
commit f6d23cc621
4 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -1033,14 +1033,14 @@ void Ekf::checkForStuckRange()
{
if (_range_data_ready && _range_sample_delayed.time_us - _time_last_rng_ready > (uint64_t)10e6 &&
_control_status.flags.in_air) {
_rng_stuck = true;
_control_status.flags.rng_stuck = true;
//require a variance of rangefinder values to check for "stuck" measurements
if (_rng_check_max_val - _rng_check_min_val > 1.0f) {
_time_last_rng_ready = _range_sample_delayed.time_us;
_rng_check_min_val = 0.0f;
_rng_check_max_val = 0.0f;
_rng_stuck = false;
_control_status.flags.rng_stuck = false;
} else {
if (_range_sample_delayed.rng > _rng_check_max_val) {