org.team751.framework
Class FrameworkRobot
java.lang.Object
javax.microedition.midlet.MIDlet
edu.wpi.first.wpilibj.RobotBase
edu.wpi.first.wpilibj.IterativeRobot
org.team751.framework.FrameworkRobot
public class FrameworkRobot
- extends edu.wpi.first.wpilibj.IterativeRobot
Robot class for the threaded robot framework
Robot classes should extend this class to use the framework.
There's one important different to keep in mind when using this framework:
When overriding disabledInit(), autonomousInit(), or teleoperatedInit(), you must
explicitly call the function's superclass implementation (super.disabledInit(),
super.autonomousInit(), or super.teleoperatedInit() respectively). Not doing this
will prevent any tasks other than the main thread from responding to enable/disable
events and teleop/autonomous state changes.
- Author:
- Sam Crow
Fields inherited from class edu.wpi.first.wpilibj.RobotBase |
ERRORS_TO_DRIVERSTATION_PROP, m_ds, ROBOT_TASK_PRIORITY |
Methods inherited from class edu.wpi.first.wpilibj.IterativeRobot |
autonomousContinuous, autonomousPeriodic, disabledContinuous, disabledPeriodic, robotInit, startCompetition, teleopContinuous, teleopPeriodic |
Methods inherited from class edu.wpi.first.wpilibj.RobotBase |
destroyApp, free, getBooleanProperty, 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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
state
private CompetitionState state
tasks
private java.util.Vector tasks
FrameworkRobot
public FrameworkRobot()
addTask
protected void addTask(RobotTask task)
- Add a new task. The task will immediately be given the current state and started.
- Parameters:
task
- The task to add
disabledInit
public void disabledInit()
- Overrides:
disabledInit
in class edu.wpi.first.wpilibj.IterativeRobot
autonomousInit
public void autonomousInit()
- Overrides:
autonomousInit
in class edu.wpi.first.wpilibj.IterativeRobot
teleopInit
public void teleopInit()
- Overrides:
teleopInit
in class edu.wpi.first.wpilibj.IterativeRobot
updateStates
private void updateStates()
- Update every thread with the current competition state