13 #include <wpi/raw_ostream.h> 21 template <
class Robot>
23 if (!HAL_Initialize(500, 0)) {
24 wpi::errs() <<
"FATAL ERROR: HAL could not be initialized\n";
27 HAL_Report(HALUsageReporting::kResourceType_Language,
28 HALUsageReporting::kLanguage_CPlusPlus);
29 wpi::outs() <<
"\n********** Robot program starting **********\n";
31 robot.StartCompetition();
36 #define START_ROBOT_CLASS(_ClassName_) \ 37 WPI_DEPRECATED("Call frc::StartRobot<" #_ClassName_ \ 38 ">() in your own main() instead of using the " \ 39 "START_ROBOT_CLASS(" #_ClassName_ ") macro.") \ 40 int StartRobotClassImpl() { return frc::StartRobot<_ClassName_>(); } \ 41 int main() { return StartRobotClassImpl(); } 106 virtual void StartCompetition() = 0;
108 static constexpr
bool IsReal() {
109 #ifdef __FRC_ROBORIO__ 116 static constexpr
bool IsSimulation() {
return !IsReal(); }
139 static std::thread::id m_threadId;
bool IsEnabled() const
Determine if the Robot is currently enabled.
Definition: RobotBase.cpp:61
Definition: Utility.cpp:119
bool IsAutonomous() const
Determine if the robot is currently in Autonomous mode.
Definition: RobotBase.cpp:65
bool IsDisabled() const
Determine if the Robot is currently disabled.
Definition: RobotBase.cpp:63
static std::thread::id GetThreadId()
Gets the ID of the main robot thread.
Definition: RobotBase.cpp:73
Provide access to the network communication data to / from the Driver Station.
Definition: DriverStation.h:34
bool IsNewDataAvailable() const
Indicates if new data is available from the driver station.
Definition: RobotBase.cpp:71
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Definition: raw_ostream.cpp:685
bool IsOperatorControl() const
Determine if the robot is currently in Operator Control mode.
Definition: RobotBase.cpp:67
raw_ostream & outs()
This returns a reference to a raw_ostream for standard output.
Definition: raw_ostream.cpp:675
Implement a Robot Program framework.
Definition: RobotBase.h:53
bool IsTest() const
Determine if the robot is currently in Test mode.
Definition: RobotBase.cpp:69
RobotBase()
Constructor for a generic robot program.
Definition: RobotBase.cpp:75