From e52025cc2068fde1399067d13799769cc441562f Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Thu, 27 Jun 2024 17:57:03 -0400 Subject: [PATCH] ekf2: optical flow fusion timeout only reset if quality is good --- .../ekf2/EKF/aid_sources/optical_flow/optical_flow_control.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/ekf2/EKF/aid_sources/optical_flow/optical_flow_control.cpp b/src/modules/ekf2/EKF/aid_sources/optical_flow/optical_flow_control.cpp index 299a9931cd..85e4e5ebe1 100644 --- a/src/modules/ekf2/EKF/aid_sources/optical_flow/optical_flow_control.cpp +++ b/src/modules/ekf2/EKF/aid_sources/optical_flow/optical_flow_control.cpp @@ -142,7 +142,7 @@ void Ekf::controlOpticalFlowFusion(const imuSample &imu_delayed) // handle the case when we have optical flow, are reliant on it, but have not been using it for an extended period if (isTimedOut(_aid_src_optical_flow.time_last_fuse, _params.no_aid_timeout_max)) { - if (is_flow_required) { + if (is_flow_required && is_quality_good) { resetFlowFusion(); if (_hagl_sensor_status.flags.flow && !isTerrainEstimateValid()) {