The camera trigger driver allows the use of the AUX ports to send out pulses in order to trigger a camera. This can be used for multiple applications including timestamping photos for aerial surveying and reconstruction, synchronizing a multi-camera system or visual-inertial navigation.
In addition to a pulse being sent out, a MAVLink message is published containing a sequence number (thus the current session's image sequence number) and the corresponding time stamp.
Three different modes are supported:
TRIG_MODE1 works like a basic intervalometer that can be enabled and disabled by calling in the system console
camera_trigger disable, respectively. Repeated enabling time-shifts the intervals to match the latest call.
TRIG_MODE2 switches the intervalometer constantly on.
TRIG_MODE3 triggers based on distance. A shot is taken every time the set horizontal distance is exceeded. The minimum time interval between two shots is however limited by the set triggering interval.
TRIG_MODE 0 the triggering is off.
The full list of parameters pertaining to the camera trigger module can be found on the parameter reference page.
In this example, we will go over the basics of synchronizing IMU measurements with visual data to build a stereo visual-inertial navigation system (VINS). To be clear, the idea here isn't to take an IMU measurement exactly at the same time as we take a picture but rather to correctly time stamp our images so as to provide accurate data to our VI algorithm.
The following diagram illustrates the sequence of events which must happen in order to correctly time stamp our images.
First, set the TRIG_MODE to 1 to make the driver wait for the start command and reboot your FCU to obtain the remaining parameters.
For the purposes of this example we will be configuring the trigger to operate in conjunction with a Point Grey Firefly MV camera running at 30 FPS.
Wire up your cameras to your AUX port by connecting the ground and signal pins to the appropriate place.