Package org.hyperonline.hyperlib
Class HYPERRobot
- java.lang.Object
-
- edu.wpi.first.wpilibj.RobotBase
-
- edu.wpi.first.wpilibj.IterativeRobotBase
-
- edu.wpi.first.wpilibj.TimedRobot
-
- org.hyperonline.hyperlib.HYPERRobot
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public abstract class HYPERRobot extends edu.wpi.first.wpilibj.TimedRobot
TheHYPERRobot
extendsTimedRobot
to provide code which is mostly the same in every robot. Commands and periodic events (throughPeriodicScheduler
run in every mode except test mode, where theLiveWindow
runs.
-
-
Constructor Summary
Constructors Constructor Description HYPERRobot()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
autonomousPeriodic()
void
disabledPeriodic()
protected abstract void
initCommands()
Initialize commands.protected abstract void
initHelpers()
Initialize helper classes.protected abstract void
initOI()
Initialize the operator interface.protected abstract void
initSubsystems()
Initialize subsystems.void
robotInit()
Initialize the robot.void
teleopPeriodic()
-
Methods inherited from class edu.wpi.first.wpilibj.IterativeRobotBase
autonomousInit, disabledInit, loopFunc, robotPeriodic, teleopInit, testInit, testPeriodic
-
-
-
-
Method Detail
-
robotInit
public final void robotInit()
Initialize the robot. This initializes in the following order:- Operator Interface (buttons and joysticks, not commands)
- Subsystems (which in turn initialize hardware like speed controllers
- "Helper classes" which depend on subsystems but have commands which depend on them (like UserDrive and Vision in hypercode)
- Commands, including autonomous commands and commands on the OI
- Overrides:
robotInit
in classedu.wpi.first.wpilibj.IterativeRobotBase
-
initOI
protected abstract void initOI()
Initialize the operator interface. This should create joysticks and buttons, but not any commands, asinitCommands()
will not be called until after this. If you are using the hyperLibOI
, this is where you would call the constructor for the OI.
-
initSubsystems
protected abstract void initSubsystems()
Initialize subsystems. This is where you should call the constructors for any subsystems. The subsystems may reference the joysticks/buttons on the OI, as they will have already been initialized at this point.
-
initHelpers
protected abstract void initHelpers()
Initialize helper classes. For example, in hypercode, UserDrive is a class which manages the drive modes in teleop. This class depends on the DriveTrain but has commands which depend on it in the OI. For any classes like this, initialize them here.
-
initCommands
protected abstract void initCommands()
Initialize commands. This is where you should add commands to the OI and the autonomous command chooser. If you are using the hyperLibOI
, this is where you should callOI.initCommands()
-
disabledPeriodic
public void disabledPeriodic()
- Overrides:
disabledPeriodic
in classedu.wpi.first.wpilibj.IterativeRobotBase
-
autonomousPeriodic
public void autonomousPeriodic()
- Overrides:
autonomousPeriodic
in classedu.wpi.first.wpilibj.IterativeRobotBase
-
teleopPeriodic
public void teleopPeriodic()
- Overrides:
teleopPeriodic
in classedu.wpi.first.wpilibj.IterativeRobotBase
-
-