Parrot drone Bebop
Clone or download
m3d Merge pull request #14 from 0xlen/master
Enable RTP Streaming on Bebop and add sample code
Latest commit 6c59a2d Nov 10, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
apyros fixed "logs" folder creation if not existing Apr 20, 2015
behaviors fixed include paths for Linux Apr 20, 2015
remote_testing integrated requestAllStates and requestAllSettings into initial config() Apr 21, 2015
samples fixed import paths for Linux Apr 21, 2015
LICENSE added MIT license (from heidi) Mar 23, 2015 added note about timeout parameter in flyToAltitude Apr 22, 2015
bebop.sdp Enable RTP Streaming on Bebop and add sample code Oct 27, 2017
cap-colors.txt testing cap detection on recorded videos Feb 26, 2015 tracking cap with camera pan (+/- 1 step) Mar 3, 2015 integrated requestAllStates and requestAllSettings into initial config() Apr 21, 2015 removed obsolete global g_vf (VideoFrames, now part of Bebop) Apr 8, 2015 prepared test with confirmation of navigateHome Apr 20, 2015 taking snapshots from recorded video Feb 22, 2015 Enable RTP Streaming on Bebop and add sample code Oct 27, 2017 fixed video errors due to incomplete last frames Apr 14, 2015


Parrot drone Bebop

  • autonomous drone controlled via Python

For detail info see

Katarina Bebop Drone


First of all note, that this experimental project is work in progress and it is your responsibility if you decide to use it without understanding the risks. Inspiration and message codes are taken from official Parrot SDK:

The goal for Katarina repository is tha same as for Heidi ( ARDrone2 --- autonomous flying programmed in Python. The code is developed and tested on laptop running Win7 and Python 2.7 but it should be easy to port it to other OS. Image processing uses OpenCV2 and NumPy libraries.

Code example:

drone = Bebop()

Surely the code becomes more complicated if you want to integrate video processing or complex navigation. On the other hand it is relatively short so you may read details "what is going on" ;-). Every run it logged and you should be able to immediately replay it. See "" file for example(s).

Warning! Autonomous flights sometimes turn bad ... and you need to stop the drone ASAP. For my simple experiments landing is so far good choice what to do, so as soon as I hit any key, the ManualControlException is raised and alternative code is performed (typically combination of land() and emergency() due to unlucky implementation of state machine on ARDrone3). This means that the code above should be wrapped into try .. except ManualControlException block.

The code evolved into several files:

  • --- this is the main file you need to import. The class Bebop connects to the drone, contains up-to-date status variables and methods for basic flight operations. There are several ""test"" demos, which follow the experiments (and it will be probably moved to separate file).

  • --- here you find list of some basic ARDrone3 commands converting name into few bytes packet.

  • --- parsing of (not only) navigation data. The name was taken from ARDrone2. You can use this script also for detail verbose dump of recorded "navdata" log.

  • --- handing of parts of H264 video frames. Also serves as utility for video conversion and extraction of individual frames.

  • --- play video using OpenCV2 (uses as conversion routine, if necessary).

  • --- two color Parrot cap detection experiment (reference colors are stored in cap-colors.txt).

  • apyros folder --- logging tools, shared among several Python driven robots. This folder is planned be moved into separate repository.

  • --- integration of image processing with flight control (work in progress)


Q: I recently succeed to launch but I've a question about the parameter "task" in some of your scripts, is there any list of task that i should use to launch these scripts ? Are this just a name given to the instance of the demo ?

A: The "task" parameter is dummy at the moment. It should be named rather "comment", because this is the way how I mainly use it (it is automatically stored in metalog file), i.e. testWithTakeoffInWindyCondition. The plan is to use it for "task selection" in the future ...

Q: What is module "cvideo"?

A: "cvideo" is taken from Heidi/ARDrone2: It is used for decoding H.264 encoded frames into numpy array used as image in OpenCV2. OpenCV2 can open stream or file but I could not convince to read several frames.

Q: What is the state of your work? Is every module finished?

A: The basic code in, and ( are ready to use. It was tested under Windows 7/Python 2.7 and I am sure that in particular will require revision for Linux and Mac OS.

The other modules are rather ""work in progress"", where the closest to reasonable image multiprocessing is (as example, the image processing algorithm needs some improvements).

Q: Does open video player?

A: No it should not. In reality I preffer rather watch/check the drone what it is doing and AFTER review the video and processed images. Note, that needs multiprocessing revision as mentioned in previous question. For debugging OpenCV2 is used for display images.

Q: Can I get images from down-pointing camera?

A: As far as I know the answer is NO. Current API does not suppor it. On the other hand you can select region of interest of forward looking camera by: drone.moveCamera( tilt=-100, pan=0 )

Q: I noticed that "drone.battery" always displays "None", did you get the same?

A: This means that there was no info packet with battery change status. I would try to integrate ARCOMMANDS_ID_COMMON_SETTINGS_CMD_ALLSETTINGS, which should (?) report "all settings" (including battery status?).

Q: I tried to use drone.flyToAltitude(3.0), but the drone does not fly to 3 meters. Why?

A: Please note, there is second parameter "timeout" with very low default value 3 seconds. So you can write something like drone.flyToAltitude(3.0, timeout=20). Also note that the maximum altitude is limited by drone settings.