View Single Post
  #1   Spotlight this post!  
Unread 12-01-2015, 00:14
stepan's Avatar
stepan stepan is offline
Programming Captain
AKA: Stepan Subbotin
FRC #4536 (MinuteBots)
Team Role: Programmer
 
Join Date: Dec 2014
Rookie Year: 2012
Location: St. Paul, MN
Posts: 13
stepan is an unknown quantity at this point
Which Base Class Are You Using?

I'm curious about what Java base class other teams are using. During the fall, while re-programming the robot in Java, we used the SimpleRobot base class (now called SampleRobot). I've seen some people post code that uses the IterativeClass.

The main difference is that the IterativeClass automatically loops the autonomous and teleop methods. In the the SampleRobot class the autonomous and teleop methods are only called once, so you have to loop them yourself using a while loop and the timer class.

SampleRobot base class:

Code:
public void autonomous() {    
        while (isAutonomous() && isEnable()) {
            //Put code here
            Timer.delay(0.05);
        }
}
IterativeRobot base class:

Code:
public void autonomousPeriodic() {
        //Put code here
}
I believe a lot teams also use command-based programming.

Anyways, what do you use and why do you use it?
Reply With Quote