mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 07:28:54 +08:00
EKF: Fix inconsistency in timeout for terrain validity
Terrain validity is determined solely by successful range finder fusion and terrain state initialisation. A range finder that has been declared faulty requires continuous range finder data fusion requires data to be continuous before the fault status _rng_hgt_faulty can be cleared. This will enforce the requirement for continuous data before fusion can commence.
This commit is contained in:
committed by
Lorenz Meier
parent
d1d49857f9
commit
628079719f
@@ -1144,6 +1144,11 @@ void Ekf::checkRangeDataValidity()
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't allow faulty flag to clear unless range data is continuous
|
||||
if (_rng_hgt_faulty && !_range_data_continuous) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't run the checks after this unless we have retrieved new data from the buffer
|
||||
if (!_range_data_ready) {
|
||||
return;
|
||||
|
||||
@@ -171,8 +171,7 @@ bool Ekf::get_terrain_valid()
|
||||
// determine terrain validity
|
||||
void Ekf::update_terrain_valid()
|
||||
{
|
||||
if (_terrain_initialised && _range_data_continuous && !_control_status.flags.rng_stuck &&
|
||||
(_time_last_imu - _time_last_hagl_fuse < (uint64_t)5e6)) {
|
||||
if (_terrain_initialised && (_time_last_imu - _time_last_hagl_fuse < (uint64_t)5e6)) {
|
||||
|
||||
_hagl_valid = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user