From e26711af7d98811433ffd566ebe957dc07c26dfb Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Sat, 5 May 2018 16:34:55 +1000 Subject: [PATCH] EKF: relax terrain update requirements for continuing optical flow use --- EKF/control.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EKF/control.cpp b/EKF/control.cpp index 04cb8c974b..795a0bef23 100644 --- a/EKF/control.cpp +++ b/EKF/control.cpp @@ -441,8 +441,8 @@ void Ekf::controlOpticalFlowFusion() } } - // fuse the data if the terrain/distance to bottom is valid - if (_control_status.flags.opt_flow && get_terrain_valid()) { + // fuse the data if the terrain/distance to bottom is valid but use a more relaxed check to enable it to survive bad range finder data + if (_control_status.flags.opt_flow && (_time_last_imu - _time_last_hagl_fuse < (uint64_t)10e6)) { // Update optical flow bias estimates calcOptFlowBias();