Skip to content

camera_server: callback subscriptions for MAV_CMD_SET_CAMERA_MODE #1

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

Open
wants to merge 9 commits into
base: camera-server
Choose a base branch
from

Conversation

dayjaby
Copy link

@dayjaby dayjaby commented Feb 1, 2022

I keep the auto-generated commits and the implementation commits separate. So feel free to check the correct commit if you want less noise.

Added subscriptions to your camera_server plugin, where the user can provide callbacks for the three modes from MAV_CMD_SET_CAMERA_MODE (image / video / survey).

The reason for having three different subscriptions is that we can automatically deduce the capability flags of the camera, e.g.

void CameraServerImpl::subscribe_set_camera_mode_image(
    CameraServer::SetCameraModeImageCallback callback)
{
    _information_flags |= CAMERA_CAP_FLAGS::CAMERA_CAP_FLAGS_CAPTURE_IMAGE;
    check_modes_available();
}

check_modes_available checks whether we already have more than one mode defined, in which case the flag CAMERA_CAP_FLAGS_HAS_MODES gets added.

We can do the same for zoom and focus.

Furthermore, I added the cam_definition_uri to the camera Information (as well as tried to match the field names in Information more closely to the corresponding mavlink message). This minor change already allows QGroundControl to display the camera interface:

image

@dlech
Copy link
Owner

dlech commented Feb 14, 2022

Hi David, I missed the notification for this, so I'm just looking at it for the first time now. I just rebased my previous work on upstream and made some pull requests for discussion. We should probably discuss the .proto API first before getting into the implementation details. mavlink/MAVSDK-Proto#274

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants