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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
This autonomous runs the autonomous command selected by yourRobotContainer
class.void
This function is called periodically during autonomous.void
This function is called once each time the robot enters Disabled mode.void
void
This function is run when the robot is first started up and should be used for any initialization code.void
This function is called every 20 ms, no matter the mode.void
This function is called once when the robot is first started up.void
This function is called periodically whilst in simulation.void
void
This function is called periodically during operator control.void
testInit()
void
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
-
Constructor Details
-
Robot
public Robot()
-
-
Method Details
-
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 classedu.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 classedu.wpi.first.wpilibj.IterativeRobotBase
-
disabledInit
public void disabledInit()This function is called once each time the robot enters Disabled mode.- Overrides:
disabledInit
in classedu.wpi.first.wpilibj.IterativeRobotBase
-
disabledPeriodic
public void disabledPeriodic()- Overrides:
disabledPeriodic
in classedu.wpi.first.wpilibj.IterativeRobotBase
-
autonomousInit
public void autonomousInit()This autonomous runs the autonomous command selected by yourRobotContainer
class.- Overrides:
autonomousInit
in classedu.wpi.first.wpilibj.IterativeRobotBase
-
autonomousPeriodic
public void autonomousPeriodic()This function is called periodically during autonomous.- Overrides:
autonomousPeriodic
in classedu.wpi.first.wpilibj.IterativeRobotBase
-
teleopInit
public void teleopInit()- Overrides:
teleopInit
in classedu.wpi.first.wpilibj.IterativeRobotBase
-
teleopPeriodic
public void teleopPeriodic()This function is called periodically during operator control.- Overrides:
teleopPeriodic
in classedu.wpi.first.wpilibj.IterativeRobotBase
-
testInit
public void testInit()- Overrides:
testInit
in classedu.wpi.first.wpilibj.IterativeRobotBase
-
testPeriodic
public void testPeriodic()This function is called periodically during test mode.- Overrides:
testPeriodic
in classedu.wpi.first.wpilibj.IterativeRobotBase
-
simulationInit
public void simulationInit()This function is called once when the robot is first started up.- Overrides:
simulationInit
in classedu.wpi.first.wpilibj.IterativeRobotBase
-
simulationPeriodic
public void simulationPeriodic()This function is called periodically whilst in simulation.- Overrides:
simulationPeriodic
in classedu.wpi.first.wpilibj.IterativeRobotBase
-