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 <claudio@auterion.com>

---------

Signed-off-by: Claudio Micheli <claudio@auterion.com>
Co-authored-by: Claudio Micheli <claudio@auterion.com>
This commit is contained in:
Claudio Chies 2026-03-26 18:41:33 -07:00 committed by GitHub
parent 565781e688
commit 5a4c13fc23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View File

@ -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;

View File

@ -350,6 +350,7 @@ private:
(ParamInt<px4::params::COM_FLIGHT_UUID>) _param_com_flight_uuid,
(ParamInt<px4::params::COM_TAKEOFF_ACT>) _param_com_takeoff_act,
(ParamFloat<px4::params::COM_CPU_MAX>) _param_com_cpu_max,
(ParamBool<px4::params::COM_ARM_ON_BOOT>) _param_com_arm_on_boot
(ParamBool<px4::params::COM_ARM_ON_BOOT>) _param_com_arm_on_boot,
(ParamInt<px4::params::COM_ARM_TRAFF>) _param_com_arm_traff
)
};