Triggering multiple cameras via ODROID

Hello everybody,

for a mapping research project we’re planning to use an octocopter with a Pixhawk and a companion computer controlling multiple cameras (Sony QX1, connected via WLAN, and an IR camera) mounted on a gimbal.

Unfortunately we will have very limited access to our drone (which isn’t even built yet), so we can’t simply play around with it; instead we have to plan, connect and test all the components on their own, possibly using something like Mission Planner and SITL to simulate the drone, and only perform the final tests with the full hardware stack.

We want to calculate our mission waypoints on the ground and push them to the drone. At each WP we need to (synchronously, if possible) trigger both cameras, move the images from the cameras to our companion computer (probably an ODROID, maybe a Raspberry Pi 3 initially), do some image processing, and signal our Pixhawk that we’re done and it can move on to the next WP. I’m currently looking into the autopilot/companion connection and wondering how we can achieve both the triggering and the completion signalling part. There are tons of tutorials on how to connect and configure the hardware, but I’m missing the MAVLink part of the AP/CC communication.

So my question is:
Can I just send some MAVLink command to the drone with the target component ID set to whatever my companion computer’s component ID is, and command the Odroid that way? And if so, how would I determine that component ID? Is that configured somewhere? Do I check if I find a heartbeat coming from something with a type of MAV_TYPE_ONBOARD_CONTROLLER?

So just to start with, as you haven’t mentioned it, have you come across dronekit?

Yes, DroneKit came up during our research.
That would indeed be an option if we end up with the CC having to handle waypoint-by-waypoint flightcontrol instead of just tossing the waypoints to Pixhawk and waiting for the images to arrive at the ground.

As mentioned in the thread “Triggering passive Companion Computer”, we’d like to leave as much of the actual flightplan on the Pixhawk. Ideally we’d just use something MAV_CMD_DO_DIGICAM_CONTROL to tell the Odroid to snap a picture at this waypoint, and then wait for it to do its stuff with a magic MAV_CMD_CONDITION_CAMERA_IS_DONE command… but there is no such thing, is there?

Quick update:
current plan is to snap a picture and then loiter (MAV_CMD_NAV_LOITER_UNLIM) until the GCS on our Odroid sets the next waypoint (MISSION_SET_CURRENT). We’ll see how that works out.

In case this helps somebody in the future, here’s our solution in a nutshell:

  • we’re building our missions so that at each photo waypoint a MAV_CMD_DO_DIGICAM_CONTROL is followed by MAV_CMD_NAV_LOITER_UNLIM
  • the mavlink_packet() method in our MAVProxy module reacts to any MAVLINK_MSG_ID_CAMERA_FEEDBACK received by first
    • performing a (possibly lengthy) image acquisition and then
    • explicitly calling self.master.waypoint_set_current_send(<next_waypoint_id>)

This has the nice side effect that you can still use the manual RC trigger for the camera in addition to your mission commands.