I’ve been wanted to work on this for ages, and finally got around to it with the encouragement of Gus Whitehouse (thanks Gus!).
One of the key missing features with ArduPilot on the disco has been the lack of a way to control video recording and streaming and taking of still photos with an R/C controller. I opened a PR to fix that today:
The approach I took is to allow arbitrary shell scripting commands to be associated with GPIO values. This means you can connect shell script commands on Linux ports of ArduPilot with the existing relay support. As the Disco already has shell commands for video control it means that connecting R/C switches to control video becomes easy.
How to try it
If you want to try it out then do the following:
- either build ArduPilot from my PR yourself, or use this prebuilt binary: http://uav.tridgell.net/Disco/video_control/arduplane
- copy this gpio.sh script onto your Disco into the same directory that ArduPilot lives in, /data/ftp/internal_000/ardupilot
- set RELAY_PIN to 100, RELAY_PIN2 to 101 and RELAY_PIN3 to 102
- choose what RC input channels you want to use for switches to control video and photos. I will assume below that you have video start/stop on RC8, recording start/stop on RC7 and taking a photo on RC6
- set RC6_OPTION to RELAY (option 28)
- set RC7_OPTION to RELAY2 (option 34)
- set RC8_OPTION to RELAY3 (option 35)
Then restart your Disco. You should find that:
- Changing the switch associated with RC6 to a high PWM will take a photo.
- Changing RC7 high will start recording video to the internal storage of the Disco. Lowering RC7 will stop recording.
- Changing RC8 to a high PWM value will start video streaming to the IP address of your GCS on port 8888. Lowering RC8 will stop streaming.
It is all controlled by gpio.sh. If you want to control some other aspect of your plane then just edit gpio.sh to make it do something else, or add new functions.