13 #include <wpi/raw_ostream.h>
21 template <
class Robot>
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(); }
141 static std::thread::id m_threadId;
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
bool IsTest() const
Determine if the robot is currently in Test mode.
bool IsAutonomous() const
Determine if the robot is currently in Autonomous mode.
bool IsOperatorControl() const
Determine if the robot is currently in Operator Control mode.
int64_t HAL_Report(int32_t resource, int32_t instanceNumber, int32_t context, const char *feature)
Reports a hardware usage to the HAL.
bool IsEnabled() const
Determine if the Robot is currently enabled.
bool IsDisabled() const
Determine if the Robot is currently disabled.
raw_ostream & outs()
This returns a reference to a raw_ostream for standard output.
Provide access to the network communication data to / from the Driver Station.
Definition: DriverStation.h:33
bool IsNewDataAvailable() const
Indicates if new data is available from the driver station.
RobotBase()
Constructor for a generic robot program.
Implement a Robot Program framework.
Definition: RobotBase.h:53
static std::thread::id GetThreadId()
Gets the ID of the main robot thread.
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
HAL_Bool HAL_Initialize(int32_t timeout, int32_t mode)
Call this to start up HAL.