stepan
12-01-2015, 00:14
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:
public void autonomous() {
while (isAutonomous() && isEnable()) {
//Put code here
Timer.delay(0.05);
}
}
IterativeRobot base class:
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?
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:
public void autonomous() {
while (isAutonomous() && isEnable()) {
//Put code here
Timer.delay(0.05);
}
}
IterativeRobot base class:
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?