Skip to content

Commit 18948ff

Browse files
authored
Update python_api.md
1 parent c5aa32b commit 18948ff

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

docs/user-guides/python_api.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ title: The Crazyflie Python API explanation
33
page_id: python_api
44
---
55

6-
In order to easily use and control the Crazyflie there\'s an library
6+
In order to easily use and control the Crazyflie there\'s a library
77
made in Python that gives high-level functions and hides the details.
88
This page contains generic information about how to use this library and
99
the API that it implements.
1010

11-
If you are interested in more details look in the PyDoc in the code or:
11+
If you are interested in more detail,s look in the PyDoc in the code or:
1212

13-
- Communication protocol for
13+
- Communication protocol for
1414
[logging](https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/functional-areas/crtp/crtp_log/) or
1515
[parameters](https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/functional-areas/crtp/crtp_parameters/)
1616
- [Automated documentation for Python API](https://www.bitcraze.io/documentation/repository/crazyflie-lib-python/master/api/cflib/)
@@ -25,20 +25,20 @@ will be called when the link is opened. The library doesn\'t contain any
2525
threads or locks that will keep the application running, it\'s up to the
2626
application that is using the library to do this.
2727

28-
There are a few synchronous wrappers for selected classes that creates
28+
There are a few synchronous wrappers for selected classes that create
2929
a synchronous API by wrapping the asynchronous classes, see the
3030
[Synchronous API section](#synchronous-api)
3131

3232
### Uniform Resource Identifier (URI)
3333

34-
All communication links are identified using an URI build up of the
34+
All communication links are identified using an URI built up of the
3535
following: InterfaceType://InterfaceId/InterfaceChannel/InterfaceSpeed
3636

37-
Currently we have *radio*, *serial*, *usb*, *debug*, *udp* interfaces are used. Here are some examples:
37+
Currently we have *radio*, *serial*, *usb*, *debug*, *udp* interfaces. Here are some examples:
3838

39-
- _radio://0/10/2M : Radio interface, USB dongle number 0, radio channel 10 and radio
39+
- _radio://0/10/2M_ : Radio interface, USB dongle number 0, radio channel 10 and radio
4040
speed 2 Mbit/s: radio://0/10/2M
41-
- _debug://0/1_ : Debug interface, id 0, channel 1
41+
- _debug://0/1_ : Debug interface, id 0, channel 1
4242
- _usb://0_ : USB cable to microusb port, id 0
4343
- _serial://ttyAMA0_ : Serial port, id ttyAMA0
4444
- _tcp://aideck-AABBCCDD.local:5000_ : TCP network connection, Name: aideck-AABBCCDD.local, port 5000
@@ -61,13 +61,13 @@ following way:
6161
are in the TOC)
6262
- After checking that the configuration is valid, set up callbacks for
6363
the data in your application and start the log configuration
64-
- Each time the firmware sends data back to the host the callback will
65-
the called with a time-stamp and the data
64+
- Each time the firmware sends data back to the host, the callback will
65+
be called with a time-stamp and the data
6666

67-
There\'s a few limitations that needs to be taken into account:
67+
There\'s are few limitations that need to be taken into account:
6868

69-
- The maximum byte length for a log packet is of 26 bytes. This for
70-
for example allows to log 6 floats and one uint16_t (6*4 + 2 bytes)
69+
- The maximum length for a log packet is 26 bytes. This, for
70+
for example, allows to log 6 floats and one uint16_t (6\*4 + 2 bytes)
7171
in a single packet.
7272
- The minimum period of a for a log configuration is multiples of 10ms
7373

@@ -76,7 +76,7 @@ There\'s a few limitations that needs to be taken into account:
7676
The library supports reading and writing parameters at run-time to the
7777
firmware. This is intended to be used for data that is not continuously
7878
being changed by the firmware, like setting regulation parameters and
79-
reading out if the power-on self-tests passed. Parameters should only
79+
reading out if the power-on self-tests passed. Parameters should only be
8080
change in the firmware when being set from the host (cfclient or a cflib script) or during start-up.
8181

8282
The library doesn\'t continuously update the parameter values, this
@@ -100,10 +100,10 @@ There is an exception for experimental support to change the parameter from with
100100
### Variable and parameter names
101101

102102
All names of parameters and log variables use the same structure:
103-
`group.name`
103+
`group.name`.
104104

105105
The group should be used to bundle together logical groups, like
106-
everything that has to do with the stabilizer should be in the group
106+
everything that deals with the stabilizer should be in the group
107107
`stabilizer`.
108108

109109
There\'s a limit of 28 chars in total and here are some examples:
@@ -152,7 +152,7 @@ be used. Enable it in the call to `init_drivers()`
152152

153153
## Connection- and link-callbacks
154154

155-
Operations on the link and connection will return directly and will call
155+
Operations on the link and connection will return immediately and will call
156156
the following callbacks when events occur:
157157

158158
``` python
@@ -199,7 +199,7 @@ available interfaces (currently the debug and radio interface).
199199
print "Interface with URI [%s] found and name/comment [%s]" % (i[0], i[1])
200200
```
201201

202-
Opening and closing a communication link is doing by using the Crazyflie
202+
Opening and closing a communication link is done by using the Crazyflie
203203
object:
204204

205205
``` python
@@ -231,26 +231,26 @@ To send a new control set-point use the following:
231231
roll = 0.0
232232
pitch = 0.0
233233
yawrate = 0
234-
thrust = 0
234+
thrust = 10001
235235
crazyflie.commander.send_setpoint(roll, pitch, yawrate, thrust)
236236
```
237237

238238
Thrust is an integer value ranging from 10001 (next to no power) to
239239
60000 (full power). It corresponds to the mean thrust that will be
240240
applied to the motors. There is a battery compensation algorithm
241241
applied to make the thrust mostly independent of battery voltage.
242-
Roll/pitch are in degree and yawrate in degree/seconds.
242+
Roll/pitch are in degree and yawrate is in degree/seconds.
243243

244244
This command will set the attitude controller setpoint for the next
245-
500ms. After 500ms without net setpoint, the Crazyflie will apply a
245+
500ms. After 500ms without next setpoint, the Crazyflie will apply a
246246
setpoint with the same thrust but with roll/pitch/yawrate = 0, this
247-
will make the Crazyflie stop accelerate. After 2 seconds without new
248-
setpoint the Crazyflie will cut power to the motors.
247+
will make the Crazyflie stop accelerating. After 2 seconds without new
248+
setpoint the Crazyflie will cut power from the motors.
249249

250250
Note that this command implements a motor lock mechanism that is
251251
intended to avoid flyaway when connecting a gamepad. You must send
252252
one command with thrust = 0 in order to unlock the command. This
253-
unlock procedure needs to be repeated if the watchdog describe above
253+
unlock procedure needs to be repeated if the watchdog described above
254254
kicks-in.
255255

256256
### Other commander setpoints sending
@@ -261,7 +261,7 @@ If your Crazyflie has a positioning system (Loco, flowdeck, MoCap, Lighthouse),
261261
send_hover_setpoint(self, vx, vy, yawrate, zdistance)
262262
```
263263

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.
264+
Check out the [automated API documentation](/docs/api/cflib/crazyflie/commander.md) for the Crazyflie cflib's commander framework to find out what other functions you can use.
265265

266266
## Parameters
267267

@@ -274,7 +274,7 @@ functionality should be used when:
274274
If this is not the case then the logging framework should be used
275275
instead.
276276

277-
To set a parameter you must have the connected to the Crazyflie. A
277+
To set a parameter you must be connected to the Crazyflie. A
278278
parameter is set using:
279279

280280
``` python
@@ -292,7 +292,7 @@ Crazyflie).
292292
``` python
293293
add_update_callback(group, name=None, cb=None)
294294
"""
295-
Add a callback for a specific parameter name or group. If not name is specified then
295+
Add a callback for a specific parameter name or group. If name is not specified then
296296
all parameters in the group will trigger the callback. This callback will be executed
297297
when a new value is read from the Crazyflie.
298298
"""
@@ -356,11 +356,11 @@ The API to create and get information from LogConfig:
356356
add_variable(name, fetch_as=None)
357357
"""Add a new variable to the configuration.
358358
359-
name - Complete name of the variable in the form group.name
359+
name - Full name of the variable in the form group.name
360360
fetch_as - String representation of the type the variable should be
361361
fetched as (i.e uint8_t, float, FP16, etc)
362362
363-
If no fetch_as type is supplied, then the stored as type will be used
363+
If no fetch_as type is supplied, then the stored type will be used
364364
(i.e the type of the fetched variable is the same as it's stored in the
365365
Crazyflie)."""
366366

@@ -404,7 +404,7 @@ internal type to transferred type before transfers:
404404
- uint8\_t and int8\_t
405405
- uint16\_t and int16\_t
406406
- uint32\_t and int32\_t
407-
- FP16: 16bit version of floating point, allows to pack more variable
407+
- FP16: 16bit version of floating point, allows to pack more variables
408408
in one packet at the expense of precision.
409409

410410
The logging cannot be started until your are connected to a Crazyflie:
@@ -445,7 +445,7 @@ be added.
445445
The synchronous classes are wrappers around the asynchronous API, where the asynchronous
446446
calls/callbacks are replaced with blocking calls. The synchronous API does not
447447
provide the full flexibility of the asynchronous API, but is useful when writing
448-
small scripts for logging for instance.
448+
small scripts, for logging for instance.
449449

450450
The synchronous API uses the python Context manager concept, that is the ```with``` keyword.
451451
A resource is allocated when entering a ```with``` section and automatically released when
@@ -508,7 +508,7 @@ and SyncCrazyflie instances. To get the log values, iterate the instance.
508508

509509
### MotionCommander
510510

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
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 and makes
512512
when entering the "with" section, and lands when exiting. It has functions for basic
513513
movements that are blocking until the motion is finished.
514514

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

530530
### PositionHlCommander
531531

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
532+
The PositionHlCommander is intended to simplify basic autonomous flight, where all the high level commands exist inside the Crazyflie firmware. The Crazyflie takes off
533533
when entering the "with" section, and lands when exiting. It has functions for basic
534534
movements that are blocking until the motion is finished.
535535

0 commit comments

Comments
 (0)