Skip to content

Add simulated mavlink camera#11178

Merged
DonLakeFlyer merged 1 commit intomasterfrom
SimulatedCameraControl
Mar 2, 2024
Merged

Add simulated mavlink camera#11178
DonLakeFlyer merged 1 commit intomasterfrom
SimulatedCameraControl

Conversation

@DonLakeFlyer
Copy link
Collaborator

@DonLakeFlyer DonLakeFlyer commented Mar 2, 2024

Previously PhotoVideoControl has all sorts of crazy complicated code in it to support:

The goal being to show the user a consistent interface for video/photo capture even though behind the scenes it was doing different things to make it happen.

In order to clean up the insanity in PhotoVideoControl the changes in this pull instead do this:

  • Photo video control only works with mavlink protocol cameras
  • Created an abstract base class called MavlinkCameraControl from QGCCameraControl. QGCCameraControl is the upper level C++ class which managed the interaction of a mavlink camera with the QGC UI.
  • Renamed QGCCameraControl to VehicleCameraControl
  • Created a new SimulatedCameraControl which simulates a mavlink camera, but in reality it is
    • Using a manually setup video stream if available
    • Doing photo capture using DO_DIGICAM_CONTROL if the settings is set for a simple camera
    • It does not currently support time lapse captures although that could be added if someone wants to contribute
    • This provides a place to include other "simple" camera support, although I believe it's much better to focus new work on full protocol support
  • If a vehicle has no real mavlink camera associated with it the simulated camera is exposed by the vehicle

In this way the upper levels of the code solely deal with mavlink protocol cameras greatly simplifying the creation of photo/video control ui.

This is a fairly extensive change to the internals of QGC camera support. I've tested it quite a bit but I'm pretty sure I broke some boundary cases along the way. Could certainly use help from folks using cameras (mavlink and simple) to test.

If you don't know, PhotoVideoControl is this...
Screenshot 2024-02-29 at 3 38 39 PM

This camera is made available when there are no mavlink cameras on the vehicle. It simulates a mavlink camera over a manual video stream setup and the use of DO_DIGICAM_CONTROL simple camera display setting.
@DonLakeFlyer DonLakeFlyer force-pushed the SimulatedCameraControl branch from 50477eb to c5e9462 Compare March 2, 2024 21:17
@DonLakeFlyer DonLakeFlyer merged commit 7f4cb9f into master Mar 2, 2024
@DonLakeFlyer DonLakeFlyer deleted the SimulatedCameraControl branch March 2, 2024 21:59
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.

1 participant