ekf2: cleanup terrain estimator init (shouldn't be valid by default)

- with Ekf::initialiseFilter() resetting _time_last_hagl_fuse the terrain estimate was technically valid regardless of any range or flow data availability and as a result optical flow fusion is able to start and stay active
 - only consider terrain estimate valid based on control status flags and recent fusion
This commit is contained in:
Daniel Agar
2022-11-14 09:29:46 -05:00
committed by GitHub
parent d7fde289de
commit bd5bc9d207
5 changed files with 608 additions and 613 deletions
-2
View File
@@ -204,8 +204,6 @@ bool Ekf::initialiseFilter()
_time_last_hgt_fuse = _imu_sample_delayed.time_us;
_time_last_hor_pos_fuse = _imu_sample_delayed.time_us;
_time_last_hor_vel_fuse = _imu_sample_delayed.time_us;
_time_last_hagl_fuse = _imu_sample_delayed.time_us;
_time_last_flow_terrain_fuse = _imu_sample_delayed.time_us;
// reset the output predictor state history to match the EKF initial values
alignOutputFilter();