From c56f84fe8a089d1cd16480f5e9c3269001196b66 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Thu, 27 Jun 2024 18:28:42 -0400 Subject: [PATCH] ekf2: range, check if terrain valid for reset on fusion timeout --- .../ekf2/EKF/aid_sources/range_finder/range_height_control.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/ekf2/EKF/aid_sources/range_finder/range_height_control.cpp b/src/modules/ekf2/EKF/aid_sources/range_finder/range_height_control.cpp index 104ec47d91..93e15766ea 100644 --- a/src/modules/ekf2/EKF/aid_sources/range_finder/range_height_control.cpp +++ b/src/modules/ekf2/EKF/aid_sources/range_finder/range_height_control.cpp @@ -187,7 +187,7 @@ void Ekf::controlRangeHaglFusion() } else if (is_fusion_failing) { // Some other height source is still working - if (_hagl_sensor_status.flags.flow) { + if (_hagl_sensor_status.flags.flow && isTerrainEstimateValid()) { ECL_WARN("stopping %s fusion, fusion failing", HGT_SRC_NAME); stopRngHgtFusion(); stopRngTerrFusion();