crazyflie task priorities

Firmware/software/electronics/mechanics
Post Reply
wenlong
Beginner
Posts: 7
Joined: Tue Sep 20, 2016 10:15 am

crazyflie task priorities

Post by wenlong »

In the file config.h, task priorities were set. but some tasks had the same priority such as STABILIZER_TASK_PRI was 4 and so the SENSORS_TASK_PRI, why did not set different priority, for example, the STABILIZER_TASK_PRI was 5 and SENSORS_TASK_PRI was 4?
Thanks
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: crazyflie task priorities

Post by arnaud »

FreeRTOS allows us to have multiple tasks set with the same priority, in that case the tasks will be scheduled in round-robin.

Stabilizer and sensor tasks share the highest priority but there is no preference as of which one is more critical: each must be served regularity in order to fly, this is why they ended-up on the same priority level.

As a side note: adding priority level in FreeRTOS adds a bit of RAM consumption so it it was good for Crazyflie 1.0 to limit the number of priority level.
wenlong
Beginner
Posts: 7
Joined: Tue Sep 20, 2016 10:15 am

Re: crazyflie task priorities

Post by wenlong »

Thanks arnaud for your such clear answer!
Post Reply