I’ve implemented a RPi MAVLink camera and gimbal. They’d detected by MP, and appear as items in the device-select dropdown menu. That’s all fine.
My problem is I have to use the device select menu before it can receive the appropriate messages. From the MAVLink packet inspector window, it looks like the dropdown menu selection determines the destination device for MAVLink packets. When I want to control a device, (e.g. use the camera to take a picture via the capture action button or aim gimbal with the payload controls), I have to manually select the appropriate device from the menu. It’s extremely annoying.
Is there a way to make MP automatically address MAV_CMD_DO_DIGICAM_CONTROL messages to the camera (MAV_COMP_ID_CAMERA), send MAV_CMD_DO_MOUNT_CONFIGURE to the gimbal (MAV_COMP_ID_GIMBAL)?
You have to implement Camera Protocol V2, then you can use your mavlink camera/gimbal with commands addressed directly to the flight controller. https://mavlink.io/en/services/camera.html
For the camera, I’m using the MAVSDK camera service, which I believe does implement Camera V2.
Ardupilot doesn’t seem to support Gimbal V2 (gimbal manager). Looking at the source code, the SToRM32 gimbal driver does implement MAVLink v1 (commands like MAV_CMD_DO_MOUNT_CONFIGURE) so I implemented that.
Both the gimbal and camera work fine but I have to manually select the appropriate device in MP’s drop-down menu before I can control it. That’s my problem.