|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectMIDlet
edu.wpi.first.wpilibj.RobotBase
public abstract class RobotBase
Implement a Robot Program framework. The RobotBase class is intended to be subclassed by a user creating a robot program. Overridden autonomous() and operatorControl() methods are called at the appropriate time as the match proceeds. In the current implementation, the Autonomous code will run to completion before the OperatorControl code could start. In the future the Autonomous code might be spawned as a task, then killed at the end of the Autonomous period.
Field Summary | |
---|---|
static java.lang.String |
ERRORS_TO_DRIVERSTATION_PROP
Boolean System property. |
protected static java.lang.String |
FILE_NAME
name and contents of the version file that is read by the DS to determine the library version |
protected DriverStation |
m_ds
|
static int |
ROBOT_TASK_PRIORITY
The VxWorks priority that robot code should work at (so Java code should run at) |
protected static java.lang.String |
VERSION_CONTENTS
|
Constructor Summary | |
---|---|
protected |
RobotBase()
Constructor for a generic robot program. |
Method Summary | |
---|---|
protected void |
destroyApp(boolean unconditional)
Called if the MIDlet is terminated by the system. |
void |
free()
Free the resources for a RobotBase class. |
static boolean |
getBooleanProperty(java.lang.String name,
boolean defaultValue)
|
Watchdog |
getWatchdog()
Return the instance of the Watchdog timer. |
boolean |
isAutonomous()
Determine if the robot is currently in Autonomous mode. |
boolean |
isDisabled()
Determine if the Robot is currently disabled. |
boolean |
isEnabled()
Determine if the Robot is currently enabled. |
boolean |
isNewDataAvailable()
Indicates if new data is available from the driver station. |
boolean |
isOperatorControl()
Determine if the robot is currently in Operator Control mode. |
static boolean |
isReal()
|
static boolean |
isSimulation()
|
boolean |
isSystemActive()
Check on the overall status of the system. |
boolean |
isTest()
Determine if the robot is currently in Test mode |
protected void |
pauseApp()
Pauses the application |
protected void |
startApp()
Starting point for the applications. |
abstract void |
startCompetition()
Provide an alternate "main loop" via startCompetition(). |
protected void |
writeVersionString()
Write the version string to the root directory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ROBOT_TASK_PRIORITY
public static final java.lang.String ERRORS_TO_DRIVERSTATION_PROP
protected static final java.lang.String FILE_NAME
protected static final java.lang.String VERSION_CONTENTS
protected final DriverStation m_ds
Constructor Detail |
---|
protected RobotBase()
Method Detail |
---|
public void free()
public boolean isSystemActive()
public Watchdog getWatchdog()
public static boolean isSimulation()
public static boolean isReal()
public boolean isDisabled()
public boolean isEnabled()
public boolean isAutonomous()
public boolean isTest()
public boolean isOperatorControl()
public boolean isNewDataAvailable()
public abstract void startCompetition()
public static boolean getBooleanProperty(java.lang.String name, boolean defaultValue)
protected void writeVersionString()
protected final void startApp() throws MIDletStateChangeException
javax.microedition.midlet.MIDletStateChangeException
MIDletStateChangeException
protected final void pauseApp()
protected final void destroyApp(boolean unconditional) throws MIDletStateChangeException
unconditional
- If true when this method is called, the MIDlet must
cleanup and release all resources. If false the MIDlet may throw
MIDletStateChangeException to indicate it does not want to be destroyed
at this time.
MIDletStateChangeException
- if there is an exception in
terminating the midlet
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |