public class OI extends Robot
Modifier and Type | Field and Description |
---|---|
private edu.wpi.first.wpilibj.buttons.Button[] |
copilotButtons |
private edu.wpi.first.wpilibj.buttons.Button[] |
driverButtons |
private int |
m_buttonA |
private int |
m_buttonB |
private int |
m_buttonBack |
private int |
m_buttonInvalid |
private int |
m_buttonLStick |
private int |
m_buttonRStick |
private int |
m_buttonStart |
private int |
m_buttonToken |
private int |
m_buttonX |
private int |
m_buttonY |
private int |
m_commandToken |
private edu.wpi.first.wpilibj.Joystick |
m_copilotControl |
private int |
m_copilotJoystickID |
private edu.wpi.first.wpilibj.Joystick |
m_driverControl |
private int |
m_driverJoystickID |
private CommandFactory |
m_factory |
private int |
m_heldID |
private int |
m_invalidJoystickID |
private int |
m_invalidState |
private int |
m_pressedID |
private int |
m_released |
private int |
m_stateToken |
private int |
m_stickToken
This class is the glue that binds the controls on the physical operator interface to the commands and command groups that allow control of the
robot.
|
private boolean |
m_success |
private int |
m_tokensPerLine |
private int |
m_upperLeftButton |
private int |
m_upperRightButton |
adamInterface, ashtynInterface, autoSelected, customAuto, defaultAuto, defaultInterface, derekInterface, eldonInterface, ericInterface, fileSelected, greatestAngle, hooverInterface, jeffInterface, joshInterface, klaytonInterface, m_arcadeMode, m_autonChooser, m_cubedSens, m_driveMode, m_driveSensitivity, m_linearSens, m_oi, m_oiChooser, m_tankMode, oiSelected, witsInterface, zachInterface
Constructor and Description |
---|
OI() |
Modifier and Type | Method and Description |
---|---|
void |
assignCommand(java.lang.String line)
assignCommand - given a comma separated line from the command-button mapping profile, this method will
parse the string into 4 tokens (stick, button, button state, command).
|
int |
getButtonID(java.lang.String buttonLabel)
getButtonID - given a button label, this returns the corresponding button ID.
|
void |
getControls() |
int |
getStateID(java.lang.String stateName)
getStateID - determines the number of the state based on the text file.
|
edu.wpi.first.wpilibj.Joystick |
getStick(int stickID) |
int |
getStickID(java.lang.String stickLabel) |
void |
readFile(java.lang.String oiSelected) |
autonomousInit, autonomousPeriodic, robotInit, teleopInit, teleopPeriodic, testPeriodic, writing
disabledInit, disabledPeriodic, startCompetition, testInit
private final int m_stickToken
private final int m_buttonToken
private final int m_commandToken
private final int m_stateToken
private final int m_tokensPerLine
private final int m_invalidJoystickID
private final int m_driverJoystickID
private final int m_copilotJoystickID
private final int m_invalidState
private final int m_pressedID
private final int m_heldID
private final int m_released
private final int m_buttonInvalid
private final int m_buttonA
private final int m_buttonB
private final int m_buttonX
private final int m_buttonY
private final int m_upperRightButton
private final int m_upperLeftButton
private final int m_buttonBack
private final int m_buttonStart
private final int m_buttonRStick
private final int m_buttonLStick
private edu.wpi.first.wpilibj.Joystick m_driverControl
private edu.wpi.first.wpilibj.Joystick m_copilotControl
private CommandFactory m_factory
private boolean m_success
private edu.wpi.first.wpilibj.buttons.Button[] driverButtons
private edu.wpi.first.wpilibj.buttons.Button[] copilotButtons
public void readFile(java.lang.String oiSelected)
public void assignCommand(java.lang.String line)
line
- line from the file to parse into the tokens to define the command assigned to joystick button state.public int getStickID(java.lang.String stickLabel)
public edu.wpi.first.wpilibj.Joystick getStick(int stickID)
public int getButtonID(java.lang.String buttonLabel)
buttonLabel
- = string identifying the button to mappublic int getStateID(java.lang.String stateName)
stateName
- = string of the state namepublic void getControls()