EKF: Rework range height validity checking

Eliminate race condition caused by checking for data freshness using time stamps from buffer push instead than buffer pop events.
Consistent use of range data ready and range data fault flags. This achieved by ensuring that _rng_hgt_faulty is set to true for all range data faults, not just data freshness.
Include range data validity requirement in rangeAidConditionsMet() check.
This commit is contained in:
Paul Riseborough
2018-07-26 07:53:39 +02:00
committed by Lorenz Meier
parent e0bcfeb533
commit 17d40478bb
3 changed files with 30 additions and 24 deletions
+1 -1
View File
@@ -94,7 +94,7 @@ void Ekf::runTerrainEstimator()
_terrain_var = math::constrain(_terrain_var, 0.0f, 1e4f);
// Fuse range finder data if available
if (_range_data_ready && !_control_status.flags.rng_stuck) {
if (_range_data_ready && !_rng_hgt_faulty) {
fuseHagl();
// update range sensor angle parameters in case they have changed