Send Thrust, yaw pitch roll command
-
- Member
- Posts: 33
- Joined: Sun Mar 01, 2020 1:28 am
Send Thrust, yaw pitch roll command
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
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
with
If you fly the crazyflie in attitude mode from the cfclient, this is the function the cfclient uses.
Code: Select all
cf.commander.send_position_setpoint(X, Y, Z, yaw)
Code: Select all
cf.commander.send_setpoint(roll, pitch, yaw, thrust)
-
- Member
- Posts: 33
- Joined: Sun Mar 01, 2020 1:28 am
Re: Send Thrust, yaw pitch roll command
I see. Thanks
-
- Member
- Posts: 33
- Joined: Sun Mar 01, 2020 1:28 am
Re: Send Thrust, yaw pitch roll command
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.
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
Re: Send Thrust, yaw pitch roll command
Have you tried sending hardcoded thrust commands just to check that it works as intended?
-
- Member
- Posts: 33
- Joined: Sun Mar 01, 2020 1:28 am
Re: Send Thrust, yaw pitch roll command
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
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.
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.
-
- Bitcraze
- Posts: 630
- Joined: Tue Jun 30, 2015 7:47 am
Re: Send Thrust, yaw pitch roll command
You may want to check out the https://github.com/bitcraze/crazyflie-l ... ltiramp.py example as well