Send pitch and roll rate setpoint with Python lib

Discussions and questions about the Crazyradio
Post Reply
GIduarte
Beginner
Posts: 13
Joined: Mon Aug 17, 2020 6:18 pm

Send pitch and roll rate setpoint with Python lib

Post by GIduarte »

Hello,

I want to send pitch rate and roll rate setpoint to crazyflie 2.1 with Python lib, but I didn't find how to do it anywhere.

How can I do this? I will need to implement or just have the functions ready?

Thank you very much in advance.
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Send pitch and roll rate setpoint with Python lib

Post by kristoffer »

The setpoint structure is a bit "special" due to historical reasons, but it should be possible to do what you are looking for with the default setpoint.

If you check out the decoding in the firmware, this is the part you want to use https://github.com/bitcraze/crazyflie-f ... #L175-L201

You need to set stabilizationModeRoll=RATE and stabilizationModePitch=RATE which can be done from the python lib by setting parameters 'flightmode.stabModeRoll' and 'flightmode.stabModePitch' to 0 (use cf.param.set_value())

You can now use the send_setpoint() method in the Commander class in the python lib to send setpoints where roll and pitch will be interpreted as rates.
Post Reply