Skip to content

Video: Camera and MAVLink Improvements (Draft)#403

Draft
ddd999 wants to merge 1 commit into
stephendade:mavcamerafrom
ddd999:mavcamera
Draft

Video: Camera and MAVLink Improvements (Draft)#403
ddd999 wants to merge 1 commit into
stephendade:mavcamerafrom
ddd999:mavcamera

Conversation

@ddd999

@ddd999 ddd999 commented Jun 13, 2026

Copy link
Copy Markdown

This PR introduces the following improvements to the MAVLink subsystem for camera control. Goal is to resolve #396 and add some additional enhancements/fixes.

  • Force Rpanion to use MavLinkV2 for messages with ID > 255 (MavLinkV1 only supports IDs up to 255)
  • Recognize and respond to a number of additional MavLink camera commands
  • Send StorageInformation updates about free disk space
  • Send CameraImageCaptured after every photo is captured
  • Respond to unsupported requests with the appropriate ACK, rather than ignoring them
  • Fixes an issue where geotagging worked when the camera was triggered in the web UI but not when triggered via MavLink
  • Fixes the issue with video mode failing because the wrong camera modes were being saved
  • Dramatically improved performance of get_camera_caps.py (from ~19s to <1s on Pi Zero 2W) by eliminating unnecessary calls to libcamera
  • Add/update unit tests for better coverage

TODO still:

  • Looks like there is a conflict with the latest upstream commit that I still need to resolve; creating the draft PR now before the branches get too far out of sync.
    * Also need to do some more testing of video mode errors. Done
    * Add photo/video mode switching via MavLink Defer to future PR - not mission critical

Improvements to the MAVLink Camera subsystem:

* Force MavLinkV2 for messages with ID > 255
* Handle additional MavLink camera commands
* Fixes issue where geotagging worked when the camera was triggered in the web UI but not when triggered via MavLink
* Add/update unit tests for better coverage
* Add CameraImageCaptured message
* Camera now sends a heartbeat immediately instead of waiting for the first interval timer
* Performance improvements to get_camera_caps.py: reduce run time on Pi Zero 2W from 13-19s <1s by eliminating unnecessary libcamera calls
* Minor bugfixes/cleanup
@ddd999

ddd999 commented Jun 15, 2026

Copy link
Copy Markdown
Author

Running the code in this branch connected to an SITL simulated vehicle, I was able to run a simulated survey mission in QGroundControl and have Rpanion capturing photos as per the flight plan. No config in QGC required, it just auto-recognized everything once CAM1_TYPE was set to MavLinkV2 in the vehicle parameters.

In streaming mode, QGC auto-discovers the stream and displays it when available.

There are still a few oddities I've found when testing with QGC:

  • QGC assumes CameraTrigger and CameraImageCapture are two separate image captures, so it double counts each photo on its image counter.
  • QGC sometimes doesn't switch its onscreen camera controls between photo and video modes when a new CameraInformation packet advertising a different camera mode is received.
  • In some cases, QGC gets stuck waiting for a response so you can't press the button a second time to capture another image.

I didn't get as far testing with Mission Planner, QGC seemed to work better for whatever reason.

Some of this might be related to how commands are being Ack'd, which might be partially fixed by the upstream commit.

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