Skip to content

Commit

Permalink
Merge pull request #452 from bitcraze/add-rate-explanation
Browse files Browse the repository at this point in the history
mention rate mode setpoint set in doc
  • Loading branch information
knmcguire committed May 7, 2024
2 parents c2408ef + 2d3422e commit 4cc9005
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cflib/crazyflie/commander.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ def send_setpoint(self, roll, pitch, yawrate, thrust):
"""
Send a new control setpoint for roll/pitch/yaw_Rate/thrust to the copter.
The meaning of these values is depended on the mode of the RPYT commander in the firmware
Default settings are Roll, pitch, yawrate and thrust
The meaning of these values is depended on the mode of the RPYT commander in the firmware.
The roll, pitch and yaw can be set in a rate or absolute mode with parameter group
`flightmode` with variables `stabModeRoll`, `.stabModeRoll` and `.stabModeRoll`.
Default settings are roll, pitch, yawrate and thrust
roll, pitch are in degrees
yawrate is in degrees/s
roll, pitch are in degrees,
yawrate is in degrees/s,
thrust is an integer value ranging from 10001 (next to no power) to 60000 (full power)
"""
if thrust > 0xFFFF or thrust < 0:
Expand Down
5 changes: 5 additions & 0 deletions docs/user-guides/python_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,17 @@ setpoint with the same thrust but with roll/pitch/yawrate = 0, this
will make the Crazyflie stop accelerating. After 2 seconds without new
setpoint the Crazyflie will cut power from the motors.


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

This the current default behavior, but it depends on the [Supervisor configuration in the Crazyflie firmware](https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/functional-areas/supervisor/).

> Note: If you'd like to send rate commands instead, make sure that the [flightmode.stabModeRoll/Pitch/Yaw](https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/api/params/#flightmode) is set to rate (0).
### Other commander setpoints sending

If your Crazyflie has a positioning system (Loco, flowdeck, MoCap, Lighthouse), you can also send velocity or position setpoints, like for instance:
Expand Down

0 comments on commit 4cc9005

Please sign in to comment.