mavlink: use dynamic camera comp id instead of hardcoded value

This commit is contained in:
Igor Mišić
2021-07-31 12:41:49 -04:00
committed by GitHub
parent 6379f2b032
commit af2247bd94
6 changed files with 26 additions and 3 deletions
+6
View File
@@ -2001,6 +2001,8 @@ MavlinkReceiver::handle_message_heartbeat(mavlink_message_t *msg)
if (same_system || hb.type == MAV_TYPE_GCS) {
camera_status_s camera_status{};
switch (hb.type) {
case MAV_TYPE_ANTENNA_TRACKER:
_heartbeat_type_antenna_tracker = now;
@@ -2024,6 +2026,10 @@ MavlinkReceiver::handle_message_heartbeat(mavlink_message_t *msg)
case MAV_TYPE_CAMERA:
_heartbeat_type_camera = now;
camera_status.timestamp = now;
camera_status.active_comp_id = msg->compid;
camera_status.active_sys_id = msg->sysid;
_camera_status_pub.publish(camera_status);
break;
default: