Yaw Angle Control in Python Cflib

Discussions and questions about the Crazyflie Nano Quadcopter
Post Reply
GriffinBonner
Beginner
Posts: 20
Joined: Thu Oct 08, 2020 2:45 pm

Yaw Angle Control in Python Cflib

Post 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
jonasdn
Expert
Posts: 132
Joined: Mon Mar 01, 2021 3:13 pm

Re: Yaw Angle Control in Python Cflib

Post 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
Post Reply