mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 06:13:33 +08:00
ekf2: reset ekf preflight checks on takeoff correctly
Using the control status flags isn't robust as this part of the code runs at the EKF update rate while the in_air transition is don at the prediction rate. It was then likely to miss the transition
This commit is contained in:
committed by
Mathieu Bresciani
parent
a8b342722e
commit
7996a1a70f
@@ -558,6 +558,8 @@ void EKF2::Run()
|
||||
_gyro_cal = {};
|
||||
_mag_cal = {};
|
||||
|
||||
_preflt_checker.reset();
|
||||
|
||||
} else if (was_in_air && !in_air) {
|
||||
// landed
|
||||
_ekf.set_in_air_status(false);
|
||||
@@ -900,10 +902,6 @@ void EKF2::PublishInnovations(const hrt_abstime ×tamp)
|
||||
_preflt_checker.setUsingEvHgtAiding(_ekf.control_status_flags().ev_hgt);
|
||||
|
||||
_preflt_checker.update(_ekf.get_imu_sample_delayed().delta_ang_dt, innovations);
|
||||
|
||||
} else if (_ekf.control_status_flags().in_air != _ekf.control_status_prev_flags().in_air) {
|
||||
// reset preflight checks if transitioning back to landed
|
||||
_preflt_checker.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user