Robot Core Documentation
Loading...
Searching...
No Matches
edu.wpi.first.wpilibj.TimedRobot Class Reference
Inheritance diagram for edu.wpi.first.wpilibj.TimedRobot:
edu.wpi.first.wpilibj.IterativeRobotBase

Public Member Functions

void startCompetition ()
 
void endCompetition ()
 
final void addPeriodic (Runnable callback, double periodSeconds)
 
final void addPeriodic (Runnable callback, double periodSeconds, double offsetSeconds)
 
- Public Member Functions inherited from edu.wpi.first.wpilibj.IterativeRobotBase
void robotInit ()
 
void driverStationConnected ()
 
void simulationInit ()
 
void disabledInit ()
 
void autonomousInit ()
 
void teleopInit ()
 
void testInit ()
 
void robotPeriodic ()
 
void simulationPeriodic ()
 
void disabledPeriodic ()
 
void autonomousPeriodic ()
 
void teleopPeriodic ()
 
void testPeriodic ()
 
void disabledExit ()
 
void autonomousExit ()
 
void teleopExit ()
 
void testExit ()
 
void setNetworkTablesFlushEnabled (boolean enabled)
 
void enableLiveWindowInTest (boolean testLW)
 
boolean isLiveWindowEnabledInTest ()
 
double getPeriod ()
 

Static Public Attributes

static final double kDefaultPeriod = 0.02
 

Protected Member Functions

 TimedRobot ()
 
 TimedRobot (double period)
 
- Protected Member Functions inherited from edu.wpi.first.wpilibj.IterativeRobotBase
 IterativeRobotBase (double period)
 
void loopFunc ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TimedRobot() [1/2]

edu.wpi.first.wpilibj.TimedRobot.TimedRobot ( )
protected

Constructor for TimedRobot.

◆ TimedRobot() [2/2]

edu.wpi.first.wpilibj.TimedRobot.TimedRobot ( double period)
protected

Constructor for TimedRobot.

Parameters
periodPeriod in seconds.

Member Function Documentation

◆ addPeriodic() [1/2]

final void edu.wpi.first.wpilibj.TimedRobot.addPeriodic ( Runnable callback,
double periodSeconds )

Add a callback to run at a specific period.

This is scheduled on TimedRobot's Notifier, so TimedRobot and the callback run synchronously. Interactions between them are thread-safe.

Parameters
callbackThe callback to run.
periodSecondsThe period at which to run the callback in seconds.

◆ addPeriodic() [2/2]

final void edu.wpi.first.wpilibj.TimedRobot.addPeriodic ( Runnable callback,
double periodSeconds,
double offsetSeconds )

Add a callback to run at a specific period with a starting time offset.

This is scheduled on TimedRobot's Notifier, so TimedRobot and the callback run synchronously. Interactions between them are thread-safe.

Parameters
callbackThe callback to run.
periodSecondsThe period at which to run the callback in seconds.
offsetSecondsThe offset from the common starting time in seconds. This is useful for scheduling a callback in a different timeslot relative to TimedRobot.

◆ endCompetition()

void edu.wpi.first.wpilibj.TimedRobot.endCompetition ( )

Ends the main loop in startCompetition().

◆ startCompetition()

void edu.wpi.first.wpilibj.TimedRobot.startCompetition ( )

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

Reimplemented from edu.wpi.first.wpilibj.IterativeRobotBase.

Member Data Documentation

◆ kDefaultPeriod

final double edu.wpi.first.wpilibj.TimedRobot.kDefaultPeriod = 0.02
static

Default loop period.


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