Skip to content

Commit 90a92a5

Browse files
committed
Merge branch 'develop'
Merge branch 'develop'
2 parents a9b6006 + 66908b7 commit 90a92a5

File tree

128 files changed

+1776
-10734
lines changed

Some content is hidden

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

128 files changed

+1776
-10734
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ config.json
55
dist/*
66
build/*
77
cache
8+
src/cfclient.egg-info/*
9+
src/cfclient/third_party/*
10+
version.json
11+
win32install/*.exe
12+
win32install/cfclient.nsi
813

914
# PC client settings
1015
conf/*
@@ -17,4 +22,4 @@ msvcp90.dll
1722

1823
# PyCharm
1924
.idea/*
20-
.DS_Store
25+
.DS_Store

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@ python:
44
- "2.7"
55
services:
66
- docker
7+
before_install:
8+
- docker pull bitcraze/builder
79
script:
810
- docker run --rm -v ${PWD}:/module bitcraze/builder ./tools/build/build

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ The development in this repository aims to follow the [Git flow](http://nvie.com
2323
- Test your changes and note what OS/version you have tested on
2424
- Describe the change
2525
- Refer to any issues it effects
26-
27-
Out goal is to comply with PEP-8, but there's lots of code that's not up to standard. We try our best to comply but since we slack sometimes we can't really enforce it, but at least there's a few things we want to stick to:
26+
27+
In your code
2828

2929
- Don't include name, date or information about the change in the code. That's what Git is for.
3030
- CamelCase classes, but not functions and variables
3131
- Private variables and functions should start with _
3232
- 4 spaces indentation
3333
- When catching exceptions try to make it as specific as possible, it makes it harder for bugs to hide
3434
- Short variable and function names are ok if the scope is small
35+
- PEP8/flake8 compliant
3536

3637
## CI-server
3738

3839
We use https://travis-ci.org/bitcraze/crazyflie-clients-python for continuous integration.
39-
Initially we only check some PEP-8 properties, but the goal is to also add unit testing and integration testing. This is an ongoing effort.

LICENSE.txt

Lines changed: 350 additions & 350 deletions
Large diffs are not rendered by default.

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
include README.md
12
recursive-include src/cfclient/configs *.json
23
recursive-include src/cfclient/ui *.ui
4+
recursive-include src/cfclient/resources *
5+
include src/cfclient/version.json

README.md

Lines changed: 102 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,89 @@
1-
# Crazyflie PC client [![Build Status](https://api.travis-ci.org/bitcraze/crazyflie-clients-python.svg)](https://travis-ci.org/bitcraze/crazyflie-clients-python)
1+
# Crazyflie PC client [![Build Status](https://api.travis-ci.org/bitcraze/crazyflie-clients-python.svg)](https://travis-ci.org/bitcraze/crazyflie-clients-python) [![Build status](https://ci.appveyor.com/api/projects/status/u2kejdbc9wrexo31?svg=true)](https://ci.appveyor.com/project/bitcraze/crazyflie-clients-python)
2+
23

34
The Crazyflie PC client enables flashing and controlling the Crazyflie.
45
There's also a Python library that can be integrated into other applications
56
where you would like to use the Crazyflie.
67

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

9-
Installation
10-
------------
11-
12-
## Linux
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.
1313

14-
To install the Crazyflie PC client in Linux, you can run the setup script with:
14+
Running from source
15+
-------------------
1516

16-
```sudo setup_linux.sh```
17+
The Crazyflie client requires [cflib](https://github.com/bitcraze/crazyflie-lib-python).
18+
Follow the cflib readme to install it.
1719

18-
This will install the Crazyflie PC client systemwide, create a udev entry for
19-
the Crazyradio and setup the permissions so that the current user can use the
20-
radio without root permissions after restarting the computer. For further
21-
instructions on how to run from source and [install dependencies](https://github.com/SteveClement/crazyflie-clients-python#dependencies) see bellow.
20+
## Windows (7/8/10)
2221

23-
## Windows
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.
2423

25-
Follow these steps to install the binary distribution on Windows 7/8/10.
26-
- Download the latest release [here](https://github.com/bitcraze/crazyflie-clients-python/releases) (named cfclient-win32-install-*.exe)
27-
- Execute the installer. After the install the application will be added to the Start menu.
28-
- Install the Crazyradio drivers by following [these instructions](https://wiki.bitcraze.io/doc:crazyradio:install_windows_zadig)
24+
Open a command line windows and move to the crazyflie clients folder (the exact command depends of where the project is cloned):
25+
```
26+
cd crazyflie-clients-python
27+
```
2928

30-
Running from source
31-
-------------------
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):
30+
```
31+
conda create -y -n cfclient python=3.4 numpy=1.10.1 pyqt pyqtgraph
32+
activate cfclient
33+
```
3234

33-
## Windows (7/8/10)
35+
Download the SDL2.dll windows library:
36+
```
37+
python tools\build\prep_windows
38+
```
3439

35-
Install dependencies. With Windows installers (tested using only 32-bit installs on 64-bit OS):
36-
- [Python 3.4](https://www.python.org/downloads/windows/) (make sure the pip component is selected when installing)
37-
- [PyQT4 for Python 3.4](http://www.riverbankcomputing.com/software/pyqt/download)
38-
- [NumPy for Python 3.4](http://sourceforge.net/projects/numpy/files/NumPy)
39-
- [SDL2](https://www.libsdl.org/download-2.0.php) (copy SDL2.dll into the client source folder)
40+
Install the client in development mode:
41+
```
42+
pip install -e .[dev]
43+
```
4044

41-
Then install PyUSB, PyZMQ, PySDL2 and PyQtGraph using pip
45+
You can now run the clients:
4246
```
43-
C:\Users\bitcraze>\Python34\python.exe -m pip install pyusb==1.0.0b2 pyzmq pysdl2 pyqtgraph
47+
cfclient
48+
cfheadless
49+
cfloader
50+
cfzmq
4451
```
4552

46-
Finally you run the client using the following command
53+
**NOTE:** To use the Crazyradio you will have to [install the drivers](https://wiki.bitcraze.io/doc:crazyradio:install_windows_zadig)
54+
55+
### Creating Windows installer
56+
57+
When you are able to run from source, you can build the windows executable and installer.
58+
59+
First build the executable
4760
```
48-
\Python34\python bin\cfclient
61+
python setup.py py2exe
4962
```
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```,
65+
you can copy-paste the folder path from the py2exe error message.
66+
5067

51-
**NOTE**: To use the Crazyradio you will have to [install the drivers](https://wiki.bitcraze.io/doc:crazyradio:install_windows_zadig)
68+
Now you can run the client with ```dist\cfclient.exe```.
69+
70+
To generate the installer you need [nsis](http://nsis.sourceforge.net/) installed and in the path. If you
71+
are a user of [chocolatey](https://chocolatey.org/) you can install it with ```choco install nsis.portable -version 2.50```,
72+
otherwise you can just download it and install it manually.
73+
74+
To create the installer:
75+
```
76+
python win32install\generate_nsis.py
77+
makensis win32install\cfclient.nsi
78+
```
5279

5380
## Mac OSX
5481

5582
### Using homebrew
5683
**IMPORTANT NOTE**: The following will use
5784
[Homebrew](http://brew.sh/) and its own Python distribution. If
5885
you have a lot of other 3rd party python stuff already running on your system
59-
they might or might not affected of this.
86+
they might or might not be affected by this.
6087

6188
1. [Install the Command Line Tools](https://gist.github.com/derhuerst/1b15ff4652a867391f03#1--install-the-command-line-tools).
6289

@@ -87,7 +114,14 @@ they might or might not affected of this.
87114
88115
```
89116
brew install libusb
90-
pip3 install pysdl2 pyusb pyqtgraph
117+
pip3 install pysdl2 pyusb pyqtgraph appdirs
118+
```
119+
120+
1. Install cflib from https://github.com/bitcraze/crazyflie-lib-python
121+
122+
1. Install cfclient to run it from source. From the source folder run:
123+
```
124+
pip3 install -e .
91125
```
92126
93127
1. You now have all the dependencies needed to run the client. From the source folder, run it with the following command:
@@ -114,12 +148,18 @@ they might or might not affected of this.
114148
```
115149
To install ```pyusb``` from ```pip```, use:
116150
```
117-
sudo pip install pyusb
151+
sudo pip install pyusb appdirs
118152
```
119153
To enable the plotter tab install pyqtgraph, this takes a lot of time:
120154
```
121155
sudo port install py34-pyqtgraph
122156
```
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+
```
123163
You can now run the client from the source folder with
124164
```
125165
python bin/cfclient
@@ -142,10 +182,17 @@ they might or might not affected of this.
142182
143183
### Launching the GUI application
144184
185+
Install cflib from https://github.com/bitcraze/crazyflie-lib-python
186+
187+
Install cfclient to run it from source. From the source folder run (to install
188+
for your user only you can add ```--user``` to the command):
189+
```
190+
pip3 install -e .
191+
```
145192
To launch the GUI application in the source folder type:
146193
```python bin/cfclient```
147194
148-
To launch the GUI after a systemwide installation, execute ```cfclient```.
195+
To launch the GUI after a systemwide installation, execute ```cfclient```.
149196
150197
### Dependencies
151198
@@ -157,53 +204,41 @@ The Crazyflie PC client has the following dependencies:
157204
* PyQtGraph
158205
* ZMQ
159206
* PyQt4
207+
* appdirs
160208
161209
Example commands to install these dependencies:
162210
163-
* Fedora (tested for 16 to 18):
211+
* Fedora:
212+
213+
```
214+
TODO Please contribute
215+
```
164216
165-
```sudo yum install pysdl2 pyusb PyQt4```
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+
```
166225
167226
* Ubuntu (15.04):
168227
169228
```
170229
sudo apt-get install python3 python3-pip python3-pyqt4 python3-zmq python3-pyqtgraph
171230
sudo pip3 install pyusb==1.0.0b2
231+
sudo pip3 install appdirs
172232
```
173233
174-
* OpenSUSE (tested for 11.3):
234+
* OpenSUSE:
175235
176-
```sudo zypper install python-pysdl2 libusb python-usb```
236+
```
237+
TODO Please contribute
238+
```
177239
178240
### Setting udev permissions
179241
180-
The following steps make it possible to use the USB Radio without being root.
181-
182-
Note: If using a fresh Debian install, you may need to install sudo first
183-
(executing exit command to exit from root shell first):
184-
185-
```
186-
su -
187-
apt-get install sudo
188-
```
189-
190-
Now, with sudo installed, you should be able to do the following commands
191-
192-
```
193-
sudo groupadd plugdev
194-
sudo usermod -a -G plugdev <username>
195-
```
196-
197-
Create a file named ```/etc/udev/rules.d/99-crazyradio.rules``` and add the
198-
following:
199-
```
200-
SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE="0664", GROUP="plugdev"
201-
```
202-
203-
To connect Crazyflie 2.0 via usb, create a file name ```/etc/udev/rules.d/99-crazyflie.rules``` and add the following:
204-
```
205-
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE="0664", GROUP="plugdev"
206-
```
207-
208-
Restart the computer and you are now able to access the USB radio dongle
209-
without being root.
242+
Using Crazyradio on Linux requires that you set udev permissions. See the cflib
243+
[readme](https://github.com/bitcraze/crazyflie-lib-python#setting-udev-permissions)
244+
for more information.

appveyor.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 1.0.{build}
2+
init:
3+
- cmd: set PATH=C:\Miniconda35;C:\Miniconda35\scripts;%PATH%
4+
install:
5+
- cmd: >-
6+
conda create -y -q -n cfclient python=3.4 numpy=1.10.1 pyqt pyqtgraph
7+
8+
activate cfclient
9+
10+
pip install -e .[dev]
11+
12+
rmdir /Q /S C:\Miniconda35\envs\cfclient\lib\site-packages\PyQt4\uic\port_v2
13+
14+
python tools\build\prep_windows
15+
16+
choco install -y nsis.portable -version 2.50
17+
build_script:
18+
- cmd: >-
19+
python setup.py py2exe
20+
21+
python win32install\generate_nsis.py
22+
23+
makensis win32install\cfclient.nsi
24+
artifacts:
25+
- path: dist\
26+
- path: win32install\*.exe

0 commit comments

Comments
 (0)