public abstract class OpMode
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
Gamepad |
gamepad1
Gamepad 1
|
Gamepad |
gamepad2
Gamepad 2
|
HardwareMap |
hardwareMap
Hardware Mappings
|
Telemetry |
telemetry
Telemetry Data
|
double |
time
number of seconds this op mode has been running, this is
updated before every call to loop.
|
Constructor and Description |
---|
OpMode()
OpMode constructor
|
Modifier and Type | Method and Description |
---|---|
double |
getRuntime()
Get the number of seconds this op mode has been running
|
void |
init_loop()
User defined init_loop method
|
abstract void |
init()
User defined init method
|
abstract void |
loop()
User defined loop method
|
void |
resetStartTime()
Reset the start time to zero.
|
void |
start()
User defined start method.
|
void |
stop()
User defined stop method
|
public Gamepad gamepad1
public Gamepad gamepad2
public Telemetry telemetry
public HardwareMap hardwareMap
public double time
public OpMode()
The op mode name should be unique. It will be the name displayed on the driver station. If multiple op modes have the same name, only one will be available.
public abstract void init()
This method will be called once when the INIT button is pressed.
public void init_loop()
This method will be called repeatedly when the INIT button is pressed. This method is optional. By default this method takes no action.
public void start()
This method will be called once when the PLAY button is first pressed. This method is optional. By default this method takes not action. Example usage: Starting another thread.
public abstract void loop()
This method will be called repeatedly in a loop while this op mode is running
public void stop()
This method will be called when this op mode is first disabled The stop method is optional. By default this method takes no action.
public double getRuntime()
This method has sub millisecond accuracy.
public void resetStartTime()