Page 1 of 1

Send Thrust, yaw pitch roll command

Posted: Tue Sep 01, 2020 12:41 pm
by Calvin Chua
Hi team, is it possible to send the command in terms of thrust, yaw, pitch and roll to crazyflie instead of the setposition/ set velocity function in motion commander file?

Re: Send Thrust, yaw pitch roll command

Posted: Tue Sep 01, 2020 2:02 pm
by kimberly
The motion commander is a wrapper around the commander class in the python library and currently it does not support pitch roll and yaw commands. However, step one level down and you can try to access the commander class yourselves to do this instead (examples/autonomousSequence.py is a good example). There you can replace the

Code: Select all

cf.commander.send_position_setpoint(X, Y,  Z,  yaw)
with

Code: Select all

cf.commander.send_setpoint(roll, pitch, yaw, thrust)
If you fly the crazyflie in attitude mode from the cfclient, this is the function the cfclient uses.

Re: Send Thrust, yaw pitch roll command

Posted: Tue Sep 01, 2020 2:05 pm
by Calvin Chua
I see. Thanks

Re: Send Thrust, yaw pitch roll command

Posted: Wed Sep 02, 2020 12:00 pm
by Calvin Chua
Hi kimberley,

Is the send_setpoint function output the thrust inserted? When I run it, the rotor barely rotate. Will appreciate if you can share with me what I have done wrongly in my code.

Re: Send Thrust, yaw pitch roll command

Posted: Thu Sep 03, 2020 2:56 pm
by tobias
Have you tried sending hardcoded thrust commands just to check that it works as intended?

Re: Send Thrust, yaw pitch roll command

Posted: Sun Sep 06, 2020 7:15 am
by Calvin Chua
Hi, I tried but when I input 65535 as the thrust, the rotor barely turns. Besides, what is the conversion between force in Newton with the 16 bits number please?

Re: Send Thrust, yaw pitch roll command

Posted: Sun Sep 06, 2020 4:53 pm
by mouhyemen
I believe this is what you are looking for.

Here is the conversion between thrust values to acceleration m/s^2,

https://github.com/bitcraze/crazyflie-f ... man.c#L184

You can then divide by the mass in kilograms to get it in Newtons.

Re: Send Thrust, yaw pitch roll command

Posted: Wed Sep 09, 2020 1:27 pm
by kristoffer
You may want to check out the https://github.com/bitcraze/crazyflie-l ... ltiramp.py example as well