From 3328f77ebf9ee7509b2ed97764e4b759bcae42fc Mon Sep 17 00:00:00 2001 From: Claudio Micheli Date: Mon, 18 Mar 2024 19:16:40 +0100 Subject: [PATCH] commander: improve failsafe messaging Signed-off-by: Claudio Micheli --- .../checks/rcAndDataLinkCheck.cpp | 2 +- src/modules/commander/failsafe/framework.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/modules/commander/HealthAndArmingChecks/checks/rcAndDataLinkCheck.cpp b/src/modules/commander/HealthAndArmingChecks/checks/rcAndDataLinkCheck.cpp index 660a792f85..9f09c2a645 100644 --- a/src/modules/commander/HealthAndArmingChecks/checks/rcAndDataLinkCheck.cpp +++ b/src/modules/commander/HealthAndArmingChecks/checks/rcAndDataLinkCheck.cpp @@ -51,7 +51,7 @@ void RcAndDataLinkChecks::checkAndReport(const Context &context, Report &reporte if (!reporter.failsafeFlags().manual_control_signal_lost && _last_valid_manual_control_setpoint > 0) { - events::send(events::ID("commander_rc_lost"), {events::Log::Critical, events::LogInternal::Info}, + events::send(events::ID("commander_rc_lost"), {events::Log::Info, events::LogInternal::Info}, "Manual control lost"); } diff --git a/src/modules/commander/failsafe/framework.cpp b/src/modules/commander/failsafe/framework.cpp index 16a3678d81..5d581caea8 100644 --- a/src/modules/commander/failsafe/framework.cpp +++ b/src/modules/commander/failsafe/framework.cpp @@ -195,7 +195,7 @@ void FailsafeBase::notifyUser(uint8_t user_intended_mode, Action action, Action events::send( events::ID("commander_failsafe_enter_generic_hold"), {events::Log::Critical, events::LogInternal::Warning}, - "Failsafe, triggering {2} in {3} seconds", mavlink_mode, failsafe_action, + "Failsafe activated: switching to {2} in {3} seconds", mavlink_mode, failsafe_action, (uint16_t) delay_s); } else { @@ -204,11 +204,11 @@ void FailsafeBase::notifyUser(uint8_t user_intended_mode, Action action, Action events::send( events::ID("commander_failsafe_enter_hold"), {events::Log::Critical, events::LogInternal::Warning}, - "{4}, triggering {2} in {3} seconds", mavlink_mode, failsafe_action, + "{4}: switching to {2} in {3} seconds", mavlink_mode, failsafe_action, (uint16_t) delay_s, failsafe_cause); } - mavlink_log_critical(&_mavlink_log_pub, "Failsafe activated, entering Hold for %i seconds\t", delay_s); + mavlink_log_critical(&_mavlink_log_pub, "Failsafe activated: entering Hold for %i seconds\t", delay_s); } else { // no delay failsafe_action_t failsafe_action = (failsafe_action_t)action; @@ -222,16 +222,16 @@ void FailsafeBase::notifyUser(uint8_t user_intended_mode, Action action, Action events::send( events::ID("commander_failsafe_enter_generic_warn"), {events::Log::Warning, events::LogInternal::Warning}, - "Failsafe warning triggered", mavlink_mode); + "Failsafe warning:", mavlink_mode); } else { /* EVENT * @type append_health_and_arming_messages */ - events::send( + events::send( events::ID("commander_failsafe_enter_generic"), {events::Log::Critical, events::LogInternal::Warning}, - "Failsafe, triggering {2}", mavlink_mode, failsafe_action); + "Failsafe activated: Autopilot disengaged", mavlink_mode); } } else { @@ -262,7 +262,7 @@ void FailsafeBase::notifyUser(uint8_t user_intended_mode, Action action, Action events::send( events::ID("commander_failsafe_enter_warn"), {events::Log::Warning, events::LogInternal::Warning}, - "Failsafe warning triggered due to {2}", mavlink_mode, failsafe_cause); + "Failsafe warning: {2}", mavlink_mode, failsafe_cause); } @@ -272,7 +272,7 @@ void FailsafeBase::notifyUser(uint8_t user_intended_mode, Action action, Action events::send( events::ID("commander_failsafe_enter"), {events::Log::Critical, events::LogInternal::Warning}, - "{3}, triggering {2}", mavlink_mode, failsafe_action, failsafe_cause); + "{3}: switching to {2}", mavlink_mode, failsafe_action, failsafe_cause); } }