WPILibC++  2021.3.1
frc::IterativeRobot Class Reference

IterativeRobot implements the IterativeRobotBase robot program framework. More...

#include <frc/IterativeRobot.h>

Inheritance diagram for frc::IterativeRobot:
frc::IterativeRobotBase frc::RobotBase

Public Member Functions

 WPI_DEPRECATED ("Use TimedRobot instead. It's a drop-in replacement that provides more " "regular execution periods.") IterativeRobot()
 
void StartCompetition () override
 Provide an alternate "main loop" via StartCompetition(). More...
 
void EndCompetition () override
 Ends the main loop in StartCompetition().
 
- Public Member Functions inherited from frc::IterativeRobotBase
virtual void RobotInit ()
 Robot-wide initialization code should go here. More...
 
virtual void SimulationInit ()
 Robot-wide simulation 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 SimulationPeriodic ()
 Periodic simulation code 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...
 
void SetNetworkTablesFlushEnabled (bool enabled)
 Enables or disables flushing NetworkTables every loop iteration. More...
 
 IterativeRobotBase (double period)
 Constructor for IterativeRobotBase. More...
 
 IterativeRobotBase (units::second_t period)
 Constructor for IterativeRobotBase. 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 IsAutonomousEnabled () const
 Determine if the robot is currently in Autonomous mode and enabled. More...
 
bool IsOperatorControl () const
 Determine if the robot is currently in Operator Control mode. More...
 
bool IsOperatorControlEnabled () const
 Determine if the robot is current in Operator Control mode and enabled. 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...
 
 RobotBase ()
 Constructor for a generic robot program. 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.
 
static constexpr bool IsReal ()
 Get if the robot is real. More...
 
static constexpr bool IsSimulation ()
 Get if the robot is a simulation. More...
 
- Protected Member Functions inherited from frc::IterativeRobotBase
 IterativeRobotBase (IterativeRobotBase &&)=default
 
IterativeRobotBaseoperator= (IterativeRobotBase &&)=default
 
void LoopFunc ()
 
- Protected Member Functions inherited from frc::RobotBase
 RobotBase (RobotBase &&) noexcept
 
RobotBaseoperator= (RobotBase &&) noexcept
 
- Protected Attributes inherited from frc::IterativeRobotBase
units::second_t m_period
 
- Protected Attributes inherited from frc::RobotBase
DriverStationm_ds
 
- Static Protected Attributes inherited from frc::RobotBase
static std::thread::id m_threadId
 

Detailed Description

IterativeRobot implements the IterativeRobotBase robot program framework.

The IterativeRobot class is intended to be subclassed by a user creating a robot program.

Periodic() functions from the base class are called each time a new packet is received from the driver station.

Deprecated:
Use TimedRobot instead. It's a drop-in replacement that provides more regular execution periods.

Member Function Documentation

◆ StartCompetition()

void frc::IterativeRobot::StartCompetition ( )
overridevirtual

Provide an alternate "main loop" via StartCompetition().

This specific StartCompetition() implements "main loop" behavior synced with the DS packets.

Implements frc::RobotBase.


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