Robot States

Robots programmed with WPILib can be in one of four modes of operation, called states:

  • Disabled: The robot does not accept user input and shouldn't move mechanisms. It is safe for humans to be around the robot while it is disabled. This is the default state.
  • Teleoperated: The robot accepts user input and moves mechanisms. This is the most common state used while testing, and the teleoperated period of the FRC game is spent in this state.
  • Autonomous: The robot does not accept user input, and instead goes through a sequence of preprogrammed actions. This state is active for the first 15 seconds in an FRC match.
  • Emergency Stopped (E-Stopped): This is a special state which is identical to the disabled state, except that the bot cannot be re-enabled after it has been emergency stopped. This state is triggered by pressing the spacebar in FRC Driver Station.

Here's a table comparing each state:

StateMovesAccepts InputCan Be Enabled
DisabledNoNoYes
TeleoperatedYesYesN/A
AutonomousYesNoN/A
Emergency StopNoNoNo

Excepting emergency stops, the code will follow this flowchart during a match:

The complete flowchart with emergency stops looks like this: