You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
7
7
8
8
For more info see our [wiki](http://wiki.bitcraze.se/"Bitcraze Wiki").
9
9
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
-
14
10
Running from source
15
11
-------------------
16
12
17
13
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.
19
15
20
16
## Windows (7/8/10)
21
17
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.
23
21
24
22
Open a command line windows and move to the crazyflie clients folder (the exact command depends of where the project is cloned):
25
23
```
26
24
cd crazyflie-clients-python
27
25
```
28
26
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:
@@ -42,15 +40,30 @@ Install the client in development mode:
42
40
pip install -e .[dev]
43
41
```
44
42
45
-
You can now run the clients:
43
+
You can now run the clients with the following commands:
46
44
```
47
45
cfclient
48
46
cfheadless
49
47
cfloader
50
48
cfzmq
51
49
```
52
50
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.
54
67
55
68
### Creating Windows installer
56
69
@@ -60,8 +73,8 @@ First build the executable
60
73
```
61
74
python setup.py py2exe
62
75
```
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```,
65
78
you can copy-paste the folder path from the py2exe error message.
66
79
67
80
@@ -103,21 +116,17 @@ they might or might not be affected by this.
103
116
104
117
1. Install PyQt
105
118
106
-
If you already have pyqt installed for python2 you need to uninstall it first
107
-
108
119
```
109
-
brew uninstall pyqt
110
-
brew install pyqt --with-python3
120
+
brew install pyqt5
111
121
```
112
122
113
123
1. Install remaining dependencies
114
124
115
125
```
116
126
brew install libusb
117
-
pip3 install pysdl2 pyusb pyqtgraph appdirs
118
127
```
119
128
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
121
130
122
131
1. Install cfclient to run it from source. From the source folder run:
123
132
```
@@ -126,63 +135,19 @@ they might or might not be affected by this.
126
135
127
136
1. You now have all the dependencies needed to run the client. From the source folder, run it with the following command:
128
137
```
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
179
139
```
180
140
181
141
## Linux
182
142
183
143
### Launching the GUI application
184
144
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:
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
0 commit comments