Installation Guide for the Crazyflie 2.0 and Tactigon environment

This is an overview on how to get started developing a gesture control system with the Crazyflie 2.0 quadcopter and the Tactigon. This guide assumes you are using a Linux based machine (tested on Debian 9.3 stretch), since there are libraries used that are only available for Linux OS. Furthermore, your computer needs to support Bluetooth 4.0, to be more specific: It has to be BLE compatible. If your hardware does not support BLE, there is the option to use external Bluetooth dongles.
The following information is taken from Bitcraze’s and The Tactigon’s website and serves as a collection of all steps necessary to get your environment for developing up and running.

 

Install the Crazyflie Client on your computer
  • Download the cf-client from github
  • Cf-client requires python3, pip and pyqt5:

sudo apt-get install python3 python3-pip python3-pyqt5 python3-pyqt5.qtsvg

  • After installing the required packages, go to the source folder of the cf-client (crazyflie-clients-python) and issue the following command:
    pip3 install -e .
  • To launch the installed cf-client, run the following command from the source folder:
    python3 bin/cfclient
Setting up udev permissions

The following steps are necessary in order to use the Crazyradio USB Dongle without being root:

  • Run the following commands:

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

  • Create a file (we are using nano) nano /etc/udev/rules.d/99-crazyradio.rules and add the following:
    SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE="0664", GROUP="plugdev"
  • To connect Crazyflie 2.0 via usb, create a file nano /etc/udev/rules.d/99-crazyflie.rules and add the following:
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE="0664", GROUP="plugdev"
Setting up your Bluetooth environment (BlueZ and bluepy)
  • Download the latest version of BlueZ
  • Install the following packages before compiling the BlueZ sources:
    sudo apt-get install libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev
  • Direct to the source folder of BlueZ you downloaded earlier and issue the following commands in order to compile the BlueZ module:
    ./configure
    make
    sudo make install
  • Assuming the compilation ended with no errors, modify the BlueZ configuration file to enable experimental functions. Run the following command:
    sudo nano /lib/systemd/system/bluetooth.service
    and search for the line ExecStart in the [Service] section and add --experimental at the end of the line.
  • Restart the daemon to load the new experimental configuration and afterwards restart bluetooth:
    sudo systemctl daemon-reload
    sudo systemctl restart bluetooth
  • Check if the bluetooth service uses the experimental configuration by issuing the following command:
    systemctl status bluetooth
    You should now see the string –experimental is present
  • Before installing bluepy, the following packages should be installed:
    sudo apt-get install python-pip
    sudo apt-get install libglib2.0-dev
    sudo pip install bluepy
Further hints

Notice that it may be necessary to manually enable the bluetooth interface on your computer.
To do so,

  • Type bluetoothctl in a terminal and press enter
  • Afterwards, type power on and press enter
    Your bluetooth interface should now be switched on. To shut the interface down, simply type power off.
  • To detect devices, type scan on and press enter. Your computer should now start detecting and listing nearby bluetooth devices.
  • To exit bluetoothctl, simply type exit and press enter.

It is recommended to leave the bluetoothctl terminal window open since you can easily start/stop scanning and enable/disable your bluetooth interface as you wish. To get an overview of additional commands, type help to get a list of all usable commands.

All necessary steps should now be completed and you should be ready to start developing a gesture control system with the Crazyflie 2.0 quadcopter and the Tactigon.

 

Troubleshooting and issues

If you run into any issues make sure you followed every step presented in this guide in order to set up everything correctly. Especially when setting up BlueZ and bluepy it is necessary to make sure every package needed is downloaded and installed correctly. If your run any other Linux distribution apart from Debian it may be necessary to manually add certain packages or sources to your package manager since it may not be supported by your distribution.

If you have any further questions please don’t hesitate to contact us.

 


Teile diese Seite