Skip to content

Commit

Permalink
AP_OpenDroneID: report if we lose operator location
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Aug 15, 2022
1 parent c955c75 commit b6186db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libraries/AP_OpenDroneID/AP_OpenDroneID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ void AP_OpenDroneID::send_static_out()
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "ODID: transmitter OK");
}

// we need to notify user if we lost system msg with operator location
if (now_ms - last_system_ms > 5000 && now_ms - last_lost_operator_msg_ms > 5000) {
last_lost_operator_msg_ms = now_ms;
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "ODID: lost operator location");
}

const uint32_t msg_spacing_ms = _mavlink_static_period_ms / 4;
if (now_ms - last_msg_send_ms >= msg_spacing_ms) {
// allow update of channel during setup, this makes it easy to debug with a GCS
Expand Down
3 changes: 3 additions & 0 deletions libraries/AP_OpenDroneID/AP_OpenDroneID.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ class AP_OpenDroneID
// last time we sent a lost transmitter message
uint32_t last_lost_tx_ms;

// last time we sent a lost operator location notice
uint32_t last_lost_operator_msg_ms;

// transmit functions to manually send a static MAVLink message
void send_dynamic_out();
void send_static_out();
Expand Down

0 comments on commit b6186db

Please sign in to comment.