ekf2: range, check if terrain valid for reset on fusion timeout

This commit is contained in:
Daniel Agar
2024-06-27 18:28:42 -04:00
parent e52025cc20
commit c56f84fe8a
@@ -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();