Controlling Parrot Disco video


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.
Happy flying!

6 Likes

Thanks so much Tridge! This is a great new. I will try as soon as I can in the next days ! I’m so excited, thanks.

Fantastic ! - one step closer to perfect ArduPlane integration (with no disadvantages)

it it possible to control the pitch, and type of digital stabilization as well ?

you can script up anything that can be some with command line tools. I haven’t investigated what can be done with pimpctl for video controls beyond recording and streaming.
Cheers, Tridge

HI Tridge,

I’ve done some test today of your script during 2h at home (2*1h) and nothing has failed.
I’ve use Qgroundcontrol with Video on udp 14550. Perfectly working stream with multiple start/stop hit rc control CH8. I didn’t check the photos and videos recorded on media but gpio.log file indicate RC control OK.

Sun Mar 17 19:43:49 UTC 2019 Starting recording
Sun Mar 17 19:43:56 UTC 2019 Stopping recording
Sun Mar 17 19:44:03 UTC 2019 Taking picture
Sun Mar 17 19:48:10 UTC 2019 Starting streaming to 192.168.42.75 8888
Sun Mar 17 19:48:44 UTC 2019 Stopping streaming to 192.168.42.75 8888
Sun Mar 17 19:48:46 UTC 2019 Starting streaming to 192.168.42.75 8888
Sun Mar 17 19:48:47 UTC 2019 Stopping streaming to 192.168.42.75 8888
Sun Mar 17 19:48:56 UTC 2019 Starting streaming to 192.168.42.75 8888
Sun Mar 17 19:48:57 UTC 2019 Stopping streaming to 192.168.42.75 8888
Sun Mar 17 19:53:36 UTC 2019 Starting streaming to 192.168.42.75 8888
Sun Mar 17 19:53:37 UTC 2019 Stopping streaming to 192.168.42.75 8888
Sun Mar 17 19:53:37 UTC 2019 Taking picture
Sun Mar 17 19:53:37 UTC 2019 Starting recording
Sun Mar 17 19:53:38 UTC 2019 Stopping recording
Sun Mar 17 19:54:05 UTC 2019 Taking picture

I try with mission planner but for unknow reason MP was crashing on control+F / then VLC … Probably a misconfiguration on my side.

I check quickly with Skycontroller2 and it doesn’t seem to stream on FreeFlight.
Tridge: could you be kind enough to tell the correct behaviour on SK2. I mean must it stream or not on attached device on SK2 (Android/iPhone) ?

Thanks again for this big step ahead in the Disco video issue with Arduplane !

attached small screenshot of PIP under Qgroundcontrol: https://www.dropbox.com/s/h6oaz0rizjualv2/groundcapture3.PNG?dl=0

I have a sk2 but I haven’t used it yet. I use a taranis with a frsky receiver.
I’ll have a go with the sk2 sometime and let you know.

@macfly1202

I’m working on support for skycontroller2 and will send a PR soon. The skycontroller2 is a wifi RC - the most difficult part is convincing it to remain connected to disco when the dragon flight stack is not running, other than that it’s working great for me

1 Like

My best RC friend is taranis for years now but for the disco, having video feed on a portable device with Hud is really important for the best fpv experience.
If only we could have Taranis + Osd on video feed, it will be truly amazing but what you accomplish is already cool. Thanks again.

nice info Lucas. Ready to test if necessary.
I had the idea the change the GPIO script from Tridge with info find here (https://forum.developer.parrot.com/t/skycontroller-2-wifi-and-hdmi-out/4530/25 -> port 55004) but didn’t start yet.

Fyi I just donate 30$ to Paypal Ardupilot because I’m convince with great work done from Arduplane dev team since 2013.

So how do you connect to SC2 ? Ethernet to usb cable ?

@macfly1202 my intention is to let both connected. So you can even use either of them.

@kikislater to connect to the drone SC2 is on wifi or 4G with the disco4g mod. To connect to a tablet/phone I think the best is to use a usb-ethernet. But disco is compatible with just a few dongles. For not using usb-ethernet we would need to demux the data over the USB like freeflight does… But it’s too much trouble

@macfly1202 that said I’ve heard about interference of taranis due to both operating on 2.4GHz.

I’m aware about few eth-usb support with Disco.
So what is your solution to handle SC2 with disco and QGC or MP ?

1 Like

First: @tridge @lucasdemarchi - thank you.

I can toggle the streaming just fine.
Recording / photos does not work for me (no media spawn in the storage)
My configuration is:
RC9_OPTION = 28 (B)
RC11_OPTION 34 (left trigger)
RC12_OPTION 35 (right trigger)

RELAY_PIN = 102 (streaming)
RELAY_PIN2 = 100 (photo)
RELAY_PIN3 = 101 (video)

Some feedback:
1: It would be great to be able to assign the exposure setting to a RC channel
2: it is important to have some feedback whatever video is recording or not - otherwise user can’t be sure whatever recording is on, or not. If no simple OSD is possible, I may suggest having STATUSTEXT feedback.
3: pan & tilt would be fantastic. again, we could link it to RC channels.

Some tests here today connecting directly to the Disco. After the following commands I do see the video being recorded in /data/ftp/internal_000/Disco/media/:

pimpctl  recording-start front

It worked both together with streaming and without. With the following command on Disco I can see the status of the camera:

pimpctl list-cameras

I copied or exact parameters and it’s working fine for me too.

1: It would be great to be able to assign the exposure setting to a RC channel

At least via pimpctl we don’t have such setting. We do have a message in arsdk-xml/xml/ardrone3.xml at 4923185f3281a1d03fb783bcaeae003873f8f8d5 · Parrot-Developers/arsdk-xml · GitHub for that, but AFAIK it’s Parrot’s sdk that responds that

2: it is important to have some feedback whatever video is recording or not

yeah, we could call pimpctl list-cameras, parse the output and then on ardupilot we use the string returned to send as statustext

3: pan & tilt would be fantastic. again, we could link it to RC channels.

I see “cam-orientation” and “set-controller” in pimpctl, but trying to change them didn’t change anything for me.

Now that I’m routing mavlink traffic on dema-rc, I have to start routing video as well.

Hi, curious if anyone is still working on disco video with ardupilot. Maybe this config info might help with pan and tilt:

which evolved into the cam pan mod:

Also the aurega bebop app Auriga for Parrot Drones | Auriga apps
has head tracking in FPV which I have tested on iOS iPhone 12m and android google pixel3a and found to work with the disco to control pan and tilt.