mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-13 22:20:35 +08:00
Add Traffic Avoidance System (ADSB/FLARM) Arming Check (#26390)
* Add traffic avoidance system checks * Update msg/px4_msgs_old/msg/VehicleStatusV1.msg Co-authored-by: Hamish Willee <hamishwillee@gmail.com> * docs: add arming check for traffic avoidance systems in ADS-B/FLARM documentation * fix formating * trafficAvoidanceCheck: switch case for configuration options --------- Co-authored-by: Hamish Willee <hamishwillee@gmail.com> Co-authored-by: Matthias Grob <maetugr@gmail.com>
This commit is contained in:
committed by
Matthias Grob
parent
adc9a6d35d
commit
05de941399
@@ -2880,6 +2880,22 @@ void Commander::dataLinkCheck()
|
||||
_vehicle_status.open_drone_id_system_present = true;
|
||||
_vehicle_status.open_drone_id_system_healthy = healthy;
|
||||
}
|
||||
|
||||
// Traffic avoidance system (ADSB or FLARM)
|
||||
if (telemetry.heartbeat_type_adsb || telemetry.heartbeat_type_flarm) {
|
||||
if (_traffic_avoidance_system_lost) { // recovered
|
||||
_traffic_avoidance_system_lost = false;
|
||||
|
||||
if (_datalink_last_heartbeat_traffic_avoidance_system != 0) {
|
||||
mavlink_log_info(&_mavlink_log_pub, "Traffic avoidance system regained\t");
|
||||
events::send(events::ID("commander_traffic_avoidance_regained"), events::Log::Info,
|
||||
"Traffic avoidance system regained");
|
||||
}
|
||||
}
|
||||
|
||||
_datalink_last_heartbeat_traffic_avoidance_system = telemetry.timestamp;
|
||||
_vehicle_status.traffic_avoidance_system_present = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2931,6 +2947,16 @@ void Commander::dataLinkCheck()
|
||||
_open_drone_id_system_lost = true;
|
||||
_status_changed = true;
|
||||
}
|
||||
|
||||
// Traffic avoidance system (ADSB/FLARM)
|
||||
if ((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");
|
||||
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;
|
||||
_status_changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Commander::battery_status_check()
|
||||
|
||||
Reference in New Issue
Block a user