Package frc.robot
Class Robot
- All Implemented Interfaces:
AutoCloseable
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, addPeriodic, addPeriodic, close, endCompetition, startCompetition
Methods inherited from class edu.wpi.first.wpilibj.IterativeRobotBase
autonomousExit, disabledExit, driverStationConnected, enableLiveWindowInTest, getPeriod, isLiveWindowEnabledInTest, loopFunc, printWatchdogEpochs, 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 classIterativeRobotBase
-
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 classIterativeRobotBase
-
disabledInit
public void disabledInit()This function is called once each time the robot enters Disabled mode.- Overrides:
disabledInit
in classIterativeRobotBase
-
disabledPeriodic
public void disabledPeriodic()- Overrides:
disabledPeriodic
in classIterativeRobotBase
-
autonomousInit
public void autonomousInit()This autonomous runs the autonomous command selected by yourRobotContainer
class.- Overrides:
autonomousInit
in classIterativeRobotBase
-
autonomousPeriodic
public void autonomousPeriodic()This function is called periodically during autonomous.- Overrides:
autonomousPeriodic
in classIterativeRobotBase
-
teleopInit
public void teleopInit()- Overrides:
teleopInit
in classIterativeRobotBase
-
teleopPeriodic
public void teleopPeriodic()This function is called periodically during operator control.- Overrides:
teleopPeriodic
in classIterativeRobotBase
-
testInit
public void testInit()- Overrides:
testInit
in classIterativeRobotBase
-
testPeriodic
public void testPeriodic()This function is called periodically during test mode.- Overrides:
testPeriodic
in classIterativeRobotBase
-
simulationInit
public void simulationInit()This function is called once when the robot is first started up.- Overrides:
simulationInit
in classIterativeRobotBase
-
simulationPeriodic
public void simulationPeriodic()This function is called periodically whilst in simulation.- Overrides:
simulationPeriodic
in classIterativeRobotBase
-