|
2010 FRC Java API |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.microedition.midlet.MIDlet
edu.wpi.first.wpilibj.RobotBase
edu.wpi.first.wpilibj.IterativeRobot
public class IterativeRobot
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 Periodic() functions -- each of these functions is called iteratively at the appropriate periodic rate (aka the "slow loop"). The default period of the iterative robot is 10,000 microseconds, giving a periodic frequency of 100Hz (100 times per second). - disabledPeriodic() - autonomousPeriodic() - teleopPeriodic() Continuous() functions -- each of these functions is called repeatedly as fast as possible: - disabledContinuous() - autonomousContinuous() - teleopContinuous()
Field Summary | |
---|---|
static double |
kDefaultPeriod
The default period for the periodic function calls |
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 |
autonomousContinuous()
Continuous code for autonomous mode should go here. |
void |
autonomousInit()
Initialization code for autonomous mode should go here. |
void |
autonomousPeriodic()
Periodic code for autonomous mode should go here. |
void |
disabledContinuous()
Continuous code for disabled mode should go here. |
void |
disabledInit()
Initialization code for disabled mode should go here. |
void |
disabledPeriodic()
Periodic code for disabled mode should go here. |
double |
getLoopsPerSec()
Get the number of loops per second for the IterativeRobot Get the number of loops per second for the IterativeRobot. |
void |
robotInit()
Robot-wide initialization code should go here. |
void |
setPeriod(double period)
Set the period for the periodic functions. |
void |
startCompetition()
Provide an alternate "main loop" via startCompetition(). |
void |
teleopContinuous()
Continuous code for teleop mode should go here. |
void |
teleopInit()
Initialization code for teleop mode should go here. |
void |
teleopPeriodic()
Periodic code for teleop mode should go here. |
Methods inherited from class edu.wpi.first.wpilibj.RobotBase |
---|
destroyApp, free, getWatchdog, isAutonomous, isDisabled, isEnabled, isNewDataAvailable, isOperatorControl, isSystemActive, pauseApp, startApp |
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 |
Field Detail |
---|
public static final double kDefaultPeriod
Constructor Detail |
---|
public IterativeRobot()
Method Detail |
---|
public void setPeriod(double period)
period
- The new period in seconds.public void startCompetition()
startCompetition
in class RobotBase
public void robotInit()
public void disabledInit()
public void autonomousInit()
public void teleopInit()
public void disabledPeriodic()
public void autonomousPeriodic()
public void teleopPeriodic()
public void disabledContinuous()
public void autonomousContinuous()
public void teleopContinuous()
public double getLoopsPerSec()
|
2010 FRC Java API |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |