Package xbot.common.command
Class BaseRobot
java.lang.Object
edu.wpi.first.wpilibj.RobotBase
edu.wpi.first.wpilibj.IterativeRobotBase
org.littletonrobotics.junction.LoggedRobot
xbot.common.command.BaseRobot
- All Implemented Interfaces:
AutoCloseable
public abstract class BaseRobot
extends org.littletonrobotics.junction.LoggedRobot
Core Robot class which configures logging, properties,
scheduling, and the injector. Required for a fair amount
of CommonLib functionality.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Command
protected AutonomousCommandSelector
protected List<DataFrameRefreshable>
protected DevicePolice
protected XPropertyManager
protected SimulationPayloadDistributor
protected WebotsClient
protected XScheduler
Fields inherited from class org.littletonrobotics.junction.LoggedRobot
defaultPeriodSecs
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
This function is called periodically during autonomousprotected abstract BaseComponent
Returns theBaseComponent
instance used for dependency injectionvoid
void
protected String
protected BaseComponent
Get the dependency injection componentprotected String
protected void
void
This function is run when the robot is first started up and should be used for any initialization code.protected void
Override if you need a different moduleprotected void
void
void
void
void
This function is called periodically during operator controlvoid
This function is called periodically during test modeprotected void
Methods inherited from class org.littletonrobotics.junction.LoggedRobot
endCompetition, finalize, setUseTiming, startCompetition
Methods inherited from class edu.wpi.first.wpilibj.IterativeRobotBase
autonomousExit, disabledExit, driverStationConnected, enableLiveWindowInTest, getPeriod, isLiveWindowEnabledInTest, loopFunc, printWatchdogEpochs, robotPeriodic, setNetworkTablesFlushEnabled, teleopExit, testExit, testInit
Methods inherited from class edu.wpi.first.wpilibj.RobotBase
close, getMainThreadId, getRuntimeType, isAutonomous, isAutonomousEnabled, isDisabled, isEnabled, isReal, isSimulation, isTeleop, isTeleopEnabled, isTest, isTestEnabled, startRobot, suppressExitWarning
-
Field Details
-
propertyManager
-
xScheduler
-
autonomousCommand
-
autonomousCommandSelector
-
webots
-
devicePolice
-
simulationPayloadDistributor
-
dataFrameRefreshables
-
-
Constructor Details
-
BaseRobot
public BaseRobot()
-
-
Method Details
-
setupInjectionModule
protected void setupInjectionModule()Override if you need a different module -
createDaggerComponent
Returns theBaseComponent
instance used for dependency injection -
getInjectorComponent
Get the dependency injection component- Returns:
- an implementation of BaseComponent that will be used throughout the robot.
-
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
-
getEnableTypeString
-
updateLoggingContext
protected void updateLoggingContext() -
initializeSystems
protected void initializeSystems() -
disabledInit
public void disabledInit()- Overrides:
disabledInit
in classIterativeRobotBase
-
disabledPeriodic
public void disabledPeriodic()- Overrides:
disabledPeriodic
in classIterativeRobotBase
-
getMatchContextString
-
autonomousInit
public void autonomousInit()- 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
-
testPeriodic
public void testPeriodic()This function is called periodically during test mode- Overrides:
testPeriodic
in classIterativeRobotBase
-
simulationInit
public void simulationInit()- Overrides:
simulationInit
in classIterativeRobotBase
-
simulationPeriodic
public void simulationPeriodic()- Overrides:
simulationPeriodic
in classIterativeRobotBase
-