A question about macro "RATE_DO_EXECUTE"

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

A question about macro "RATE_DO_EXECUTE"

Post by linlin2017 » Sat Nov 04, 2017 8:35 am

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: 1582
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: A question about macro "RATE_DO_EXECUTE"

Post by tobias » 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.

linlin2017
Beginner
Posts: 15
Joined: Tue Oct 17, 2017 2:05 am

Re: A question about macro "RATE_DO_EXECUTE"

Post by linlin2017 » Tue Nov 07, 2017 1:20 pm

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.

Post Reply