Skip to content
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

common: add set-camera-source command #351

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

rmackay9
Copy link

@rmackay9 rmackay9 commented Feb 8, 2024

This adds a mavlink command to change the active camera lens (e.g. which camera lens is being streamed to the GCS). This is useful for cameras with multiple lenses like the ViewPro and Xacti cameras.

This has already been merged upstream albeit after much discussion. mavlink#2079

This also includes the unused mavlink command MAV_CMD_SET_STORAGE_USAGE which AP doesn't use but is directly above this new command in common.xml.

@auturgy
Copy link

auturgy commented Feb 8, 2024

Why not just treat changing the active lens as changing camera mode?

@rmackay9
Copy link
Author

rmackay9 commented Feb 9, 2024

@auturgy,

Thanks for the review. I thought of using camera-mode but the purpose of the SET_CAMERA_MODE command (and enum) appears to be switching between picture-taking-mode and video-taking-mode.. so a different purpose.

With the ViewPro cameras there are 3 to 7 different combinations of "lenses".

@auturgy
Copy link

auturgy commented Feb 9, 2024

I understand the problem :)
I do have a few issues with this approach though. A "lens" usually refers to the pieces of glass in front of the imager: for many cinematic and survey cameras, this is as true as it is for your normal DSLR. What you're talking about is different imagers managed by the same "camera", not different lenses. It's more correct to treat these as different cameras than different lenses (although the camera microservice does already have the concept of lenses).
From a mavlink perspective, adding additional messages/commands ad-hoc is not going to fly upstream without stronger justification, and as this is a PR into common, for it to be accessible to QGC and the wider ecosystem, there is no option but to work with mavlink/mavlink.

@rmackay9
Copy link
Author

rmackay9 commented Feb 9, 2024

@auturgy,

Yes, I've raised a PR upstream and I'm looking forward to feedback.

It's really not two separate cameras though because they don't have separate controls. For example once the thermal lens (or whatever we call it) has become the active lens, other lens cannot be controlled. So it acts like a single camera with multiple lenses.

I'm very open to alternative solutions..

@rmackay9 rmackay9 force-pushed the camera-set-lens branch 2 times, most recently from 5ed8572 to 0a69ff2 Compare March 16, 2024 03:35
@rmackay9 rmackay9 changed the title common: add set-camera-lens command common: add set-camera-source command Mar 18, 2024
@tridge tridge merged commit 1e04d8b into ArduPilot:master Mar 18, 2024
10 checks passed
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.

4 participants