public abstract class RobotBase extends Object implements AutoCloseable
Modifier and Type | Field and Description |
---|---|
protected DriverStation |
m_ds |
static long |
MAIN_THREAD_ID
The ID of the main Java thread.
|
Modifier | Constructor and Description |
---|---|
protected |
RobotBase()
Constructor for a generic robot program.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
free()
Deprecated.
|
static boolean |
getBooleanProperty(String name,
boolean defaultValue) |
boolean |
isAutonomous()
Determine if the robot is currently in Autonomous mode as determined by the field
controls.
|
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 as determined by the field
controls.
|
static boolean |
isReal()
Get if the robot is real.
|
static boolean |
isSimulation()
Get if the robot is a simulation.
|
boolean |
isTest()
Determine if the robot is currently in Test mode as determined by the driver
station.
|
abstract void |
startCompetition()
Provide an alternate "main loop" via startCompetition().
|
static <T extends RobotBase> |
startRobot(Supplier<T> robotSupplier)
Starting point for the applications.
|
public static final long MAIN_THREAD_ID
protected final DriverStation m_ds
protected RobotBase()
This must be used to ensure that the communications code starts. In the future it would be nice to put this code into it's own task that loads on boot so ensure that it runs.
@Deprecated public void free()
public void close()
close
in interface AutoCloseable
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(String name, boolean defaultValue)