A question about macro "RATE_DO_EXECUTE"

Firmware/software/electronics
Post Reply
linlin2017
Beginner
Posts: 16
Joined: Tue Oct 17, 2017 2:05 am

A question about macro "RATE_DO_EXECUTE"

Post 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! :)
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: A question about macro "RATE_DO_EXECUTE"

Post 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.
linlin2017
Beginner
Posts: 16
Joined: Tue Oct 17, 2017 2:05 am

Re: A question about macro "RATE_DO_EXECUTE"

Post 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.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: A question about macro "RATE_DO_EXECUTE"

Post by arnaud »

Yes, the rate stabilization is the body angle velocity stabilization.
Post Reply