Control Board
The DriverControls
class handles input from the driver and co-driver Xbox controllers and translates these inputs into commands for the robot’s subsystems.
Overview
ControlBoard instance: Centralizes access to driver and co-driver controllers.
Subsystem instances:
Drive
andSuperstructure
are accessed and commanded based on input.Two control modes:
One Controller Mode for simple operation.
Two Controller Mode for full robot control during competition.
Controller Variables
CustomXboxController driver = mControlBoard.driver;
CustomXboxController codriver = mControlBoard.operator;
driver
: Represents the primary Xbox controller operated by the driver.codriver
: Represents the secondary Xbox controller operated by the co-driver (operator).These objects provide access to button states, trigger axes, and POV (D-pad) directions.
Button and Input Handling
Buttons and inputs are queried with methods like:
driver.leftBumper.isBeingPressed()
: Returnstrue
while the left bumper button on the driver’s controller is held down.driver.getAButton()
: Returnstrue
if the A button is currently pressed.codriver.getRightTriggerAxis() == 1
: Checks if the right trigger is fully pressed on the co-driver’s controller.driver.POV270.isBeingPressed()
: Checks if the D-pad is pressed in the 270° (left) direction.
You can also detect button presses/releases for event-driven actions, e.g., driver.releasedAny(...)
or codriver.getStartButtonPressed()
.
Control Modes
One Controller Mode
Usage: When only one controller is available.
Functionality: Basic commands such as zeroing the gyro, moving the intake deploy subsystem.
Ideal for: Outreach events, demos, early development/testing.
Two Controller Mode
Usage: When both driver and co-driver controllers are active.
Driver responsibilities:
Driving (including gyro zeroing and auto-alignment).
When to actually move the robot/score
Co-driver responsibilities:
Emergency movements (ex.Intake up)
Scoring locations (What happens when the driver presses score)
Code overrides (We make mistakes, this lets us keep playing if we do)
Ideal for: Competition matches and advanced testing, allowing multitasking and precise control.
Example Input Usage
if(driver.leftBumper.isBeingPressed()){
s.setGoal(GoalState.GROUND_CORAL_INTAKE);
}
This code checks if the driver's left bumper is currently held down.
While held, it sets the robot’s superstructure goal state to
GROUND_CORAL_INTAKE
.
Last updated