Skip to content

Commit cb1d830

Browse files
authored
Merge pull request #360 from bitcraze/update-doc-2022.9
Update doc 2022.9
2 parents ff1b5f8 + 00d31b5 commit cb1d830

File tree

13 files changed

+96
-61
lines changed

13 files changed

+96
-61
lines changed

docs/_data/menu.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

docs/api/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Auto-generated API Documentation
3+
page_id: api_index
4+
sort_order: 5
5+
---
6+
7+
This section contains auto-generated documentation of the classes and functions of the Crazyflie python library.
8+
9+
{% sub_page_menu %}

docs/development/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Development
3+
page_id: development_index
4+
sort_order: 4
5+
---
6+
7+
In this section you will find information about development of the Crazyflie python library
8+
9+
{% sub_page_menu %}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Debugging CRTP using Wireshark
33
page_id: wireshark_debugging
4+
redirect: /wireshark/wireshark/
45
---
56

67
Wireshark is a free and open-source packet analyzer. It is used for network troubleshooting, analysis, software and communications protocol development, and education. It makes analyzing what is going on with packet based protocols easier.

docs/functional-areas/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Functional Areas
3+
page_id: functional_areas_index
4+
sort_order: 3
5+
---
6+
7+
In this section you will find information about functional areas
8+
9+
{% sub_page_menu %}

docs/installation/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: installation
3+
page_id: installation_index
4+
sort_order: 1
5+
---
6+
7+
In this section you will find installation instructions
8+
9+
{% sub_page_menu %}

docs/installation/install.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ you can skip this section.
4242

4343
* To deactivate the virtualenv when you are done using it `deactivate`
4444

45-
#### Install cflib dependencies
46-
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`.
47-
48-
To verify the installation, connect the crazyflie and run an example: `python3 examples/logging/basiclog.py`
49-
50-
### Pre commit hooks
45+
### Pre commit hooks (Ubuntu)
5146
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:
5247
```
48+
$ pip3 install pre-commit
49+
```
50+
go to crazyflie-lib-python root folder and run
51+
```
5352
$ pre-commit install
53+
$ pre-commit run --all-files
5454
```
5555
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.
5656

docs/user-guides/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: User guides
3+
page_id: user_guides_index
4+
sort_order: 2
5+
---
6+
7+
In this section you will find user guides
8+
9+
{% sub_page_menu %}

docs/user-guides/python_api.md

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@ a synchronous API by wrapping the asynchronous classes, see the
3434
All communication links are identified using an URI build up of the
3535
following: InterfaceType://InterfaceId/InterfaceChannel/InterfaceSpeed
3636

37-
Currently only *radio* and *debug* interfaces are used but there\'s
38-
ideas for more like *udp*, *serial*, *usb*, etc\...Here are some
39-
examples:
37+
Currently we have *radio*, *serial*, *usb*, *debug*, *udp* interfaces are used. Here are some examples:
4038

4139
- _radio://0/10/2M : Radio interface, USB dongle number 0, radio channel 10 and radio
4240
speed 2 Mbit/s: radio://0/10/2M
4341
- _debug://0/1_ : Debug interface, id 0, channel 1
42+
- _usb://0_ : USB cable to microusb port, id 0
43+
- _serial://ttyAMA0_ : Serial port, id ttyAMA0
44+
- _tcp://aideck-AABBCCDD.local:5000_ : TCP network connection, Name: aideck-AABBCCDD.local, port 5000
4445

4546
### Variables and logging
4647

@@ -76,12 +77,14 @@ The library supports reading and writing parameters at run-time to the
7677
firmware. This is intended to be used for data that is not continuously
7778
being changed by the firmware, like setting regulation parameters and
7879
reading out if the power-on self-tests passed. Parameters should only
79-
change in the firmware when being set from the host or during start-up.
80+
change in the firmware when being set from the host (cfclient or a cflib script) or during start-up.
81+
8082
The library doesn\'t continuously update the parameter values, this
8183
should only be done once after connecting. After each write to a
8284
parameter the firmware will send back the updated value and this will be
83-
forwarded to callbacks registered for reading this parameter. The
84-
parameters should be used in the following way:
85+
forwarded to callbacks registered for reading this parameter.
86+
87+
The parameters should be used in the following way:
8588

8689
- Register parameter updated callbacks at any time in your application
8790
- Connect to your Crazyflie (this will download the parameter TOC)
@@ -92,6 +95,8 @@ parameters should be used in the following way:
9295
- For each write all the callbacks registered for this parameter will
9396
be called back
9497

98+
There is an exception for experimental support to change the parameter from within [firmware's app layer](https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/userguides/app_layer/#internal-log-and-param-system). However do mind that this functionality is not according to the design of the parameters framework so that the host might not be updated correctly on the parameter change.
99+
95100
### Variable and parameter names
96101

97102
All names of parameters and log variables use the same structure:
@@ -200,7 +205,7 @@ object:
200205
``` python
201206
crazyflie = Crazyflie()
202207
crazyflie.connected.add_callback(crazyflie_connected)
203-
crazyflie.open_link("radio://0/10/250K")
208+
crazyflie.open_link("radio://0/10/2M")
204209
```
205210

206211
Then you can use the following to close the link again:
@@ -209,11 +214,13 @@ Then you can use the following to close the link again:
209214
crazyflie.close_link()
210215
```
211216

212-
## Sending control setpoints
217+
## Sending control setpoints with the commander framework
213218

214219
The control setpoints are not implemented as parameters, instead they
215220
have a special API.
216221

222+
### Attitude Setpoints
223+
217224
``` python
218225
def send_setpoint(self, roll, pitch, yawrate, thrust):
219226
```
@@ -246,6 +253,16 @@ one command with thrust = 0 in order to unlock the command. This
246253
unlock procedure needs to be repeated if the watchdog describe above
247254
kicks-in.
248255

256+
### Other commander setpoints sending
257+
258+
If your Crazyflie has a positioning system (Loco, flowdeck, MoCap, Lighthouse), you can also send velocity or position setpoints, like for instance:
259+
260+
```
261+
send_hover_setpoint(self, vx, vy, yawrate, zdistance)
262+
```
263+
264+
Check out the [automated API documentation](/docs/api/cflib/crazyflie/commander.md) for the Crazyflie cflib's commander frame work to find out what other functions you can use.
265+
249266
## Parameters
250267

251268
The parameter framework is used to read and set parameters. This
@@ -301,12 +318,12 @@ It is also possible to get the current value of a parameter (when connected) wit
301318
value = get_value(complete_name)
302319
```
303320

304-
Note 1: If you call `set_value()` and then directly call `get_value()` for a parameter, you might not read back the new
321+
>**Note 1** If you call `set_value()` and then directly call `get_value()` for a parameter, you might not read back the new
305322
value, but get the old one instead. The process is asynchronous and `get_value()` will not return the new value until
306323
the parameter value has propagated to the Crazyflie and back. Use the callback method if you need to be certain
307324
that you get the correct value after an update.
308325

309-
Note 2: `get_value()` and `set_value()` can not be called from callbacks until the Crazyflie is fully connected.
326+
>**Note 2**: `get_value()` and `set_value()` can not be called from callbacks until the Crazyflie is fully connected.
310327
Most notably they can not be called from the `connected` callback as the parameter values have not been
311328
downloaded yet. Use the `fully_connected` callback to make sure the system is ready for parameter use. It is OK to
312329
call `get_value()` and `set_value()` from the `fully_connected` callback.
@@ -491,7 +508,7 @@ and SyncCrazyflie instances. To get the log values, iterate the instance.
491508

492509
### MotionCommander
493510

494-
The MotionCommander is intended to simplify basic autonomous flight. The Crazyflie takes off
511+
The MotionCommander class is intended to simplify basic autonomous flight, where the motion control is done from the host computer. The Crazyflie takes off
495512
when entering the "with" section, and lands when exiting. It has functions for basic
496513
movements that are blocking until the motion is finished.
497514

@@ -512,13 +529,13 @@ system, all positions are relative. It is mainly intended to be used with a Flow
512529

513530
### PositionHlCommander
514531

515-
The PositionHlCommander is intended to simplify basic autonomous flight. The Crazyflie takes off
532+
The PositionHlCommander is intended to simplify basic autonomous flight, where all the high level commands exists inside the Crazyflie firmware. The Crazyflie takes off
516533
when entering the "with" section, and lands when exiting. It has functions for basic
517534
movements that are blocking until the motion is finished.
518535

519536
The PositionHlCommander uses the high level commander in the Crazyflie and is
520-
based on a global coordinate system and absolute positoinins. It is inteneded
521-
to be used with a positioning system such as LPS, the lighthouse or a mocap system.
537+
based on a global coordinate system and absolute positions. It is intended
538+
to be used with a positioning system such as Loco, the lighthouse or a mocap system.
522539

523540
``` python
524541
with SyncCrazyflie(URI) as scf:

0 commit comments

Comments
 (0)