Skip to content

Commit

Permalink
Commander: only add *autopilot disengaged* to failsafe notifactions i…
Browse files Browse the repository at this point in the history
…n special cases

Signed-off-by: Silvan Fuhrer <[email protected]>
  • Loading branch information
sfuhrer authored and bresch committed Aug 16, 2024
1 parent f7e6e13 commit 4a3cbec
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/modules/commander/failsafe/framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,24 @@ 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<uint32_t, events::px4::enums::failsafe_action_t>(
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
*/
events::send<uint32_t, events::px4::enums::failsafe_action_t>(
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 {
Expand Down

0 comments on commit 4a3cbec

Please sign in to comment.