View Single Post
  #4   Spotlight this post!  
Unread 28-04-2013, 22:13
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 543
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Iterative Project

Quote:
Originally Posted by Peragore View Post
Yes.

The standard usage of Simple Robot is something like this:

Code:
public OperatorControl(){
   while (isOperatorControl() and isEnabled()){
    try {
         Thread.sleep(10L);
    } catch (Exception e){
       e.printStackTrace();
    }
   //insert code here, to be called every time through the while loop
   }
}
IterativeRobot should be used because of its usage data reporting and management. Using SimpleRobot for anything else than custom robot structures really shouldn't be used. Using thread sleeps shouldn't really be needed because IterativeRobot waits for new data from the robot which is the only time data should really need to be processed.

I'd also recommend looking into Command-based, it may look hard at first but once you get the hang of it its so much neater and easier to write.
Reply With Quote