I want to assign the thrust in the firmware

Discussions about all things Bitcraze
Post Reply
chengjiahao
Beginner
Posts: 19
Joined: Tue Jul 14, 2020 1:37 pm

I want to assign the thrust in the firmware

Post by chengjiahao »

Hi everyone!
I want to assign the thrust in the firmware.and I want to know if the thrust can be adjusted on the client side without the controller.
rawThrust=values->thrust;
The thrust provided by the handle in real time?

HOW can I set the thrust value whatever I want?
I set the rawThrust but the result is completely different from what I thought。

Thank you very much
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: I want to assign the thrust in the firmware

Post by kristoffer »

Hi!

Not sure if you want to do this from a PC or in the firmware:

If you want to set the thrust from the PC, you should use the pyton lib (https://github.com/bitcraze/crazyflie-lib-python).
You can take a look at the https://github.com/bitcraze/crazyflie-l ... es/ramp.py example for instance.

If you want to set the thrust directly in the firmware, you can start by looking in the stabilizer loop. There is a call to the controller (https://github.com/bitcraze/crazyflie-f ... zer.c#L282) that updates the control structure which is in turn passed on to the powerDistribution function (https://github.com/bitcraze/crazyflie-f ... zer.c#L289) that sets the power for each motor. If you want to you can add your own controller.
You can also hook in somewhere earlier in the chain where incoming CRTP packets are handled (https://github.com/bitcraze/crazyflie-f ... ommander.c)
Post Reply