From 0fc6c813a198138e13a053f28eb2e21179f911a3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 14 Aug 2022 17:02:58 +1000 Subject: [PATCH] AP_OpenDroneID: implement OPEN_DRONE_ID_SYSTEM_UPDATE this is a bandwidth efficient way to update the OPEN_DRONE_ID_SYSTEM message data when there is limited uplink bandwidth. Testing on real vehicles shows that with RFD900x radios at an air data rate of 125kbit/s with OPEN_DRONE_ID messages with 1Hz update (as required by FAA RemoteID standard) that there is significant impact on the ability of the GCS to give commands to the flight controller. For example, I got a high degree of packet loss in downloading parameter pre-flight, and many/most in-flight commands failed from the GCS. By using this message we can use the minimum required bandwidth for updating operator location while remaining FAA RemoteID standard compliant --- libraries/AP_OpenDroneID/AP_OpenDroneID.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libraries/AP_OpenDroneID/AP_OpenDroneID.cpp b/libraries/AP_OpenDroneID/AP_OpenDroneID.cpp index 6d2c9baba6..6bbddd549c 100644 --- a/libraries/AP_OpenDroneID/AP_OpenDroneID.cpp +++ b/libraries/AP_OpenDroneID/AP_OpenDroneID.cpp @@ -595,6 +595,20 @@ void AP_OpenDroneID::handle_msg(mavlink_channel_t chan, const mavlink_message_t mavlink_msg_open_drone_id_system_decode(&msg, &pkt_system); last_system_ms = AP_HAL::millis(); break; + case MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_UPDATE: { + mavlink_open_drone_id_system_update_t pkt_system_update; + mavlink_msg_open_drone_id_system_update_decode(&msg, &pkt_system_update); + pkt_system.operator_latitude = pkt_system_update.operator_latitude; + pkt_system.operator_longitude = pkt_system_update.operator_longitude; + pkt_system.operator_altitude_geo = pkt_system_update.operator_altitude_geo; + pkt_system.timestamp = pkt_system_update.timestamp; + if (last_system_ms != 0) { + // we can only mark this as updated if we have the other + // information already + last_system_ms = AP_HAL::millis(); + } + break; + } } }