Package frc.robot
Class Robot
- All Implemented Interfaces:
AutoCloseable
The main robot class. This class is the entry point for the robot code and manages all subsystems
and their configurations. The main robot class. This class is the entry point for the robot code
and manages all subsystems and their configurations.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class edu.wpi.first.wpilibj.TimedRobot
kDefaultPeriod -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidThis method is called once when autonomous startsvoidvoidThis method cancels all commands and returns subsystems to their default commands.voidvoidvoidstatic AutongetAuton()static BatteryLoggerstatic Robot.Configstatic Coordinatorstatic Field2dstatic FuelIntakestatic HoodgetHood()static IndexerBedstatic IndexerTowerstatic IntakeExtensionstatic Launcherstatic Operatorstatic PilotgetPilot()static RobotSimstatic Swervestatic Visionstatic VisionSystemvoidThis method cancels all commands and returns subsystems to their default commands and the gamepad configs are reset so that new bindings can be assigned based on mode.voidvoidThis method is called periodically the entire time the robot is running.voidSets up the SmartDashboard data for visualization.voidThis method is called once when a simulation startsvoidThis method is called periodically during simulation.voidvoidvoidvoidtestExit()voidtestInit()This method is called once when test mode startsvoidMethods inherited from class frc.spectrumLib.SpectrumRobot
add, setupDefaultCommands, setupStatesMethods inherited from class edu.wpi.first.wpilibj.TimedRobot
addPeriodic, addPeriodic, addPeriodic, addPeriodic, close, endCompetition, getLoopStartTime, startCompetitionMethods inherited from class edu.wpi.first.wpilibj.IterativeRobotBase
driverStationConnected, enableLiveWindowInTest, getPeriod, isLiveWindowEnabledInTest, loopFunc, printWatchdogEpochs, setNetworkTablesFlushEnabledMethods inherited from class edu.wpi.first.wpilibj.RobotBase
getMainThreadId, getRuntimeType, isAutonomous, isAutonomousEnabled, isDisabled, isEnabled, isReal, isSimulation, isTeleop, isTeleopEnabled, isTest, isTestEnabled, startRobot, suppressExitWarning
-
Field Details
-
telemetry
-
autonWarmedUp
public static boolean autonWarmedUp
-
-
Constructor Details
-
Robot
public Robot()
-
-
Method Details
-
resetCommandsAndButtons
public void resetCommandsAndButtons()This method cancels all commands and returns subsystems to their default commands and the gamepad configs are reset so that new bindings can be assigned based on mode. This method should be called when each mode is initialized.Warning: This method will cause a very large loop overrun, as it rebinds all states to their triggers. Be careful when you call this as it will cause delays in the robot code. It is recommended to call this method at the end of disabledInit and teleopInit, as those are the most common places to need to reset commands and bindings.
-
clearCommandsAndButtons
public void clearCommandsAndButtons()This method cancels all commands and returns subsystems to their default commands. This method should be called when each mode is initialized.Warning: This method will cause a very large loop overrun, as it rebinds all states to their triggers. Be careful when you call this as it will cause delays in the robot code. It is recommended to call this method at the end of disabledInit and teleopInit, as those are the most common places to need to reset commands and bindings.
-
setupSmartDashboardData
public void setupSmartDashboardData()Sets up the SmartDashboard data for visualization. -
robotInit
public void robotInit()- Overrides:
robotInitin classIterativeRobotBase
-
robotPeriodic
public void robotPeriodic()This method is called periodically the entire time the robot is running. Periodic methods are called every 20 ms (50 times per second) by default Since the robot software is always looping you shouldn't pause the execution of the robot code This ensures that new values are updated from the gamepads and sent to the motors- Overrides:
robotPeriodicin classIterativeRobotBase
-
disabledInit
public void disabledInit()- Overrides:
disabledInitin classIterativeRobotBase
-
disabledPeriodic
public void disabledPeriodic()- Overrides:
disabledPeriodicin classIterativeRobotBase
-
disabledExit
public void disabledExit()- Overrides:
disabledExitin classIterativeRobotBase
-
autonomousInit
public void autonomousInit()This method is called once when autonomous starts- Overrides:
autonomousInitin classIterativeRobotBase
-
autonomousPeriodic
public void autonomousPeriodic()- Overrides:
autonomousPeriodicin classIterativeRobotBase
-
autonomousExit
public void autonomousExit()- Overrides:
autonomousExitin classIterativeRobotBase
-
teleopInit
public void teleopInit()- Overrides:
teleopInitin classIterativeRobotBase
-
teleopPeriodic
public void teleopPeriodic()- Overrides:
teleopPeriodicin classIterativeRobotBase
-
teleopExit
public void teleopExit()- Overrides:
teleopExitin classIterativeRobotBase
-
testInit
public void testInit()This method is called once when test mode starts- Overrides:
testInitin classIterativeRobotBase
-
testPeriodic
public void testPeriodic()- Overrides:
testPeriodicin classIterativeRobotBase
-
testExit
public void testExit()- Overrides:
testExitin classIterativeRobotBase
-
simulationInit
public void simulationInit()This method is called once when a simulation starts- Overrides:
simulationInitin classIterativeRobotBase
-
simulationPeriodic
public void simulationPeriodic()This method is called periodically during simulation.- Overrides:
simulationPeriodicin classIterativeRobotBase
-
getRobotSim
-
getConfig
-
getField2d
-
getSwerve
-
getFuelIntake
-
getIntakeExtension
-
getIndexerTower
-
getIndexerBed
-
getOperator
-
getPilot
-
getVisionSystem
-
getLauncher
-
getHood
-
getVision
-
getAuton
-
getCoordinator
-
getBatteryLogger
-