Giter Club home page Giter Club logo

crazyflie-clients-python's Introduction

Crazyflie PC client Build Status Build status

The Crazyflie PC client enables flashing and controlling the Crazyflie. It implements the user interface and high-level control (for example gamepad handling). The communication with Crazyflie and the implementation of the CRTP protocol to control the Crazflie is handled by the cflib project.

For more info see our wiki.

Running from source

The Crazyflie client requires cflib. If you want to develop with the lib too, follow the cflib readme to install it.

Windows (7/8/10)

Running from source on Windows is tested using the official python build from python.org. The client works with python version >= 3.5. The procedure is tested with 32bit python. It should work with 64bit python but since it is not tested it can be broken (if so, do not hesitate to send a fix ;-).

To run the client you should install python, make sure to check the "add to path" checkbox during install. You should also have git installed and in your path. Use git to clone the crazyflie client project.

Open a command line window and move to the crazyflie clients folder (the exact command depends of where the project is cloned):

cd crazyflie-clients-python

Download the SDL2.dll windows library:

python tools\build\prep_windows

Install the client in development mode:

pip install -e .[dev,qt5]

You can now run the clients with the following commands:

cfclient
cfheadless
cfloader
cfzmq

NOTE: To use Crazyradio you will have to install the drivers

Working on the client with PyCharm

Pycharm is an IDE for python. Any Python IDE or development environment will work for the Crazyflie client. To work on the Crazyflie firmware with Pycharm, install pycharm community edition and open the Crazyflie client folder in it. Pycharm will automatically detect the python installation.

To run the client, open and run the file bin/cfclient.

You are now able to edit and debug the python code. you can edit the .ui files for the GUI with QtCreator. You can the Qt development kit from the Qt website and open the .ui files in QtCreator.

Creating Windows installer

When you are able to run from source, you can build the windows executable and installer.

First build the executable

python setup.py build

Now you can run the client with build\exe.win32-3.6\cfclient.exe.

To generate the installer you need nsis installed and in the path. If you are a user of chocolatey you can install it with choco install nsis.portable -version 2.50, otherwise you can just download it and install it manually.

To create the installer:

python win32install\generate_nsis.py
makensis win32install\cfclient.nsi

Mac OSX

Using homebrew

IMPORTANT NOTE: The following will use Homebrew and its own Python distribution. If you have a lot of other 3rd party python stuff already running on your system they might or might not be affected by this.

  1. Install homebrew

    See the Homebrew site

  2. Install the brew bottles needed

    brew install python3 sdl sdl2 sdl_image sdl_mixer sdl_ttf libusb portmidi pyqt5
    
  3. Install the client

    • If you only want to use the client to fly the Crazyflie and don't care about coding
    pip3 install cfclient
    
    • If you want to develop the client and play with the source code. From the source folder run
    pip3 install -e .
    

    If you want to develop on cflib as well, install cflib from https://github.com/bitcraze/crazyflie-lib-python

  4. You now have all the dependencies needed to run the client. The client can now be started from any location by:

    cfclient
    

Linux

Launching the GUI application

If you want to develop with the lib, install cflib from https://github.com/bitcraze/crazyflie-lib-python

Cfclient requires Python3, pip and pyqt5 to be installed using the system package manager. For example on Ubuntu/Debian:

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

Install cfclient to run it from source. From the source folder run (to install for your user only you can add --user to the command):

pip3 install -e .

To launch the GUI application in the source folder type: python3 bin/cfclient

To launch the GUI after a systemwide installation, execute cfclient.

Dependencies

The Crazyflie PC client has the following dependencies:

  • Installed from system packages
    • Python 3.4+
    • PyQt5
    • A pyusb backend: libusb 0.X/1.X
  • Installed from PyPI using PIP:
    • cflib
    • PyUSB
    • PyQtGraph
    • ZMQ
    • appdirs

Setting udev permissions

Using Crazyradio on Linux requires that you set udev permissions. See the cflib readme for more information.

crazyflie-clients-python's People

Contributors

evoggy avatar ataffanel avatar krichardsson avatar dbenesj avatar tobbeanton avatar allynbauer avatar omwdunkley avatar alekstorm avatar carlosrdomin avatar david-benes avatar mikevoyt avatar debona avatar mchenryc avatar dbrgn avatar fredg02 avatar jkotur avatar phiamo avatar erget avatar foosel avatar jpreiss avatar steveclement avatar whoenig avatar mattharrison avatar ak1394 avatar derhuerst avatar justinh24 avatar kentwills avatar metametaclass avatar mikezter avatar palvarez89 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.