"

2013 FRC Java API

"

edu.wpi.first.wpilibj
Class IterativeRobot

java.lang.Object
  extended by javax.microedition.midlet.MIDlet
      extended by edu.wpi.first.wpilibj.RobotBase
          extended by edu.wpi.first.wpilibj.IterativeRobot

public class IterativeRobot
extends RobotBase

IterativeRobot implements a specific type of Robot Program framework, extending the RobotBase class. The IterativeRobot class is intended to be subclassed by a user creating a robot program. This class is intended to implement the "old style" default code, by providing the following functions which are called by the main loop, startCompetition(), at the appropriate times: robotInit() -- provide for initialization at robot power-on init() functions -- each of the following functions is called once when the appropriate mode is entered: - DisabledInit() -- called only when first disabled - AutonomousInit() -- called each and every time autonomous is entered from another mode - TeleopInit() -- called each and every time teleop is entered from another mode - TestInit() -- called each and every time test mode is entered from anothermode Periodic() functions -- each of these functions is called iteratively at the appropriate periodic rate (aka the "slow loop"). The period of the iterative robot is synced to the driver station control packets, giving a periodic frequency of about 50Hz (50 times per second). - disabledPeriodic() - autonomousPeriodic() - teleopPeriodic() - testPeriodoc()


Field Summary
 
Fields inherited from class edu.wpi.first.wpilibj.RobotBase
ERRORS_TO_DRIVERSTATION_PROP, FILE_NAME, m_ds, ROBOT_TASK_PRIORITY, VERSION_CONTENTS
 
Constructor Summary
IterativeRobot()
          Constructor for RobotIterativeBase The constructor initializes the instance variables for the robot to indicate the status of initialization for disabled, autonomous, and teleop code.
 
Method Summary
 void autonomousInit()
          Initialization code for autonomous mode should go here.
 void autonomousPeriodic()
          Periodic code for autonomous mode should go here.
 void disabledInit()
          Initialization code for disabled mode should go here.
 void disabledPeriodic()
          Periodic code for disabled mode should go here.
 void robotInit()
          Robot-wide initialization code should go here.
 void startCompetition()
          Provide an alternate "main loop" via startCompetition().
 void teleopInit()
          Initialization code for teleop mode should go here.
 void teleopPeriodic()
          Periodic code for teleop mode should go here.
 void testInit()
          Initialization code for test mode should go here.
 void testPeriodic()
          Periodic code for test mode should go here Users should override this method for code which will be called periodically at a regular rate while the robot is in test mode.
 
Methods inherited from class edu.wpi.first.wpilibj.RobotBase
destroyApp, free, getBooleanProperty, getWatchdog, isAutonomous, isDisabled, isEnabled, isNewDataAvailable, isOperatorControl, isReal, isSimulation, isSystemActive, isTest, pauseApp, startApp, writeVersionString
 
Methods inherited from class javax.microedition.midlet.MIDlet
getAppProperty, notifyDestroyed, notifyPaused, resumeRequest
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IterativeRobot

public IterativeRobot()
Constructor for RobotIterativeBase The constructor initializes the instance variables for the robot to indicate the status of initialization for disabled, autonomous, and teleop code.

Method Detail

startCompetition

public void startCompetition()
Provide an alternate "main loop" via startCompetition().

Specified by:
startCompetition in class RobotBase

robotInit

public void robotInit()
Robot-wide initialization code should go here. Users should override this method for default Robot-wide initialization which will be called when the robot is first powered on. It will be called exactly 1 time.


disabledInit

public void disabledInit()
Initialization code for disabled mode should go here. Users should override this method for initialization code which will be called each time the robot enters disabled mode.


autonomousInit

public void autonomousInit()
Initialization code for autonomous mode should go here. Users should override this method for initialization code which will be called each time the robot enters autonomous mode.


teleopInit

public void teleopInit()
Initialization code for teleop mode should go here. Users should override this method for initialization code which will be called each time the robot enters teleop mode.


testInit

public void testInit()
Initialization code for test mode should go here. Users should override this method for initialization code which will be called each time the robot enters test mode.


disabledPeriodic

public void disabledPeriodic()
Periodic code for disabled mode should go here. Users should override this method for code which will be called periodically at a regular rate while the robot is in disabled mode.


autonomousPeriodic

public void autonomousPeriodic()
Periodic code for autonomous mode should go here. Users should override this method for code which will be called periodically at a regular rate while the robot is in autonomous mode.


teleopPeriodic

public void teleopPeriodic()
Periodic code for teleop mode should go here. Users should override this method for code which will be called periodically at a regular rate while the robot is in teleop mode.


testPeriodic

public void testPeriodic()
Periodic code for test mode should go here Users should override this method for code which will be called periodically at a regular rate while the robot is in test mode.


"

2013 FRC Java API

"

"
For updated information see the Java FRC site
"