Package edu.wpi.first.wpilibj
Class RobotBase
java.lang.Object
edu.wpi.first.wpilibj.RobotBase
- Direct Known Subclasses:
IterativeRobotBase
public abstract class RobotBase
extends java.lang.Object
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
Fields Modifier and Type Field Description static long
MAIN_THREAD_ID
The ID of the main Java thread. -
Method Summary
Modifier and Type Method Description void
free()
Deprecated.static boolean
getBooleanProperty(java.lang.String name, boolean defaultValue)
boolean
isDisabled()
Determine if the Robot is currently disabled.boolean
isEnabled()
Determine if the Robot is currently enabled.abstract void
startCompetition()
Provide an alternate "main loop" via startCompetition().static <T extends RobotBase>
voidstartRobot(java.util.function.Supplier<T> robotSupplier)
Starting point for the applications.
-
Field Details
-
MAIN_THREAD_ID
public static final long MAIN_THREAD_IDThe ID of the main Java thread.
-
-
Method Details
-
free
@Deprecated public void free()Deprecated. -
isDisabled
public boolean isDisabled()Determine if the Robot is currently disabled.- Returns:
- True if the Robot is currently disabled by the field controls.
-
isEnabled
public boolean isEnabled()Determine if the Robot is currently enabled.- Returns:
- True if the Robot is currently enabled by the field controls.
-
startCompetition
public abstract void startCompetition() throws java.lang.ExceptionProvide an alternate "main loop" via startCompetition().- Throws:
java.lang.Exception
-
getBooleanProperty
public static boolean getBooleanProperty(java.lang.String name, boolean defaultValue) -
startRobot
Starting point for the applications.
-