Jaime,
I'm new here and have a lot to learn. If the solution is already available, perhaps you can point me in the right direction. I'll outline my system and understanding of what happens.
I am using Mission Planner V1.3.31 to control a Pixhawk autopilot running APMPlane V3.3.0, connected to a Sentera camera via the serial port on TELEM2. The Sentera camera sends heartbeat packets so the Pixhawk learns the route out TELEM2.
I do get forwarding for two of the three ways images are triggered. I'm hoping to get the third way up and running as well. Here is my understanding of the three ways a picture is triggered
1) Create a mission including a Polygon / Survey Grid with CAM_TRIGG_DIST. An array of waypoints is generated by the ground station. A DO_SET_CAM_TRIGG_DIST command is written as a waypoint in the mission immediately following the first waypoint of the mission to enable distance based triggering, and another is added immediately following the last waypoint of the mission to disable. AP_Camera::update_location is called from ArduPlane.cpp, or ArduCopter.cpp, etc to see if the distance covered merits a new camera trigger. If it returns true, the calling code executes Plane::do_take_picture() or Copter::do_take_picture(), etc. Each of these functions calls AP_Camera::trigger_pic(true). With send_mavlink_msg set to true, a MAVLink message is forwarded to all components, including the camera.
2) Create a mission including a Polygon / Survey Grid with DO_DIGICAM_CONTROL. A grid of waypoints is generated by the ground station. A DO_DIGICAM_CONTROL command is written as a waypoint immediately following every photo waypoint in the mission. These waypoints/commands execute Plane::do_digicam_control or Copter::do_digicam_control, etc which call AP_Camera::control_cmd(). AP_Cameara::control_cmd() calls trigger_pic(false), which does not generate a MAVLink message for forwarding to components. However, after the trigger(false) call, AP_Camera::control_cmd copies the command contents into a new message and fowards it over MAVLink to all components, including the camera. In reading through this just now, I'm wondering if the trigger_pic call should only happen on the condition of shooting_cmd==true. Even if that should be tweaked, it's still working for us.
3) Send an individual DO_DIGICAM_CONTROL message from the ground station. In Mission Planner, this is implemented by right clicking on the map and selecting "Trigger Camera NOW". Mission Planner sends a DO_DIGICAM_CONTROL message, which makes its way to AP_Camera::control_msg(), which calls trigger_pic(false). With send_mavlink_msg set to false, no MAVLink message gets forwarded to the camera. My proposed solution is to change the single line to trigger_pic(true). I've compiled and tested on my system and it works. Alternatively, the full message could be repackaged in a mav_cmd_long with all the parameters preserved, similar to the way AP_Camera::control_cmd works. This would be more elegant. Provided this is desired behavior by the community, and not just me, I'm happy to submit a pull request for either approach.
Is there a better way for a camera component to get individual DO_DIGICAM_CONTROL messages sent from a ground station? A custom ground station could specify a component ID, but then our cameras aren't out-of-the-box compatible with popular ground stations.
Thanks, I appreciate your assistance.