Autonomous Flips with the Parrot AR Drone

Alien-Factory presents the Fantom Programming Language with Master Coder Steve Eynon In this video we're going to look at quadcopters, and in particular the Parrot AR Drone The end goal of this video is to make it fly autonomously and perform a few tricks, all using the Fantom programming language! If you've not used an AR Drone before, I'll explain the control mechanism

The drone itself has an on-board microprocessor and runs Linux Busy Box It uses this to read its various sensors and send output to its 4 motors It also contains Wifi hardware When you turn the drone on it sets itself up as a Wifi hot spot, to which your computer connects The drone, and your computer, use standard TCP and UDP protocols to send and receive data

In particular, the drone sends video feeds and navigation data, and your computer sends configuration and movement commands On our computer we're going to be running a Fantom program, and we're going to use the Parrot Drone SDK library to send flying commands to the drone The drone SDK library is produced by Alien-Factory and is one of the many libraries freely available on the Eggbox pod repository A quick glance at the API shows that most functionality is centred on the Drone class While I can't deny there are lots of slots on the Drone class, note there are 9 methods of moving the drone and 9 event handlers

So once you take these into account the Drone class is quite manageable Also note the Video Streamer class that we'll be using to download video from the drone Video Streamer requires the popular FFMEG utility to convert the raw data from the drone to an easily playable MP4 file FFMEG is also freely available Just head to the website, click download, and choose one of the pre-made builds

I've already downloaded it here, and as you can see, it's just one big executable file For this demonstration we're going to use a fresh installation of Fantom As you can see here, we're using Fantom 1069 and it just contains the standard Fantom pods

To install the Parrot SDK visit Eggbox and go to the summary page Here you can copy the 'fanr' command and paste it into a command prompt Now when we list pods we should afParrotSdk at the top of the list As for the drone program itself we're just going to use the Simple Example bundled with the SDK documentation So lets just copy and paste that into a new file called "SimpleExample

fan" Now lets take a closer look at the program The first part creates a new instance of the Drone class and initialises it for take off

The 'clearEmergency' puts the drone into a normal state, and 'flatTrim' tells it to calibrate while it's lying flat on the ground Then we give the drone some information about its environment We're actually going to use the indoor shell, because the indoor shell has some really BIG bumpers and I crash my drone a lot! The next bit activates the drone's front camera and records the video to an MP4 file Then we have the actual flight plan We're going to take off, do a backwards flip, hover for a bit, and then land Easy! But note that for accurate and precision flying you need to have kept good care of your drone This includes cleaning and balancing your rotors, and replacing any key mechanical parts with high performance variants

Now, did I mention that I crash my drone, a lot!? As you'll see, this makes my drone rather, hmm, how do we say? Unstable Anyway, without further a do, lets heat up the drone, connect to its Wifi, and let's fly! I am Steve Eynon, and that was the Parrot AR Drone, doing a flip, controlled by Fantom! Thank you and good night!





Toy Drones