From 5a4c13fc238aa7dd287daf554106fced5fd98a7e Mon Sep 17 00:00:00 2001 From: Claudio Chies <61051109+Claudio-Chies@users.noreply.github.com> Date: Thu, 26 Mar 2026 18:41:33 -0700 Subject: [PATCH] fix(commander): ADSB timeout modification and cosmetics (#26878) * fix(commander): add tab character to critical system loss messages * fix(commander): extend timeout for traffic avoidance system heartbeat check * Commander: Only Warn the user about traffic avoidance system loss if COM_ARM_TRAFF is set Signed-off-by: Claudio Micheli --------- Signed-off-by: Claudio Micheli Co-authored-by: Claudio Micheli --- src/modules/commander/Commander.cpp | 8 ++++---- src/modules/commander/Commander.hpp | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/modules/commander/Commander.cpp b/src/modules/commander/Commander.cpp index 7a4ea1259d..105ca39168 100644 --- a/src/modules/commander/Commander.cpp +++ b/src/modules/commander/Commander.cpp @@ -2950,7 +2950,7 @@ void Commander::dataLinkCheck() // Parachute system if ((hrt_elapsed_time(&_datalink_last_heartbeat_parachute_system) > 3_s) && !_parachute_system_lost) { - mavlink_log_critical(&_mavlink_log_pub, "Parachute system lost"); + mavlink_log_critical(&_mavlink_log_pub, "Parachute system lost\t"); _vehicle_status.parachute_system_present = false; _vehicle_status.parachute_system_healthy = false; _parachute_system_lost = true; @@ -2960,7 +2960,7 @@ void Commander::dataLinkCheck() // Remote ID system if ((hrt_elapsed_time(&_datalink_last_heartbeat_open_drone_id_system) > 3_s) && !_open_drone_id_system_lost) { - mavlink_log_critical(&_mavlink_log_pub, "Remote ID system lost"); + mavlink_log_critical(&_mavlink_log_pub, "Remote ID system lost\t"); events::send(events::ID("commander_remote_id_lost"), events::Log::Critical, "Remote ID system lost"); _vehicle_status.open_drone_id_system_present = false; _vehicle_status.open_drone_id_system_healthy = false; @@ -2969,9 +2969,9 @@ void Commander::dataLinkCheck() } // Traffic avoidance system (ADSB/FLARM) - if ((hrt_elapsed_time(&_datalink_last_heartbeat_traffic_avoidance_system) > 3_s) + if ((_param_com_arm_traff.get() > 0) && (hrt_elapsed_time(&_datalink_last_heartbeat_traffic_avoidance_system) > 3_s) && !_traffic_avoidance_system_lost) { - mavlink_log_critical(&_mavlink_log_pub, "Traffic avoidance system lost"); + mavlink_log_critical(&_mavlink_log_pub, "Traffic avoidance system lost\t"); events::send(events::ID("commander_traffic_avoidance_lost"), events::Log::Critical, "Traffic avoidance system lost"); _vehicle_status.traffic_avoidance_system_present = false; _traffic_avoidance_system_lost = true; diff --git a/src/modules/commander/Commander.hpp b/src/modules/commander/Commander.hpp index db6aa1d65d..20af57787e 100644 --- a/src/modules/commander/Commander.hpp +++ b/src/modules/commander/Commander.hpp @@ -350,6 +350,7 @@ private: (ParamInt) _param_com_flight_uuid, (ParamInt) _param_com_takeoff_act, (ParamFloat) _param_com_cpu_max, - (ParamBool) _param_com_arm_on_boot + (ParamBool) _param_com_arm_on_boot, + (ParamInt) _param_com_arm_traff ) };