WPILibC++
2019.1.1-beta-2-23-g90572a3
|
TimedRobot implements the IterativeRobotBase robot program framework. More...
#include <TimedRobot.h>
Public Member Functions | |
void | StartCompetition () override |
Provide an alternate "main loop" via StartCompetition(). | |
double | GetPeriod () const |
Get the time period between calls to Periodic() functions. | |
TimedRobot (double period=kDefaultPeriod) | |
Constructor for TimedRobot. More... | |
TimedRobot (TimedRobot &&rhs) | |
TimedRobot & | operator= (TimedRobot &&rhs) |
![]() | |
virtual void | RobotInit () |
Robot-wide initialization code should go here. More... | |
virtual void | DisabledInit () |
Initialization code for disabled mode should go here. More... | |
virtual void | AutonomousInit () |
Initialization code for autonomous mode should go here. More... | |
virtual void | TeleopInit () |
Initialization code for teleop mode should go here. More... | |
virtual void | TestInit () |
Initialization code for test mode should go here. More... | |
virtual void | RobotPeriodic () |
Periodic code for all modes should go here. More... | |
virtual void | DisabledPeriodic () |
Periodic code for disabled mode should go here. More... | |
virtual void | AutonomousPeriodic () |
Periodic code for autonomous mode should go here. More... | |
virtual void | TeleopPeriodic () |
Periodic code for teleop mode should go here. More... | |
virtual void | TestPeriodic () |
Periodic code for test mode should go here. More... | |
![]() | |
bool | IsEnabled () const |
Determine if the Robot is currently enabled. More... | |
bool | IsDisabled () const |
Determine if the Robot is currently disabled. More... | |
bool | IsAutonomous () const |
Determine if the robot is currently in Autonomous mode. More... | |
bool | IsOperatorControl () const |
Determine if the robot is currently in Operator Control mode. More... | |
bool | IsTest () const |
Determine if the robot is currently in Test mode. More... | |
bool | IsNewDataAvailable () const |
Indicates if new data is available from the driver station. More... | |
![]() | |
ErrorBase (ErrorBase &&)=default | |
ErrorBase & | operator= (ErrorBase &&)=default |
virtual Error & | GetError () |
Retrieve the current error. More... | |
virtual const Error & | GetError () const |
Retrieve the current error. More... | |
virtual void | ClearError () const |
Clear the current error information associated with this sensor. | |
virtual void | SetErrnoError (const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) const |
Set error information associated with a C library call that set an error to the "errno" global variable. More... | |
virtual void | SetImaqError (int success, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) const |
Set the current error information associated from the nivision Imaq API. More... | |
virtual void | SetError (Error::Code code, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) const |
Set the current error information associated with this sensor. More... | |
virtual void | SetErrorRange (Error::Code code, int32_t minRange, int32_t maxRange, int32_t requestedValue, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) const |
Set the current error information associated with this sensor. More... | |
virtual void | SetWPIError (const wpi::Twine &errorMessage, Error::Code code, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) const |
Set the current error information associated with this sensor. More... | |
virtual void | CloneError (const ErrorBase &rhs) const |
virtual bool | StatusIsFatal () const |
Check if the current error code represents a fatal error. More... | |
Static Public Attributes | |
static constexpr double | kDefaultPeriod = 0.02 |
Additional Inherited Members | |
![]() | |
static std::thread::id | GetThreadId () |
Gets the ID of the main robot thread. | |
static constexpr bool | IsReal () |
static constexpr bool | IsSimulation () |
![]() | |
static void | SetGlobalError (Error::Code code, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) |
static void | SetGlobalWPIError (const wpi::Twine &errorMessage, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) |
static const Error & | GetGlobalError () |
Retrieve the current global error. | |
![]() | |
IterativeRobotBase (double period) | |
Constructor for IterativeRobotBase. More... | |
IterativeRobotBase (IterativeRobotBase &&)=default | |
IterativeRobotBase & | operator= (IterativeRobotBase &&)=default |
void | LoopFunc () |
![]() | |
RobotBase () | |
Constructor for a generic robot program. More... | |
RobotBase (RobotBase &&) | |
RobotBase & | operator= (RobotBase &&) |
![]() | |
double | m_period |
![]() | |
DriverStation & | m_ds |
![]() | |
Error | m_error |
![]() | |
static std::thread::id | m_threadId |
TimedRobot implements the IterativeRobotBase robot program framework.
The TimedRobot class is intended to be subclassed by a user creating a robot program.
Periodic() functions from the base class are called on an interval by a Notifier instance.
|
explicit |
Constructor for TimedRobot.
period | Period in seconds. |