|
2 | 2 |
|
3 | 3 | cflib is an API written in Python that is used to communicate with the Crazyflie |
4 | 4 | and Crazyflie 2.0 quadcopters. It is intended to be used by client software to |
5 | | -communicate with and control a Crazyflie quadcopter. For instance the [cfclient][cfclient] Crazyflie PC client uses the cflib. |
| 5 | +communicate with and control a Crazyflie quadcopter. For instance the [Crazyflie PC client](https://www.github.com/bitcraze/crazyflie-clients-python) uses the cflib. |
6 | 6 |
|
7 | 7 | See [below](#platform-notes) for platform specific instruction. |
8 | 8 | For more info see our [documentation](https://www.bitcraze.io/documentation/repository/crazyflie-lib-python/master/). |
9 | 9 |
|
| 10 | +## Installation |
| 11 | +See the [installation instructions](docs/installation/install.md) in the github docs folder. |
10 | 12 |
|
11 | | -## Development |
12 | | -### Developing for the cfclient |
13 | | -* [Fork the cflib](https://help.github.com/articles/fork-a-repo/) |
14 | | -* [Clone the cflib](https://help.github.com/articles/cloning-a-repository/), `git clone git@github.com:YOUR-USERNAME/crazyflie-lib-python.git` |
15 | | -* [Install the cflib in editable mode](http://pip-python3.readthedocs.org/en/latest/reference/pip_install.html?highlight=editable#editable-installs), `pip install -e path/to/cflib` |
16 | | - |
17 | | - |
18 | | -* [Uninstall the cflib if you don't want it any more](http://pip-python3.readthedocs.org/en/latest/reference/pip_uninstall.html), `pip uninstall cflib` |
19 | | - |
20 | | -Note: If you are developing for the [cfclient][cfclient] you must use python3. On Ubuntu (16.04, 18.08) use `pip3` instead of `pip`. |
21 | | - |
22 | | -### Linux, OSX, Windows |
23 | | - |
24 | | -The following should be executed in the root of the crazyflie-lib-python file tree. |
25 | | - |
26 | | -#### Virtualenv |
27 | | -This section contains a very short description of how to use [virtualenv (local python environment)](https://virtualenv.pypa.io/en/latest/) |
28 | | -with package dependencies. If you don't want to use virualenv and don't mind installing cflib dependencies system-wide |
29 | | -you can skip this section. |
30 | | - |
31 | | -* Install virtualenv: `pip install virtualenv` |
32 | | -* create an environment: `virtualenv venv` |
33 | | -* Activate the environment: `source venv/bin/activate` |
34 | | - |
35 | | - |
36 | | -* To deactivate the virtualenv when you are done using it `deactivate` |
37 | | - |
38 | | -Note: For systems that support [make](https://www.gnu.org/software/make/manual/html_node/Simple-Makefile.html), you can use `make venv` to |
39 | | -create an environment, activate it and install dependencies. |
40 | | - |
41 | | -#### Install cflib dependencies |
42 | | -Install dependencies required by the lib: `pip install -r requirements.txt`. If you are planning on developing on the lib you should also run: `pip install -r requirements-dev.txt`. |
43 | | - |
44 | | -To verify the installation, connect the crazyflie and run an example: `python examples/basiclog` |
45 | | - |
46 | | -### Pre commit hooks |
47 | | -If you want some extra help with keeping to the mandated python coding style you can install hooks that verify your style at commit time. This is done by running: |
48 | | -``` |
49 | | -$ pre-commit install |
50 | | -``` |
51 | | -This will run the lint checkers defined in `.pre-commit-config-yaml` on your proposed changes and alert you if you need to change anything. |
52 | | - |
53 | | -## Testing |
54 | | -### With docker and the toolbelt |
55 | | - |
56 | | -For information and installation of the |
57 | | -[toolbelt.](https://wiki.bitcraze.io/projects:dockerbuilderimage:index) |
58 | | - |
59 | | -* Check to see if you pass tests: `tb test` |
60 | | -* Check to see if you pass style guidelines: `tb verify` |
61 | | - |
62 | | -Note: Docker and the toolbelt is an optional way of running tests and reduces the |
63 | | -work needed to maintain your python environment. |
64 | | - |
65 | | -### Native python on Linux, OSX, Windows |
66 | | - [Tox](http://tox.readthedocs.org/en/latest/) is used for native testing: `pip install tox` |
67 | | -* If test fails after installing tox with `pip install tox`, installing with `sudo apt-get install tox`result a successful test run |
68 | | - |
69 | | -* Test package in python3.4 `TOXENV=py34 tox` |
70 | | -* Test package in python3.6 `TOXENV=py36 tox` |
71 | | - |
72 | | -Note: You must have the specific python versions on your machine or tests will fail. (ie. without specifying the TOXENV, `tox` runs tests for python 3.3, 3.4 and would require all python versions to be installed on the machine.) |
73 | | - |
74 | | - |
75 | | -## Platform notes |
76 | | - |
77 | | -### Linux |
78 | | - |
79 | | -#### Setting udev permissions |
80 | | - |
81 | | -The following steps make it possible to use the USB Radio without being root. |
82 | | - |
83 | | -``` |
84 | | -sudo groupadd plugdev |
85 | | -sudo usermod -a -G plugdev $USER |
86 | | -``` |
87 | | - |
88 | | -You will need to log out and log in again in order to be a member of the plugdev group. |
89 | | - |
90 | | -Create a file named ```/etc/udev/rules.d/99-crazyradio.rules``` and add the |
91 | | -following: |
92 | | -``` |
93 | | -# Crazyradio (normal operation) |
94 | | -SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE="0664", GROUP="plugdev" |
95 | | -# Bootloader |
96 | | -SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="0101", MODE="0664", GROUP="plugdev" |
97 | | -``` |
98 | | - |
99 | | -To connect Crazyflie 2.0 via usb, create a file name ```/etc/udev/rules.d/99-crazyflie.rules``` and add the following: |
100 | | -``` |
101 | | -SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE="0664", GROUP="plugdev" |
102 | | -``` |
103 | | - |
104 | | -You can reload the udev-rules using the following: |
105 | | -``` |
106 | | -sudo udevadm control --reload-rules |
107 | | -sudo udevadm trigger |
108 | | -``` |
109 | | - |
110 | | -[cfclient]: https://www.github.com/bitcraze/crazyflie-clients-python |
| 13 | +## Official Documentation |
111 | 14 |
|
| 15 | +Check out the [Bitcraze crazyflie-lib-python documentation](https://www.bitcraze.io/documentation/repository/crazyflie-lib-python/master/) on our website. |
112 | 16 |
|
113 | 17 | ## Contribute |
114 | 18 |
|
115 | | -Everyone is encouraged to contribute to the CrazyFlie library by forking the Github repository and making a pull request or opening an issue. |
| 19 | +Everyone is encouraged to contribute to the CrazyFlie library by forking the Github repository and making a pull request or opening an issue. |
0 commit comments