It is not possible to launch raspistill while raspivid is running.
But there is a recipe in picamera docs for capturing images whilst recording video.
Thus you need to write python script to configure camera and record video with snapshots.
In addition I suggest to start gstreamer process like this:
gstreamer = subprocess.Popen([
'!', 'rtph264pay', 'config-interval=10', 'pt=96',
'!', 'udpsink', 'host=IP_ADDRESS', 'port=9000'
Then init camera and record video to gstreamer’s stdin:
camera = picamera.PiCamera(resolution=(1280, 720), framerate=15)
camera.hflip = True
camera.start_recording(gstreamer.stdin, format='h264', bitrate=1000000)
After that you can insert your code for image capturing.
Take into account that you need to close gstreamer by yourself:
To capture image by camera trigger event you should use MAVProxy and DroneKit.
Passing mavlink messages to python script should be done with Mavproxy.
Run it on Raspberry with the following startup options:
--master ground_station_ip:14550 --out 127.0.0.1:14550 --out 127.0.0.1:14850
127.0.0.1:1455 is local port of ardupilot,
127.0.0.1:14850 - local port for passthrough messages to the script.
Import dronekit module to your script and create vehicle object connected to
Then add on_message() decorator to create callback for camera trigger event.
The shutter triggered by MAV_CMD_DO_DIGICAM_CONTROL mavlink message, so you need to listen for this command and make image capture in callback.