Send Thrust, yaw pitch roll command

Firmware/software/electronics/mechanics
Post Reply
Calvin Chua
Member
Posts: 33
Joined: Sun Mar 01, 2020 1:28 am

Send Thrust, yaw pitch roll command

Post 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?
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Send Thrust, yaw pitch roll command

Post 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.
Calvin Chua
Member
Posts: 33
Joined: Sun Mar 01, 2020 1:28 am

Re: Send Thrust, yaw pitch roll command

Post by Calvin Chua »

I see. Thanks
Calvin Chua
Member
Posts: 33
Joined: Sun Mar 01, 2020 1:28 am

Re: Send Thrust, yaw pitch roll command

Post 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.
Attachments
PD.py
(3.25 KiB) Downloaded 159 times
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Send Thrust, yaw pitch roll command

Post by tobias »

Have you tried sending hardcoded thrust commands just to check that it works as intended?
Calvin Chua
Member
Posts: 33
Joined: Sun Mar 01, 2020 1:28 am

Re: Send Thrust, yaw pitch roll command

Post 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?
mouhyemen
Beginner
Posts: 13
Joined: Sun Feb 02, 2020 5:24 pm

Re: Send Thrust, yaw pitch roll command

Post 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.
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Send Thrust, yaw pitch roll command

Post by kristoffer »

You may want to check out the https://github.com/bitcraze/crazyflie-l ... ltiramp.py example as well
Post Reply