Skip to content

AP_Camera: mavlink commands use target sysid and compid #30517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions libraries/AP_Camera/AP_Camera_MAVLinkCamV2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ bool AP_Camera_MAVLinkCamV2::trigger_pic()

// prepare and send message
mavlink_command_long_t pkt {};
pkt.target_system = _sysid;
pkt.target_component = _compid;
pkt.command = MAV_CMD_IMAGE_START_CAPTURE;
pkt.param3 = 1; // number of images to take
pkt.param4 = image_index+1; // starting sequence number
Expand All @@ -49,6 +51,8 @@ bool AP_Camera_MAVLinkCamV2::record_video(bool start_recording)

// prepare and send message
mavlink_command_long_t pkt {};
pkt.target_system = _sysid;
pkt.target_component = _compid;

if (start_recording) {
pkt.command = MAV_CMD_VIDEO_START_CAPTURE;
Expand All @@ -74,6 +78,8 @@ bool AP_Camera_MAVLinkCamV2::set_zoom(ZoomType zoom_type, float zoom_value)

// prepare and send message
mavlink_command_long_t pkt {};
pkt.target_system = _sysid;
pkt.target_component = _compid;
pkt.command = MAV_CMD_SET_CAMERA_ZOOM;
switch (zoom_type) {
case ZoomType::RATE:
Expand Down Expand Up @@ -101,6 +107,8 @@ SetFocusResult AP_Camera_MAVLinkCamV2::set_focus(FocusType focus_type, float foc

// prepare and send message
mavlink_command_long_t pkt {};
pkt.target_system = _sysid;
pkt.target_component = _compid;
pkt.command = MAV_CMD_SET_CAMERA_FOCUS;
switch (focus_type) {
case FocusType::RATE:
Expand Down
Loading