WPILibC++  unspecified
frc::SampleRobot Class Reference
Inheritance diagram for frc::SampleRobot:
Collaboration diagram for frc::SampleRobot:

Public Member Functions

void StartCompetition () override
 Start a competition. More...
 
virtual void RobotInit ()
 Robot-wide initialization code should go here. More...
 
virtual void Disabled ()
 Disabled should go here. More...
 
virtual void Autonomous ()
 Autonomous should go here. More...
 
virtual void OperatorControl ()
 Operator control (tele-operated) code should go here. More...
 
virtual void Test ()
 Test program should go here. More...
 
virtual void RobotMain ()
 Robot main program for free-form programs. More...
 
- Public Member Functions inherited from frc::RobotBase
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...
 

Additional Inherited Members

- Static Public Member Functions inherited from frc::RobotBase
static std::thread::id GetThreadId ()
 Gets the ID of the main robot thread.
 
- Protected Member Functions inherited from frc::RobotBase
 RobotBase ()
 Constructor for a generic robot program. More...
 
 RobotBase (const RobotBase &)=delete
 
RobotBaseoperator= (const RobotBase &)=delete
 
- Protected Attributes inherited from frc::RobotBase
DriverStationm_ds
 
- Static Protected Attributes inherited from frc::RobotBase
static std::thread::id m_threadId
 

Member Function Documentation

void SampleRobot::Autonomous ( )
virtual

Autonomous should go here.

Programmers should override this method to run code that should run while the field is in the autonomous period. This will be called once each time the robot enters the autonomous state.

void SampleRobot::Disabled ( )
virtual

Disabled should go here.

Programmers should override this method to run code that should run while the field is disabled.

void SampleRobot::OperatorControl ( )
virtual

Operator control (tele-operated) code should go here.

Programmers should override this method to run code that should run while the field is in the Operator Control (tele-operated) period. This is called once each time the robot enters the teleop state.

void SampleRobot::RobotInit ( )
virtual

Robot-wide initialization code should go here.

Users should override this method for default Robot-wide initialization which will be called when the robot is first powered on. It will be called exactly one time.

Warning: the Driver Station "Robot Code" light and FMS "Robot Ready" indicators will be off until RobotInit() exits. Code in RobotInit() that waits for enable will cause the robot to never indicate that the code is ready, causing the robot to be bypassed in a match.

void SampleRobot::RobotMain ( )
virtual

Robot main program for free-form programs.

This should be overridden by user subclasses if the intent is to not use the Autonomous() and OperatorControl() methods. In that case, the program is responsible for sensing when to run the autonomous and operator control functions in their program.

This method will be called immediately after the constructor is called. If it has not been overridden by a user subclass (i.e. the default version runs), then the Autonomous() and OperatorControl() methods will be called.

void SampleRobot::StartCompetition ( )
overridevirtual

Start a competition.

This code needs to track the order of the field starting to ensure that everything happens in the right order. Repeatedly run the correct method, either Autonomous or OperatorControl or Test when the robot is enabled. After running the correct method, wait for some state to change, either the other mode starts or the robot is disabled. Then go back and wait for the robot to be enabled again.

Implements frc::RobotBase.

void SampleRobot::Test ( )
virtual

Test program should go here.

Programmers should override this method to run code that executes while the robot is in test mode. This will be called once whenever the robot enters test mode


The documentation for this class was generated from the following files: