Quote:
Originally Posted by Ether
What's the time slice? Does everything run at the same priority?
|
I was looking at the Scheduler code last night. I didn't see any threads being used for command execution. It's iteratively stepping through a structure which contains all active commands. Sequentially executing them if they aren't complete and removing them if they are.
This process is kicked off by the call to the scheduler's run() method. One pass through the list of active commands per call. That's why it's necessary to place within the respective auto and teleop periodic methods.
The downside to this approach is obviously that if any command takes a significant amount of time to execute, it will block program execution. But this has to be considered for any code written using the Iterative Robot model. Code within each command shouldn't do much more than some logical checks and updating the state of related outputs.