-
Notifications
You must be signed in to change notification settings - Fork 6
Getting Started
ATALibJ programs start at GamePeriods. The only code inside of GamePeriods that the programmer should write is the modes array. Simply put one instance of every RobotMode inside of the array. At least one RobotMode is needed for the code to run.
Small note: The wpilibj currently (as of May 30, 2013) contains a bug that makes the SmartDashboard not display the robot selector. If you want control over your robot, you will need to write your own selection process and implement it in GamePeriods.
There are 6 options for robot modes.
The base interface of all other robot modes. You should use this interface if you will take advantage of every method inside of it. It contains Iterative style methods.
An exception-safe executor of robot modes. You can't extend this class, and it every mode is wrapped in it by default in GamePeriods. There isn't many cases where you would want to use this mode.
The base of an iterative-style robot. Contains init, periodic and end methods for every mode. The init method is called once before starting the mode, the periodic method is called in a periodic loop every 20ms during the mode and the end method is called once at the very end of the mode.
An adapter class that lets you choose which methods you need and implement them in your robot mode. If you are not using every method in IterativeRobot, you should be using this class.
The base of a simple-style robot. Contains one method per mode, and executes it once when the mode starts. Every method should loop until the mode is over, doing whatever is necessary in that mode.
An adapter class that lets you choose which methods you need and implement them in your robot mode. If you are not using every method in SimpleRobot, you should be using this class.