User Tools

Site Tools


projects:crazyflie:pc_utils:index

This is an old revision of the document!


Crazyflie PC utilities

The Crazyflie PC utilities are developed using Python 2.7. The Crazyflie library is used from the command line tools as well as a graphical user interface.

Install instructions

The following has to be installed for the PC utilities to work:

  • Python 2.7
  • pyGame
  • PyUSB (0.X or 1.X)
  • libusb

For the graphical userinterface to work the following is also needed:

  • Python bindings for Qt4

Installing on Fedora

The following has been tested on Fedora 16. Note that this will pull in a lot of dependencies.

sudo yum install pygame pyusb PyQt4

Installing on Ubuntu

The following has been tested on Ubuntu 10.04 and 11.10. Note that this will pull in a lot of dependencies.

sudo apt-get install python2.7 python-usb python-pygame python-qt4

Fix udev premissions on Linux

In order to fix the permissions so it's possible to use the USB Radio without being root do the following steps.

sudo groupadd plugdev
sudo usermod -a -G plugdev <username>

Create a file named /etc/udev/rules.d/99-crazyradio.rules and add the following:

SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE="0664", GROUP="plugdev"

Restart the computer and you are now able to access the USB radio dongle without being root.

Installing on Windows XP/7

Only tested on Windows XP.

The following has to be downloaded/installed for the PC utilities to work on windows:

For the graphical userinterface to work the following is also needed:

Graphical User Interface

A userguide for the GUI application can be found here.

Command line tools

Install instructions

Besides the common bindings nothing has to be installed.

All command line tools used the same link diver model. The link driver to use in order to communicate with the copter is chosen with the -l command line argument. Also the tools accepts the -h argument that will display help about the link driver as well as the default driver used if none is provided:

crazyclient$ python gamepadCtrl.py -h
CRTP Driver loader options:
---------------------------
 -l <driver_uri> : Load the link driver with the requested URI
 -h              : Print this help message

Unless otherwise specified the URI "radio://0" will be used

The available drivers are:

  • radio://n[/channel[/speed]] Radio dongle number 'n' (many can be connected to the computer) communicating on a specified channel with a specified speed. The speed and channel are optional, default channel is 2 and default speed is 2M. The speed can be 2M, 1M or 250K. For example:
    • radio://0 uses radio dongle 0 to communicate on channel 2 at 2Mbit/sec
    • radio://0/77 uses radio dongle 0 to communicate on channel 77 at 2Mbit/sec
    • radio://0/77/250K uses radio dongle 0 to communicates on channel 77 at 250Kbit/sec
  • loop:// Loopback driver. Mainly aims at testing tools without having them to crash because of the missing radio link |

crazyload.py

crazyload.py permits to update the copter firmware using the Crazyload radio bootloader. This is a self-documented command line tool (launch python crazyload.py -h).

To program a copter with a firmware compile in bootloader mode (see build environment documentation):

$ make cload
  #or ...
$ python crazyload.py flash cflie.bin
Restart the CrazyFlie you want to bootload in the next 10 seconds ...
Connection established!
Flash pages: 128 | Page size: 1024 | Buffer pages: 10 | Start page: 10
118 KBytes of flash avaliable for firmware image.

Flashing 43907 bytes (43 pages) ..........10..........10..........10..........10...3
Reset in firmware mode ...
Done!
$ 

Here cflie.bin is the binary file of the firmware to be flashed. After launching this command the copter has to be restarted and the flash procedure will start. When the flash procedure is finished the copter will boot the new firmware

getinfo.py

getinfo.py recovers some information about a running copter. This tool is slightly bugged but fulfills its purpose (mainly getting the copter CPU ID). Its usage is quite classical:

crazyclient$ sudo python getinfo.py -l radio://0/77
Detected CrazyRadio dongle version 0.32
Channel 77
Data rate 2M

CPU ID: 52:ff:70:06:48:89:49:53:15:31:10:87
Battery voltage: 3.764599V
CrazyCopter version: 0.9.0
Copter class name: CrazyFlie
CPU ID: 52:ff:70:06:48:89:49:53:15:31:10:87
crazyclient$
projects/crazyflie/pc_utils/index.1347913540.txt.gz · Last modified: 2015-07-15 16:30 (external edit)