Page 1 of 1

Send pitch and roll rate setpoint with Python lib

Posted: Thu Dec 10, 2020 8:57 pm
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.

Re: Send pitch and roll rate setpoint with Python lib

Posted: Fri Dec 11, 2020 10:10 am
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.