To run the Crazyflie client on your Ubuntu 18.04 system without using the virtual machine from bitcraze, you have to do this:
1 2 3 4 5 6 7 8 9 10 11 12 |
# install python packages and virtualenv sudo apt-get install python3 python3-pip sudo pip3 install virtualenv --upgrade # clone git repo and create a virtual env git clone https://github.com/bitcraze/crazyflie-clients-python.git virtualenv venv source ./venv/bin/activate pip install -e .[dev,qt5] # start crazyflie client python3 bin/cfclient |
That is nearly the same as it is described in the github readme, but we are using here a python virtual environment with the benefit of not installing any python module on your system. I also fixed the following issue by installing the correct python modules.
1 |
CRITICAL:cfclient.gui:No PyQT5 installation found, exiting! |
If you can not see your usb Crazyradio as an interface then follow the next steps.
Crazyradio
Plugin your Crazyradio to your usb port and check the settings.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
$ lsusb -d 1915:7777 -v Bus 002 Device 015: ID 1915:7777 Nordic Semiconductor ASA Couldn't open device, some information will be missing Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x1915 Nordic Semiconductor ASA idProduct 0x7777 bcdDevice 0.53 iManufacturer 1 iProduct 2 iSerial 29 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 32 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 6 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 6 |
As you can see without sudo you can not connect to the radio.
1 |
Couldn't open device, some information will be missing |
Run this to fix that.
1 2 3 4 5 |
sudo groupadd plugdev sudo usermod -a -G plugdev <username> sudo nano /etc/udev/rules.d/99-crazyradio.rules SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE="0664", GROUP="plugdev" |
Source: https://github.com/bitcraze/crazyflie-lib-python#setting-udev-permissions
Remove the usb radio and plug it in again. Now you should have access to the device without sudo.
1 2 3 4 5 6 7 8 |
lsusb -d 1915:7777 -v | head Bus 002 Device 016: ID 1915:7777 Nordic Semiconductor ASA Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 .. |
Now turn on your Crazyflie drone, start the Crazyflie client and then you should see the interface.
Links:
https://github.com/bitcraze/crazyflie-clients-python#linux
https://github.com/bitcraze/crazyflie-lib-python#setting-udev-permissions
Thank you