Page 1 of 1

A question about macro "RATE_DO_EXECUTE"

Posted: Sat Nov 04, 2017 8:35 am
by linlin2017
Hi developers,
I am reading source code of crazeflie 2.0, and I don't understand some code. For example, why we judge the macro "RATE_DO_EXECUTE()" in function stateController() ?
Thanks! :)

Re: A question about macro "RATE_DO_EXECUTE"

Posted: Mon Nov 06, 2017 1:26 pm
by tobias
The stabilizer task runs at 1kHz but only the rate stabilization needs to run that fast. The attitude stabilization can run slower and the velocity stabilization even slower then that. So the RATE_DO_EXECUTE is just a divider of the update rate.

Re: A question about macro "RATE_DO_EXECUTE"

Posted: Tue Nov 07, 2017 1:20 pm
by linlin2017
tobias wrote:
Mon Nov 06, 2017 1:26 pm
The stabilizer task runs at 1kHz but only the rate stabilization needs to run that fast. The attitude stabilization can run slower and the velocity stabilization even slower then that. So the RATE_DO_EXECUTE is just a divider of the update rate.
In your answer, does ' the rate stabilization' mean body angular velocity stabilization? Thank you.

Re: A question about macro "RATE_DO_EXECUTE"

Posted: Tue Jan 16, 2018 1:54 pm
by arnaud
Yes, the rate stabilization is the body angle velocity stabilization.