Page 1 of 1

Acceleration Setpoint Crazyflie Python Lib

Posted: Tue Feb 09, 2021 9:33 am
by Nickle225
Hi All,

I am going to be using the Crazyflie python library for a project. I am wondering if it is possible to send the quad-copter x,y,z acceleration set-points. I know this is possible for position and velocity, but I cannot find any documentation on acceleration.

For clarity, we will be using the loco positioning system for localization.

Please let me know if this is possible, and which functions I should be using to achieve it. If there is no in-built function, could you please point me in the right direction in terms of how to implement it myself.

Thanks for your help,
Nicholas

Re: Acceleration Setpoint Crazyflie Python Lib

Posted: Tue Feb 09, 2021 10:15 am
by arnaud
Hi,

There is no commander packet implemented yet to control only the acceleration. Though, the commander subsystem is quite flexible so it should not be too hard to add.

The commander packets are declared there in the firmware: https://github.com/bitcraze/crazyflie-f ... eric.c#L39 and an equivalent function for each packets is present in the lib: https://github.com/bitcraze/crazyflie-l ... der.py#L83

Re: Acceleration Setpoint Crazyflie Python Lib

Posted: Thu Apr 29, 2021 6:01 am
by Nickle225
Hi,

I have started looking into this. It seems to me that based on the documentation, there is no built-in controller that can handle acceleration set-points (see image below). If I simply add a packet that sends acceleration values to the commander, will it actually handle the values?

Thanks for your help!

Image

Re: Acceleration Setpoint Crazyflie Python Lib

Posted: Fri Apr 30, 2021 8:21 am
by arnaud
Hum, yes you are right for the PID controller, sorry I did not pick that up in my first answer.

When using the PID controller, the only idea I can have is to control the acceleration with roll and pitch: assuming you are hovering, the acceleration should be the gravity * sin(roll/pitch).

When using the more advance Mellinger controller you can send this full-state setpoint that does contain the acceleration: https://github.com/bitcraze/crazyflie-f ... #L299-L313. As far as I understand though, you will need to send the full state. But unfortunatly the mellinger controller can be quite flip-happy when used in an LPS system (it is tuned very tight).