Page 1 of 1

Yaw Angle Control in Python Cflib

Posted: Thu Sep 02, 2021 4:08 pm
by GriffinBonner
I understand how to define a SetHoverSetpoint function and send to the commander with commanderSetSetpoint in firmware to achieve a yaw angle instead of a yaw rate, but I am not sure how to do this using the python library. I am trying to change the yaw angle of the crazyflie based on the output of a neural network running on the host pc, but I do not know the equivalent command in the python library or how to modify the modes of a setpoint:

Code: Select all

setpoint->attitude.yaw = yaw;
Is this possible? or do I need to write my own control implementation in python using the yaw rate?

Thanks in advance,
Griffin

Re: Yaw Angle Control in Python Cflib

Posted: Tue Sep 07, 2021 7:37 am
by jonasdn
Hi!

The short answer: yes, you need to write your own!

You can look, in the firmware code in crtp_commander_generic.c: https://github.com/bitcraze/crazyflie-f ... eric.c#L39

On how to define a new packet type, and then you need to add the corresponding "send_setpoint" function to the python code!

Good luck!
Jonas