![]() |
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() { Code:
public void autonomousPeriodic() {Anyways, what do you use and why do you use it? |
Re: Which Base Class Are You Using?
Regarding SampleRobot, we specifically renamed SimpleRobot to SampleRobot and put disclaimers in about it because many teams saw the word "Simple" and went with that template. However, there's a lot more to embedded programming than just running in a tight loop as most people do with SimpleRobot, and the number of issues CSAs saw at competitions because of this was very high.
I personally am a fan of the CommandBased model. It takes care of synchronization between commands, sequencing of commands, cancelling commands based on the requires() blocks, and such. There are certainly use cases for Iterative, but for the vast majority of teams, CommandBased should help eliminate a lot of issues that we see both as library maintainers and CSAs. |
Re: Which Base Class Are You Using?
We use command-based, in java. If all we had were Sample, we'd probably try to write an event based model ourselves in the off-season, because it makes classes more easily separable and handles coordination among the subsystems. On the other hand, it is the most flexible of the really event-based models.
|
| All times are GMT -5. The time now is 10:37. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi