Smart Drone Flying

1 minute read


How to use and program AR Parrot 2 to impress your friends 😎.

Smart Drone Flying

The Parrot ARDrone 2 is a piece of oustanding device. However, its library sucks.

If we want to do smart flying we need to use an open source better python library.

# The probably-best library for ardrone.

Ardone-webflight is based on the nodecopter library:

This is an awesome library on nodejs.

You can install OpenCV for Node or you can also

Or you can link node with python with:

# Streaming

Parrot Ar Drone streams in h.264, but not many libraries can deal with the video stream.

So, if you want to do it by hand:

What in generally works is:

 ffmpeg -f rawvideo -i tcp:// -c:v h264
 ffplay -framedrop -infbuf -f h264 -i -framerate 60

For IP Camera:

 ffmpeg -f mjpeg -i "" output.mp4

## Ar Drone Fire Detection Another very interesting project wich actually uses the python library:

Ardrone For Processing

More libraries

## Paparazzi Project Paparazzi is a project from DU Delft university to replace the firmware of the AR Drone Parrot with a new customized open source firmware.

Build OpenCV 3 on MacOSX for python 2.7

So far, the best solution is to use OpenCV3 with Python 2.7, using the libardrone library. The VideoCapture('http...') function can be used and it can analyze on real time the drone stream.

Activate your virtual environment: source cv/bin/activate

Deactivate it deactivate

Virtualenvironment wrapper source /usr/local/bin/ workon cv

The procedure is described here:

Remember to install FFMPEG before you compile OpenCV so that you can easily access to the drone stream.

export FFMPEG_INCLUDE_DIR=/usr/local/Cellar/ffmpeg/3.1.4/include/
export FFMPEG_LIB_DIR=/usr/local/Cellar/ffmpeg/3.1.4/lib/

	-D PYTHON2_PACKAGES_PATH=~/.virtualenvs/cv/lib/python2.7/site-packages \
	-D PYTHON2_LIBRARY=/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/ \
	-D PYTHON2_INCLUDE_DIR=/usr/local/Frameworks/Python.framework/Headers \
	-D FFMPEG_LIB_DIR=/usr/local/Cellar/ffmpeg/3.1.4/include/ \
	-D FFMPEG_INCLUDE_DIR=/usr/local/Cellar/ffmpeg/3.1.4/include/ \
	-D OPENCV_EXTRA_MODULES_PATH=~/work/opencv_contrib/modules ..