Skip to content

Commit

Permalink
Add target ID for NAV_CMD_SET_CAMERA_MODE
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishwillee committed May 23, 2024
1 parent d97bae2 commit 66934dc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/modules/navigator/navigator_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,17 @@ void Navigator::publish_vehicle_cmd(vehicle_command_s *vcmd)

if (target_camera_component_id > 0 && target_camera_component_id < 256) {
vcmd->target_component = target_camera_component_id;
} else {
vcmd->target_component = 100; // MAV_COMP_ID_CAMERA
}

break;

case NAV_CMD_SET_CAMERA_MODE:
target_camera_component_id = static_cast<int>(vcmd->param1); // Target id from param 1

if (target_camera_component_id > 0 && target_camera_component_id < 256) {
vcmd->target_component = target_camera_component_id;
} else {
vcmd->target_component = 100; // MAV_COMP_ID_CAMERA
}
Expand All @@ -1419,7 +1429,6 @@ void Navigator::publish_vehicle_cmd(vehicle_command_s *vcmd)

if (target_camera_component_id > 0 && target_camera_component_id < 256) {
vcmd->target_component = target_camera_component_id;

} else {
vcmd->target_component = 100; // MAV_COMP_ID_CAMERA
}
Expand Down

0 comments on commit 66934dc

Please sign in to comment.