Home

Awesome

Crazyflie Nano C++ Client Library Build Status

First of all, the Crazyflie Nano is an awesome Quadcopter by the guys at Bitcraze. I just love it - and since I'm a C/C++ programmer deep in my heart, I really, really wanted to have a client library in that language (there was none at that time).

That's why I wrote one.

My work is based on Bitcraze's Python Library (see their repos) which (alongside their wiki) greatly helped me understand the communication protocol. Feel free to use the library as you like, as long as you obey the rules of the BSD license.

You can check out the current Doxygen source code documentation here.

What this library is

What this library is not

Where it has been tested

As system architectures tend to differ in what they include and how they are organized, the library doesn't necessarily run out of the box in your system. The library is constantly being tested and built on a couple of Ubuntu versions (see here). Right now, these are:

DistributionVersionNameArchitecture
Ubuntu Linux12.04Precise Pangolini386
Ubuntu Linux14.04Trusty Tahri386
Ubuntu Linux14.10Utopic Unicorni386
Ubuntu Linux15.04Vivid Veretamd64
Ubuntu Linux15.10Wily Werewolfamd64

So, the current state of the library might or might not run on your system if you differ from those. I'll be more than happy to incorporate pull requests that support more architectures. If you have it running on some architecture not listed here, let me know!

Dependencies

One of the examples included with the library depends on GLFW, which you can install under Ubuntu by apt-get install'ing this:

$ sudo apt-get install libglfw-dev libglfw2 cmake

If you do not wish to depend on GLFW, use the file CMakeLists_noGUI.txt instead of CMakeLists.txt. The example ex-gui will not be built, then.

How to install from binaries

Add the PPA to your debian sources:

$ sudo add-apt-repository ppa:jan-winkler-84 && sudo apt-get update

Install the binary package:

$ sudo apt-get install libcflie

This will of course install the necessary dependencies automatically.

How to build the library from source

First, clone the repository:

$ git clone https://github.com/fairlight1337/libcflie.git

In the cloned folder, do:

$ mkdir build
$ cd build
$ cmake ..
$ make

After that, you will find two directories in the base directory: lib and bin.

How to run the examples (or you own programs)

When running programs linked against and using libcflie, you have to have access permissions for your USB devices set up correctly, as USB devices are not per se accessible by all users on a system.

You basically have two options:

Recommended way: Set up your USB permissions for the CrazyRadio dongle. For this to work, create a new file at /etc/udev/rules.d/99-crazyradio.rules and put this line into it:

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

For this to work, your user has to be in the group plugdev. To check in which groups you are, type

$ groups

If plugdev is in the list, you're good. If not, let Google explain how you can add a user to a group on your specific system. You will probably have to log out and back in again for the changes to take effect.

Now replug your dongle and you're set. Start the example ex-gui application from the libcflie/build (after typing make) with:

$ ./../bin/ex-gui

Exit the example by pressing ESC.

For testing purposes: Run your programs as root:

$ sudo ./../bin/ex-gui

Again, exit the example by pressing ESC.

Important Notice (concerning development and support)

After developing the core parts of the library and maintaining it for a while, supporting users and co-developers in several projects, I decided to stop actively developing the library further. This is solely due to other time-consuming things in my life, so I won't be able to help you getting your project to run. By now there are lots of forks of the library and example programs using it (try Google'ing it or look at the GitHub forks). I still incorporate pull requests and bug fixes and look after keeping the build farms happy with the source (Travis CI, Launchpad), but can't help your individual projects.