ekf2: optical flow failing also reset terrain if needed

This commit is contained in:
Daniel Agar 2024-06-27 17:54:35 -04:00
parent ea8f14b883
commit 6be06ecbb3

View File

@ -145,6 +145,10 @@ void Ekf::controlOpticalFlowFusion(const imuSample &imu_delayed)
if (is_flow_required) {
resetFlowFusion();
if (_hagl_sensor_status.flags.flow && !isTerrainEstimateValid()) {
resetTerrainToFlow();
}
} else {
stopFlowFusion();
}