Multiplatform examples

Download latest SK

iPhone example

The iPhone app source code is in Examples/iPhone/ParrotDemo. To install the ParrotDemo app on your iPhone you need to:

  • To compile with the iPhone SDK and install on your iPhone you need an iPhone developer certificate and a generic profile for your iPhone.
  • Compile the app and install it on your iPhone. Use iphone device 3.1.2 and not iphone simulator. The openGL library used in the code is OpenGL ES1.0.
After you received your AR.Drone kit, to start flying follow these instructions:
  • Charge the LiPo battery with the battery charger.
  • Place the AR.Drone on a flat floor and connect the battery to the AR.Drone.
  • Insert the large EPP hull over the AR.Drone to fly safely.
  • Go to iPhone Settings/wifi and connect your iPhone to the AR.Drone network.
  • Launch ParrotDemo app. You should see the live video from the AR.Drone camera unless it is not properly connected.
  • Press Tools button on bottom left. Select "Outdoor" only if you want to fly outdoor. Select "Flight without Shell" only if you install the lightweight EPP hull. Slide down to the end, press Flat trim and then OK.
  • Press Take off. The AR.Drone should take off vertically and hover steadily.
  • Transparent buttons on the right allow to go up/down. Transparent buttons on the left allow to rotate left/right and in between keep pressed with your left thumb while tilting the iPhone to strafe the AR.Drone in all directions. In case an emergency was triggered, you are asked to press reset button on top of screen before restarting to fly.
  • Press Land for landing.
  • Disconnect the LiPo battery. To save iPhone battery go back to Settings and switch off Wifi.

Linux example

You need Linux kernel 2.6.18 or higher and gcc 4. Use a USB gamepad to input commands. The Linux app source code example is in Examples/Linux.

Google Android example

The Android app source code example is in Examples/Android. This is a quick'n'dirty demo app for controlling an AR drone with an Android phone. It was originally based on the "San Angeles" NDK demo app. It was written to quickly test the following implementation choices:

  • display video stream in native code using OpenGL ES
  • retrieve events (touch, trackball, orientation sensor) in Java code and pass data to native threads

The native application itself is derived from a sample linux PC code (not from the iPhone app), it consists in a few threads:

- the "AT commands" thread sends control frames to AR drone
- the "NAV data" thread receives navigation and status data from AR drone
- the video thread receives a compressed video stream (encoded in a proprietary codec, UVLC) from AR drone

Note: this demo app should not be used as a basis for a real port of the iPhone AR drone application.

HOW TO USE
1) Setup wifi connection to drone in ad-hoc mode (currently not possible in Android), or to an access point, ONLY if drone has been flashed in "PC mode".
2) Launch AR drone app; a video stream should be displayed
3) Hold your phone in landscape mode with the trackball on the left
4) Tap the screen on the bottom left corner to take off/land
5) Touch the right part of the screen to control gas (up/middle/bottom)
6) While touching the screen or pressing the trackball, you can use phone orientation to control flight
7) Press and roll the trackball to control yaw
8) Release touchscreen and trackball to return the drone back into fix-point mode

Also available in: HTML TXT