![]() |
WPILibC++ 2027.0.0-alpha-5
|
Top-level interface for opmode classes. More...
#include <wpi/opmode/OpMode.hpp>
Public Member Functions | |
| virtual | ~OpMode ()=default |
| The object is destroyed when the opmode is no longer selected on the DS or after an enabled run ends. | |
| virtual void | DisabledPeriodic () |
| This function is called periodically while the opmode is selected on the DS (robot is disabled). | |
| virtual void | Start () |
| Called once when this opmode transitions to enabled. | |
| virtual void | Periodic () |
| This function is called periodically while the opmode is enabled. | |
| virtual void | End () |
| This function is called when the robot disables or switches opmodes while this opmode is enabled. | |
| virtual std::vector< wpi::internal::PeriodicPriorityQueue::Callback > | GetCallbacks () |
| Returns a vector of custom periodic callbacks to be executed while the opmode is enabled. | |
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:
|
virtualdefault |
The object is destroyed when the opmode is no longer selected on the DS or after an enabled run ends.
The object will not be reused after the destructor is called.
|
inlinevirtual |
This function is called periodically while the opmode is selected on the DS (robot is disabled).
Code that should only run once when the opmode is selected should go in the opmode constructor.
Reimplemented in wpi::PeriodicOpMode.
|
inlinevirtual |
This function is called when the robot disables or switches opmodes while this opmode is enabled.
Implementations should stop blocking work promptly.
Reimplemented in wpi::PeriodicOpMode.
|
inlinevirtual |
Returns a vector 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.
Reimplemented in wpi::PeriodicOpMode.
|
inlinevirtual |
This function is called periodically while the opmode is enabled.
Reimplemented in wpi::PeriodicOpMode.
|
inlinevirtual |
Called once when this opmode transitions to enabled.
Reimplemented in wpi::PeriodicOpMode.