View Single Post
  #12   Spotlight this post!  
Unread 28-11-2012, 11:29
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 431
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Command Based JAVA - Basic Tutorial

Quote:
Originally Posted by Ether View Post
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.
__________________
http://team2168.org

Last edited by otherguy : 28-11-2012 at 11:31.