Skip to content

Commit

Permalink
AP_DDS: status topic to report RC failsafe with callback function
Browse files Browse the repository at this point in the history
  • Loading branch information
tizianofiorenzani authored and peterbarker committed Nov 14, 2024
1 parent c03960c commit 86f2167
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libraries/AP_DDS/AP_DDS_Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,15 +632,17 @@ bool AP_DDS_Client::update_topic(ardupilot_msgs_msg_Status& msg)
msg.external_control = true; // Always true for now. To be filled after PR#28429.
uint8_t fs_iter = 0;
msg.failsafe_size = 0;
if (AP_Notify::flags.failsafe_radio) {
if (rc().in_rc_failsafe()) {
msg.failsafe[fs_iter++] = FS_RADIO;
}
if (battery.has_failsafed()) {
msg.failsafe[fs_iter++] = FS_BATTERY;
}
// TODO: replace flag with function.
if (AP_Notify::flags.failsafe_gcs) {
msg.failsafe[fs_iter++] = FS_GCS;
}
// TODO: replace flag with function.
if (AP_Notify::flags.failsafe_ekf) {
msg.failsafe[fs_iter++] = FS_EKF;
}
Expand Down

0 comments on commit 86f2167

Please sign in to comment.