From eb1bb4335b0e40ae2a359ffdfc49c3f90af4f036 Mon Sep 17 00:00:00 2001 From: Nicolas MARTIN <59083163+NicolasM0@users.noreply.github.com> Date: Sat, 9 Apr 2022 20:30:49 +0200 Subject: [PATCH] commander: fix enable_failsafe reason (#19391) - In this case, no action is configured for datalink lost. Action is configured for RC lost. - In case of no data link and no rc failsafe is enabled but reporting a "no_datalink" reason but "no_rc_and_no_datalink" seems more explicit. --- src/modules/commander/state_machine_helper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/commander/state_machine_helper.cpp b/src/modules/commander/state_machine_helper.cpp index 75fb5b6094..1e3a66da52 100644 --- a/src/modules/commander/state_machine_helper.cpp +++ b/src/modules/commander/state_machine_helper.cpp @@ -412,7 +412,7 @@ bool set_nav_state(vehicle_status_s &status, actuator_armed_s &armed, commander_ // All links lost, no data link loss reaction configured -> immediately do RC loss reaction // Lost all communication, by default it's considered unsafe to continue the mission // This is only reached when flying mission completely without RC (it was not present since boot) - enable_failsafe(status, old_failsafe, mavlink_log_pub, event_failsafe_reason_t::no_datalink); + enable_failsafe(status, old_failsafe, mavlink_log_pub, event_failsafe_reason_t::no_rc_and_no_datalink); set_link_loss_nav_state(status, armed, status_flags, internal_state, rc_loss_act, 0); } else if (status.rc_signal_lost && (param_com_rcl_except & RCLossExceptionBits::RCL_EXCEPT_MISSION) @@ -462,7 +462,7 @@ bool set_nav_state(vehicle_status_s &status, actuator_armed_s &armed, commander_ // All links lost, no data link loss reaction configured -> immediately do RC loss reaction // Lost all communication, by default it's considered unsafe to continue the mission // This is only reached when flying mission completely without RC (it was not present since boot) - enable_failsafe(status, old_failsafe, mavlink_log_pub, event_failsafe_reason_t::no_datalink); + enable_failsafe(status, old_failsafe, mavlink_log_pub, event_failsafe_reason_t::no_rc_and_no_datalink); set_link_loss_nav_state(status, armed, status_flags, internal_state, rc_loss_act, 0); } else { @@ -578,7 +578,7 @@ bool set_nav_state(vehicle_status_s &status, actuator_armed_s &armed, commander_ // All links lost, no data link loss reaction configured -> immediately do RC loss reaction // Lost all communication, by default it's considered unsafe to continue the mission // This is only reached when flying mission completely without RC (it was not present since boot) - enable_failsafe(status, old_failsafe, mavlink_log_pub, event_failsafe_reason_t::no_datalink); + enable_failsafe(status, old_failsafe, mavlink_log_pub, event_failsafe_reason_t::no_rc_and_no_datalink); set_link_loss_nav_state(status, armed, status_flags, internal_state, rc_loss_act, 0); } else {