# Robot (YAGSL-Example API)
declaration: package: frc.robot, class: Robot

Package frc.robot

# Class Robot

java.lang.Object
edu.wpi.first.wpilibj.RobotBase
edu.wpi.first.wpilibj.IterativeRobotBase
edu.wpi.first.wpilibj.TimedRobot
frc.robot.Robot

All Implemented Interfaces:
  `AutoCloseable`

public class Robot extends edu.wpi.first.wpilibj.TimedRobot
The VM is configured to automatically run this class, and to call the functions corresponding to each mode, as described in the TimedRobot documentation. If you change the name of this class or the package after creating this project, you must also update the build.gradle file in the project.

## Field Summary

### Fields inherited from class edu.wpi.first.wpilibj.TimedRobot

`kDefaultPeriod`

## Constructor Summary

Constructors
Constructor
Description
`Robot()`

## Method Summary

Modifier and Type
Method
Description
`void`
`autonomousInit()`
This autonomous runs the autonomous command selected by your `RobotContainer` class.
`void`
`autonomousPeriodic()`
This function is called periodically during autonomous.
`void`
`disabledInit()`
This function is called once each time the robot enters Disabled mode.
`void`
`disabledPeriodic()`
`static Robot`
`getInstance()`
`void`
`robotInit()`
This function is run when the robot is first started up and should be used for any initialization code.
`void`
`robotPeriodic()`
This function is called every 20 ms, no matter the mode.
`void`
`simulationInit()`
This function is called once when the robot is first started up.
`void`
`simulationPeriodic()`
This function is called periodically whilst in simulation.
`void`
`teleopInit()`
`void`
`teleopPeriodic()`
This function is called periodically during operator control.
`void`
`testInit()`
`void`
`testPeriodic()`
This function is called periodically during test mode.

### Methods inherited from class edu.wpi.first.wpilibj.TimedRobot

`addPeriodic, addPeriodic, close, endCompetition, startCompetition`

### Methods inherited from class edu.wpi.first.wpilibj.IterativeRobotBase

`autonomousExit, disabledExit, driverStationConnected, enableLiveWindowInTest, getPeriod, isLiveWindowEnabledInTest, loopFunc, setNetworkTablesFlushEnabled, teleopExit, testExit`

### Methods inherited from class edu.wpi.first.wpilibj.RobotBase

`getMainThreadId, getRuntimeType, isAutonomous, isAutonomousEnabled, isDisabled, isEnabled, isReal, isSimulation, isTeleop, isTeleopEnabled, isTest, isTestEnabled, startRobot, suppressExitWarning`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Robot

public Robot()

## Method Details

### getInstance

public static Robot getInstance()

### robotInit

public void robotInit()
This function is run when the robot is first started up and should be used for any initialization code.

Overrides:
  `robotInit` in class `edu.wpi.first.wpilibj.IterativeRobotBase`

### robotPeriodic

public void robotPeriodic()
This function is called every 20 ms, no matter the mode. Use this for items like diagnostics that you want ran during disabled, autonomous, teleoperated and test.

This runs after the mode specific periodic functions, but before LiveWindow and SmartDashboard integrated updating.

Overrides:
  `robotPeriodic` in class `edu.wpi.first.wpilibj.IterativeRobotBase`

### disabledInit

public void disabledInit()
This function is called once each time the robot enters Disabled mode.

Overrides:
  `disabledInit` in class `edu.wpi.first.wpilibj.IterativeRobotBase`

### disabledPeriodic

public void disabledPeriodic()

Overrides:
  `disabledPeriodic` in class `edu.wpi.first.wpilibj.IterativeRobotBase`

### autonomousInit

public void autonomousInit()
This autonomous runs the autonomous command selected by your `RobotContainer` class.

Overrides:
  `autonomousInit` in class `edu.wpi.first.wpilibj.IterativeRobotBase`

### autonomousPeriodic

public void autonomousPeriodic()
This function is called periodically during autonomous.

Overrides:
  `autonomousPeriodic` in class `edu.wpi.first.wpilibj.IterativeRobotBase`

### teleopInit

public void teleopInit()

Overrides:
  `teleopInit` in class `edu.wpi.first.wpilibj.IterativeRobotBase`

### teleopPeriodic

public void teleopPeriodic()
This function is called periodically during operator control.

Overrides:
  `teleopPeriodic` in class `edu.wpi.first.wpilibj.IterativeRobotBase`

### testInit

public void testInit()

Overrides:
  `testInit` in class `edu.wpi.first.wpilibj.IterativeRobotBase`

### testPeriodic

public void testPeriodic()
This function is called periodically during test mode.

Overrides:
  `testPeriodic` in class `edu.wpi.first.wpilibj.IterativeRobotBase`

### simulationInit

public void simulationInit()
This function is called once when the robot is first started up.

Overrides:
  `simulationInit` in class `edu.wpi.first.wpilibj.IterativeRobotBase`

### simulationPeriodic

public void simulationPeriodic()
This function is called periodically whilst in simulation.

Overrides:
  `simulationPeriodic` in class `edu.wpi.first.wpilibj.IterativeRobotBase`