Support Photo/Video Capture via RC Switch
-
I would like to request a feature that allows taking photos and videos using an RC switch on VOXL 2 Mini.
We’ve investigated how to trigger photo/video capture by sending MAV_CMD_IMAGE_START_CAPTURE (or MAV_CMD_VIDEO_START_CAPTURE) from PX4-firmware when an RC switch is toggled. However, it seems that mavlink-camera-manager (voxl-mavcam-manager) currently only processes commands coming from GCS, and does not handle commands that originate from the PX4 autopilot.
Environment:
VOXL 2 Mini (SDK 1.3.5)
px4-firmware side with#define ATL_MANTIS_RC_INPUT_HACKS
enabled to use photo_switch and video_switch.
Confirmed that MAV_CMD_IMAGE_START_CAPTURE is indeed being sent by PX4 upon toggling the RC switch.
From our investigation, mavlink-camera-manager/src/qgc.c only handles messages from FROM_GCS_PIPE_NAME ("mavlink_from_gcs"). As a result, any capture commands (MAV_CMD_*_CAPTURE) sent by the PX4 autopilot via an RC switch are not recognized, so photos or videos are never saved.Having the ability to start/stop captures via a user’s RC switch instead of exclusively through a GCS would be extremely helpful. We would greatly appreciate it if mavlink-camera-manager could also accept and handle MAV_CMD_*_CAPTURE commands from PX4 (or if there is an alternative way to accomplish this, we’d be interested in hearing about it).
Thank you for your time and consideration. We look forward to any updates or guidance you can provide on this topic.
-
@JP-Drone I understand the request. Yes, it seems like that would be a nice feature to support in voxl-mavcam-manager. We don't currently have time to develop this new feature but we will add it to our list of desired updates and hope to be able to get to it at some point. If you are able to do this update on your own please send us a merge request so that we can update the code for everyone to use.
-
@JP-Drone said in Support Photo/Video Capture via RC Switch:
MAV_CMD_IMAGE_START_CAPTURE
How are you handling the mavlink camera protocol exchange within voxl-px4? I know that there is the ability to forward commands to the GCS if using mission commands (but not manually flipping an RC switch).
Alternatively when using a joystick you can map a button to image capture: https://docs.px4.io/v1.15/en/camera/mavlink_v2_camera.html#manual-controllers
Currently the mavcam manager fully implements the camera protocol to send the ack for the incoming mavlink commands. It also handles the capture and video stream status (satisfies the mavlink camera protocol).
My only issue with implementing this is that the upstream voxl-px4 will not be camera protocol compliant and thus we are bypassing the entire protocol just to get camera image capture from the autopilot instead of the GCS (which also implements the same camera protocol). If you have a way to implement the protocol (even a stripped down version of it) please send a link so I can look at the code.