mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 01:43:34 +08:00
EKF: Prevent stuck range checks running without new data
This commit is contained in:
committed by
Lorenz Meier
parent
80146273ba
commit
d1d49857f9
+8
-3
@@ -1138,15 +1138,20 @@ void Ekf::rangeAidConditionsMet()
|
||||
|
||||
void Ekf::checkRangeDataValidity()
|
||||
{
|
||||
// reset fault status
|
||||
_rng_hgt_faulty = false;
|
||||
|
||||
// check if out of date
|
||||
if ((_imu_sample_delayed.time_us - _range_sample_delayed .time_us) > 2 * RNG_MAX_INTERVAL) {
|
||||
_rng_hgt_faulty = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't run the checks after this unless we have retrieved new data from the buffer
|
||||
if (!_range_data_ready) {
|
||||
return;
|
||||
} else {
|
||||
// reset fault status when we get new data
|
||||
_rng_hgt_faulty = false;
|
||||
}
|
||||
|
||||
// Check if excessively tilted
|
||||
if (_R_rng_to_earth_2_2 < _params.range_cos_max_tilt) {
|
||||
_rng_hgt_faulty = true;
|
||||
|
||||
Reference in New Issue
Block a user