comander: trigger failsafe when navigator reports failure

This commit is contained in:
bresch
2024-08-14 11:08:02 +02:00
committed by Mathieu Bresciani
parent 9f69e9ee6c
commit 25fcb3c913
7 changed files with 115 additions and 2 deletions
@@ -472,6 +472,16 @@ void Failsafe::checkStateAndMode(const hrt_abstime &time_us, const State &state,
CHECK_FAILSAFE(status_flags, local_position_accuracy_low, ActionOptions(Action::RTL));
}
if (state.user_intended_mode == vehicle_status_s::NAVIGATION_STATE_AUTO_TAKEOFF ||
state.user_intended_mode == vehicle_status_s::NAVIGATION_STATE_AUTO_RTL) {
CHECK_FAILSAFE(status_flags, navigator_failure,
ActionOptions(Action::Land).clearOn(ClearCondition::OnModeChangeOrDisarm));
} else {
CHECK_FAILSAFE(status_flags, navigator_failure,
ActionOptions(Action::Hold).clearOn(ClearCondition::OnModeChangeOrDisarm));
}
CHECK_FAILSAFE(status_flags, geofence_breached, fromGfActParam(_param_gf_action.get()).cannotBeDeferred());
// Battery flight time remaining failsafe