From 1fef3d28dfdf269e64583b419f677a9c3a10ce2f Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Wed, 14 Aug 2024 14:43:57 +0200 Subject: [PATCH] Commander: only add *autopilot disengaged* to failsafe notifactions in special cases Signed-off-by: Silvan Fuhrer --- src/modules/commander/failsafe/framework.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/modules/commander/failsafe/framework.cpp b/src/modules/commander/failsafe/framework.cpp index 9f88f85f3e8e..1eddc8a7f81c 100644 --- a/src/modules/commander/failsafe/framework.cpp +++ b/src/modules/commander/failsafe/framework.cpp @@ -224,6 +224,16 @@ void FailsafeBase::notifyUser(uint8_t user_intended_mode, Action action, Action {events::Log::Warning, events::LogInternal::Warning}, "Failsafe warning:", mavlink_mode); + } else if (action == Action::Descend || action == Action::FallbackAltCtrl || action == Action::FallbackStab) { + /* EVENT + * @description Failsafe actions that disengage the autopilot (remove position control) + * @type append_health_and_arming_messages + */ + events::send( + events::ID("commander_failsafe_enter_autopilot_disengaged"), + {events::Log::Critical, events::LogInternal::Warning}, + "Failsafe activated: Autopilot disengaged, switching to {2}", mavlink_mode, failsafe_action); + } else { /* EVENT * @type append_health_and_arming_messages @@ -231,7 +241,7 @@ void FailsafeBase::notifyUser(uint8_t user_intended_mode, Action action, Action events::send( events::ID("commander_failsafe_enter_generic"), {events::Log::Critical, events::LogInternal::Warning}, - "Failsafe activated: Autopilot disengaged, switching to {2}", mavlink_mode, failsafe_action); + "Failsafe activated: switching to {2}", mavlink_mode, failsafe_action); } } else {