Skip to content

Commit 555e557

Browse files
committed
Merge branch 'develop'
2 parents 5ef379b + 9b95704 commit 555e557

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2030
-1962
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
sudo: required
22
language: python
3+
git:
4+
depth: 150
35
python:
46
- "2.7"
57
services:

README.md

Lines changed: 47 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,35 @@
22

33

44
The Crazyflie PC client enables flashing and controlling the Crazyflie.
5-
There's also a Python library that can be integrated into other applications
6-
where you would like to use the Crazyflie.
5+
It implement the user interface and high-level control (for example gamepad handling).
6+
The communication with Crazyflie and the implementation of the CRTP protocol to control the Crazflie is handled by the [cflib](https://github.com/bitcraze/crazyflie-lib-python) project.
77

88
For more info see our [wiki](http://wiki.bitcraze.se/ "Bitcraze Wiki").
99

10-
Note. The project is currently being reorganized, which means that This
11-
documentation might become inacurate. You can track the reorganisation work in
12-
the ticket #227.
13-
1410
Running from source
1511
-------------------
1612

1713
The Crazyflie client requires [cflib](https://github.com/bitcraze/crazyflie-lib-python).
18-
Follow the cflib readme to install it.
14+
If you want to develop with the lib too, follow the cflib readme to install it.
1915

2016
## Windows (7/8/10)
2117

22-
Running from source on Windows is tested using the [miniconda](http://conda.pydata.org/miniconda.html) python distribution. It is possible to run from any distribution as long as the required packages are installed. Building the windows installer requires Python 3.4 (because ```py2exe``` is not distributed for Python 3.5 yet). The following instructions assumes **Miniconda 32-bit** is installed.
18+
Running from source on Windows is tested using the [miniconda](http://conda.pydata.org/miniconda.html) python distribution. It is possible to run from any distribution as long as the required packages are installed. Building the windows installer requires Python 3.4 (because ```py2exe``` is not distributed for Python 3.5+ yet). The following instructions assumes **Miniconda 32-bit** is installed.
19+
20+
**Note on python version**: Building the windows executable and installer requires Python 3.4. The client has mostly been tested using Python 32Bit but should work on python 64Bits as well. If you are not interested about building the windows installer, just by running the client, you can run on more recent version of python.
2321

2422
Open a command line windows and move to the crazyflie clients folder (the exact command depends of where the project is cloned):
2523
```
2624
cd crazyflie-clients-python
2725
```
2826

29-
Create and activate a Python 3.4 environment with numpy pyqt and pyqtgraph from conda (it is the packages we cannot easily install with pip):
27+
Create and activate a Python 3.4 environment with pyqt5:
3028
```
31-
conda create -y -n cfclient python=3.4 numpy=1.10.1 pyqt pyqtgraph
29+
conda create -y -n cfclient python=3.4 pyqt=5
3230
activate cfclient
3331
```
3432

35-
Download the SDL2.dll windows library:
33+
Download the 32bits SDL2.dll windows library:
3634
```
3735
python tools\build\prep_windows
3836
```
@@ -42,15 +40,30 @@ Install the client in development mode:
4240
pip install -e .[dev]
4341
```
4442

45-
You can now run the clients:
43+
You can now run the clients with the following commands:
4644
```
4745
cfclient
4846
cfheadless
4947
cfloader
5048
cfzmq
5149
```
5250

53-
**NOTE:** To use the Crazyradio you will have to [install the drivers](https://wiki.bitcraze.io/doc:crazyradio:install_windows_zadig)
51+
**NOTE:** To use Crazyradio you will have to [install the drivers](https://wiki.bitcraze.io/doc:crazyradio:install_windows_zadig)
52+
53+
### Working on the client with PyCharm
54+
55+
Pycharm is an IDE for python. Any IDE or development environment will work for the Crazyflie client. The key here is to use the miniconda python interpreter from the environment created earlier, this can be applied to other development environment.
56+
57+
To work on the Crazyflie firmware with Pycharm, install pycharm comunity edition and open the Crazyflie client folder in it. Then:
58+
59+
- Go to file>settings
60+
- Go to "Project: crazyflie-clients-python" > Project interpreter
61+
- Press the cog on the top right, beside "Project interpreter" and click "add local"
62+
- Locate the interpreter under \<miniconda_root\>\env\cfclient\python.exe (for example C:\Miniconda3\envs\cfclient\python.exe, see [screenshoot](https://wiki.bitcraze.io/_media/doc:crazyflie:client:pycfclient:cfclient_pycharm_windows_miniconda.png?t=1483971038&w=500&h=358&tok=9e4a0c))
63+
- Validate with OK two times
64+
- Open the bin/cfclient file in the pycharm editor and then "Run>Run 'cfclient'" will start the client
65+
66+
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](https://www.qt.io/download-open-source/) and open the .ui files in QtCreator.
5467

5568
### Creating Windows installer
5669

@@ -60,8 +73,8 @@ First build the executable
6073
```
6174
python setup.py py2exe
6275
```
63-
**NOTE:** The first time the previous command will fail complaining about a ```PyQt4\uic\port_v2```
64-
folder. Remove this folder with ```rmdir \Q \S path\to\PyQt4\uic\port_v2```,
76+
**NOTE:** The first time the previous command will fail complaining about a ```PyQt5\uic\port_v2```
77+
folder. Remove this folder with ```rmdir \Q \S path\to\PyQt5\uic\port_v2```,
6578
you can copy-paste the folder path from the py2exe error message.
6679

6780

@@ -103,21 +116,17 @@ they might or might not be affected by this.
103116
104117
1. Install PyQt
105118
106-
If you already have pyqt installed for python2 you need to uninstall it first
107-
108119
```
109-
brew uninstall pyqt
110-
brew install pyqt --with-python3
120+
brew install pyqt5
111121
```
112122
113123
1. Install remaining dependencies
114124
115125
```
116126
brew install libusb
117-
pip3 install pysdl2 pyusb pyqtgraph appdirs
118127
```
119128
120-
1. Install cflib from https://github.com/bitcraze/crazyflie-lib-python
129+
1. If you want to develop on cflib as well, install cflib from https://github.com/bitcraze/crazyflie-lib-python
121130
122131
1. Install cfclient to run it from source. From the source folder run:
123132
```
@@ -126,63 +135,19 @@ they might or might not be affected by this.
126135
127136
1. You now have all the dependencies needed to run the client. From the source folder, run it with the following command:
128137
```
129-
python bin/cfclient
130-
```
131-
132-
### Using MacPorts
133-
1. [Install MacPorts if needed](http://www.macports.org/install.php). Otherwise update your installation with:
134-
```
135-
sudo port selfupdate
136-
sudo port upgrade outdated
137-
```
138-
139-
1. Install dependencies. Note that there are quite a few, so this could take a while:
140-
```
141-
sudo port install libusb python34 py34-SDL2 py34-pyqt4 py34-pip
142-
```
143-
To make the MacPorts ```python``` and ```pip``` the default commands:
144-
```
145-
sudo port select --set python python34
146-
sudo port select --set python3 python34
147-
sudo port select --set pip pip34
148-
```
149-
To install ```pyusb``` from ```pip```, use:
150-
```
151-
sudo pip install pyusb appdirs
152-
```
153-
To enable the plotter tab install pyqtgraph, this takes a lot of time:
154-
```
155-
sudo port install py34-pyqtgraph
156-
```
157-
Install cflib from https://github.com/bitcraze/crazyflie-lib-python
158-
159-
Install cfclient to run it from source. From the source folder run:
160-
```
161-
pip install -e .
162-
```
163-
You can now run the client from the source folder with
164-
```
165-
python bin/cfclient
166-
```
167-
Or, if you did not run the ```port select``` command to set the MacPorts ```python``` as the default, use:
168-
```
169-
/opt/local/bin/python3.4 bin/cfclient
170-
```
171-
172-
1. To make it easier to run MacPorts, add ```/opt/local/bin``` to your PATH variable.
173-
The MacPorts installer should take care of that, but take a look at
174-
```~/.profile``` to make sure. If you have any issues it could be due to the
175-
libraries not getting picked up correctly. Fix that by setting
176-
```DYLD_LIBRARY_PATH``` to ```/opt/local/lib``` in ```~/.profile```:
177-
```
178-
export DYLD_LIBRARY_PATH=/opt/local/lib
138+
cfclient
179139
```
180140
181141
## Linux
182142
183143
### Launching the GUI application
184144
185-
Install cflib from https://github.com/bitcraze/crazyflie-lib-python
145+
If you want to develop with the lib, install cflib from https://github.com/bitcraze/crazyflie-lib-python
146+
147+
Cfclient requires Python3, pip and pyqt5 to be installed using the system package manager. For example on Ubuntu/Debian:
148+
```
149+
sudo apt-get install python3 python3-pip python3-pyqt5
150+
```
186151
187152
Install cfclient to run it from source. From the source folder run (to install
188153
for your user only you can add ```--user``` to the command):
@@ -198,44 +163,16 @@ To launch the GUI after a systemwide installation, execute ```cfclient```.
198163
199164
The Crazyflie PC client has the following dependencies:
200165
201-
* Python 3.4
202-
* PyUSB
203-
* libusb 1.X (works with 0.X as well)
204-
* PyQtGraph
205-
* ZMQ
206-
* PyQt4
207-
* appdirs
208-
209-
Example commands to install these dependencies:
210-
211-
* Fedora:
212-
213-
```
214-
TODO Please contribute
215-
```
216-
217-
218-
* Ubuntu (14.04):
219-
220-
```
221-
sudo apt-get install python3 python3-pip python3-pyqt4 python3-zmq
222-
pip3 install pyusb==1.0.0b2
223-
pip3 install pyqtgraph appdirs
224-
```
225-
226-
* Ubuntu (15.04):
227-
228-
```
229-
sudo apt-get install python3 python3-pip python3-pyqt4 python3-zmq python3-pyqtgraph
230-
sudo pip3 install pyusb==1.0.0b2
231-
sudo pip3 install appdirs
232-
```
233-
234-
* OpenSUSE:
235-
236-
```
237-
TODO Please contribute
238-
```
166+
* Installed from system packages
167+
* Python 3.4+
168+
* PyQt5
169+
* A pyusb backend: libusb 0.X/1.X
170+
* Installed from PyPI using PIP:
171+
* cflib
172+
* PyUSB
173+
* PyQtGraph
174+
* ZMQ
175+
* appdirs
239176
240177
### Setting udev permissions
241178

appveyor.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
version: 1.0.{build}
2-
init:
3-
- cmd: set PATH=C:\Miniconda35;C:\Miniconda35\scripts;%PATH%
42
install:
53
- cmd: >-
6-
conda create -y -q -n cfclient python=3.4 numpy=1.10.1 pyqt pyqtgraph
4+
set PATH=C:\Miniconda35;C:\Miniconda35\scripts;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin
5+
6+
conda create -y -q -n cfclient python=3.4 pyqt=5
77
88
activate cfclient
99
1010
pip install -e .[dev]
1111
12-
rmdir /Q /S C:\Miniconda35\envs\cfclient\lib\site-packages\PyQt4\uic\port_v2
12+
rmdir /Q /S C:\Miniconda35\envs\cfclient\lib\site-packages\PyQt5\uic\port_v2
1313
1414
python tools\build\prep_windows
1515

bitcraze.ico

79.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)