ekf control: move time_last_in_air/on_ground out of GPS control logic

This commit is contained in:
bresch
2021-02-16 15:21:36 +01:00
committed by Mathieu Bresciani
parent b00d4a9237
commit 04844a04ed
3 changed files with 12 additions and 12 deletions
-9
View File
@@ -120,8 +120,6 @@ void Ekf::controlFusionModes()
_delta_time_baro_us = _baro_sample_delayed.time_us - _delta_time_baro_us;
}
{
// Get range data from buffer and check validity
const bool is_rng_data_ready = _range_buffer.pop_first_older_than(_imu_sample_delayed.time_us, _range_sensor.getSampleAddress());
@@ -599,13 +597,6 @@ void Ekf::controlGpsFusion()
could have been caused by bad GPS.
*/
if (!_control_status.flags.in_air) {
_time_last_on_ground_us = _time_last_imu;
} else {
_time_last_in_air = _time_last_imu;
}
const bool recent_takeoff_nav_failure = _control_status.flags.in_air &&
!isTimedOut(_time_last_on_ground_us, 30000000) &&
isTimedOut(_time_last_hor_vel_fuse, _params.EKFGSF_reset_delay) &&