mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-12-01 05:32:58 +08:00
comander: trigger failsafe when navigator reports failure
This commit is contained in:
1 parent
9f69e9ee6c
commit
25fcb3c913
7 files changed
+115
-2
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user