|
RobotCore 1.0
WPILib port to raspberry Pi
|
Public Member Functions | |
| default void | disabledPeriodic () |
| default void | start () |
| default void | periodic () |
| default void | end () |
| default void | close () |
| default Set< PeriodicPriorityQueue.Callback > | getCallbacks () |
Top-level interface for opmode classes. Users should generally extend one of the abstract implementations of this interface (e.g. PeriodicOpMode) rather than directly implementing this interface.
Lifecycle:
OpModeRobot#getPeriod, and additional periodic callbacks added via addPeriodic() are called periodically on their set time intervals All lifecycle callbacks and periodic callbacks run synchronously on the same thread that invokes them. Interactions between opmodes and the robot framework do not require additional synchronization.
Additional callbacks can be registered by implementing getCallbacks() to return a set of PeriodicPriorityQueue.Callback objects with custom timing. PeriodicOpMode provides a convenient implementation of this method and utility methods for adding periodic callbacks.
Definition at line 42 of file OpMode.java.
| default void org.wpilib.opmode.OpMode.close | ( | ) |
This function is called when the opmode is no longer selected on the DS or after an enabled run ends. The object will not be reused after this is called.
Definition at line 69 of file OpMode.java.
| default void org.wpilib.opmode.OpMode.disabledPeriodic | ( | ) |
This function is called periodically while the opmode is selected and the robot is disabled. Code that should only run once when the opmode is selected should go in the opmode constructor.
Definition at line 47 of file OpMode.java.
| default void org.wpilib.opmode.OpMode.end | ( | ) |
This function is called asynchronously when the robot disables or switches opmodes while this opmode is enabled. Implementations should stop blocking work promptly.
Definition at line 62 of file OpMode.java.
| default Set< PeriodicPriorityQueue.Callback > org.wpilib.opmode.OpMode.getCallbacks | ( | ) |
Returns a set of custom periodic callbacks to be executed while the opmode is enabled.
This method allows opmodes to register arbitrary periodic callbacks with custom execution intervals. The callbacks are executed by the robot framework at their scheduled times, in addition to the primary periodic() callback.
Registration timing: The callbacks returned by this method are registered with the framework immediately when the OpMode is constructed and begin executing as soon as they are registered. To restrict execution to only when the robot is enabled, callbacks should include an if (RobotState.isEnabled()) check at the beginning.
Implemented in org.wpilib.opmode.PeriodicOpMode.
Definition at line 86 of file OpMode.java.
| default void org.wpilib.opmode.OpMode.periodic | ( | ) |
This function is called periodically while the opmode is enabled at the rate returned by OpModeRobot#getPeriod().
Definition at line 56 of file OpMode.java.
| default void org.wpilib.opmode.OpMode.start | ( | ) |
Called once when this opmode transitions to enabled.
Definition at line 50 of file OpMode.java.