Class TorqueController
java.lang.Object
org.texastorque.torquelib.sensors.TorqueController
A class representation of a controller, used for gathering
driver input.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
-
Constructor Summary
ConstructorDescriptionTorqueController
(int port) Create a new TorqueController.TorqueController
(int port, double deadband) Create a new TorqueController.Create a new TorqueController.TorqueController
(TorqueController.ControllerPort port, double deadband) Create a new TorqueController. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Deprecated.Here for old API compatibility.final boolean
Deprecated.Here for old API compatibility.final boolean
Deprecated.Here for old API compatibility.final boolean
Deprecated.Here for old API compatibility.final boolean
Deprecated.Here for old API compatibility.final boolean
Deprecated.Here for old API compatibility.final boolean
Deprecated.Here for old API compatibility.Get the state of the DPAD.final boolean
Deprecated.Here for old API compatibility.final boolean
Deprecated.Here for old API compatibility.final boolean
Deprecated.Here for old API compatibility.final boolean
Deprecated.Here for old API compatibility.final boolean
Deprecated.Here for old API compatibility.final boolean
Deprecated.Here for old API compatibility.final boolean
Deprecated.Here for old API compatibility.final double
Get the value of the left trigger axis.final double
Get the value of the left X axis.final double
Get the value of the left Y axis.final boolean
Deprecated.Here for old API compatibility.final boolean
Deprecated.Here for old API compatibility.final boolean
Deprecated.Here for old API compatibility.final boolean
Deprecated.Here for old API compatibility.final double
Get the value of the right trigger axis.final double
Get the value of the left X axis.final double
Get the value of the left Y axis.final boolean
Deprecated.Here for old API compatibility.final boolean
Deprecated.Here for old API compatibility.final boolean
Check if the A button is currently down.final boolean
Check if the A button is being pressed.final boolean
Check if the A button is being released.final boolean
Check if the B button is currently down.final boolean
Check if the B button is being pressed.final boolean
Check if the B button is being released.final boolean
isDPAD
(int angle) Check if the the DPAD is at this angle.final boolean
isDPAD
(TorqueController.DPADState state) Check if the the DPAD is at this state.final boolean
Check if the DPAD down button is being held down.final boolean
Check if the DPAD down left button is being held down.final boolean
Check if the DPAD down right button is being held down.final boolean
Check if the DPAD left button is being held down.final boolean
Check if the DPAD right button is being held down.final boolean
Check if the DPAD up button is being held down.final boolean
Check if the DPAD up left button is being held down.final boolean
Check if the DPAD up right button is being held down.final boolean
Check if the left bumper is currently down.final boolean
Check if the left bumper is being pressed.final boolean
Check if the left bumper is being released.final boolean
Check if the left center button is currently down.final boolean
Check if the left center button is being pressed.final boolean
Check if the left center button is being released.final boolean
Check if the left stick is currently down.final boolean
Check if the left stick is being pressed.final boolean
Check if the left stick is being released.final boolean
Check if the left trigger is currently down.final boolean
Check if the right bumper is currently down.final boolean
Check if the right bumper is being pressed.final boolean
Check if the right bumper is being released.final boolean
Check if the right center button is currently down.final boolean
Check if the right center button is being pressed.final boolean
Check if the right center button is being released.final boolean
Check if the right stick is currently down.final boolean
Check if the right stick is being pressed.final boolean
Check if the right stick is being released.final boolean
Check if the right trigger is currently down.final boolean
Check if the X button is currently down.final boolean
Check if the X button is being pressed.final boolean
Check if the X button is being released.final boolean
Check if the Y button is currently down.final boolean
Check if the Y button is being pressed.final boolean
Check if the Y button is being released.final void
final void
setRumble
(boolean rumble) Set weather or not to rumble both sides.final void
setRumbleLeft
(boolean rumble) Set weather or not to rumble the left side.final void
setRumbleRight
(boolean rumble) Set weather or not to rumble the right side.
-
Constructor Details
-
TorqueController
public TorqueController(int port) Create a new TorqueController.- Parameters:
port
- The controller port.
-
TorqueController
public TorqueController(int port, double deadband) Create a new TorqueController.- Parameters:
port
- The controller port.deadband
- The deadband.
-
TorqueController
Create a new TorqueController.- Parameters:
port
- The controller port.
-
TorqueController
Create a new TorqueController.- Parameters:
port
- The controller port.deadband
- The deadband.
-
-
Method Details
-
getLeftYAxis
public final double getLeftYAxis()Get the value of the left Y axis.- Returns:
- The value of the left Y axis.
-
getLeftXAxis
public final double getLeftXAxis()Get the value of the left X axis.- Returns:
- The value of the left X axis.
-
getRightYAxis
public final double getRightYAxis()Get the value of the left Y axis.- Returns:
- The value of the left Y axis.
-
getRightXAxis
public final double getRightXAxis()Get the value of the left X axis.- Returns:
- The value of the left X axis.
-
getLeftTriggerAxis
public final double getLeftTriggerAxis()Get the value of the left trigger axis.- Returns:
- The value of the left trigger axis.
-
getRightTriggerAxis
public final double getRightTriggerAxis()Get the value of the right trigger axis.- Returns:
- The value of the right trigger axis.
-
getLeftTrigger
Deprecated.Here for old API compatibility. Use the "isLeftTriggerDown" method insteadCheck if the left trigger is currently down.- Returns:
- Is the left trigger currently down?
-
getRightTrigger
Deprecated.Here for old API compatibility. Use the "isRightTriggerDown" method insteadCheck if the right trigger is currently down.- Returns:
- Is the right trigger currently down?
-
isLeftTriggerDown
public final boolean isLeftTriggerDown()Check if the left trigger is currently down.- Returns:
- Is the left trigger currently down?
-
isRightTriggerDown
public final boolean isRightTriggerDown()Check if the right trigger is currently down.- Returns:
- Is the right trigger currently down?
-
getLeftStickClick
Deprecated.Here for old API compatibility. Use the "isLeftStickClickDown" method insteadCheck if the left stick is currently down.- Returns:
- Is the left stick currently down?
-
getRightStickClick
Deprecated.Here for old API compatibility. Use the "isRightStickClickDown" method insteadCheck if the right stick is currently down.- Returns:
- Is the right stick currently down?
-
getLeftBumper
Deprecated.Here for old API compatibility. Use the "isLeftBumperDown" method insteadCheck if the left bumper is currently down.- Returns:
- Is the left bumper currently down?
-
getRightBumper
Deprecated.Here for old API compatibility. Use the "isRightBumperDown" method insteadCheck if the right bumper is currently down.- Returns:
- Is the right bumper currently down?
-
getLeftCenterButton
Deprecated.Here for old API compatibility. Use the "isLeftCenterButtonDown" method insteadCheck if the left center button is currently down.- Returns:
- Is the left center button currently down?
-
getRightCenterButton
Deprecated.Here for old API compatibility. Use the "isRightCenterButtonDown" method insteadCheck if the right center button is currently down.- Returns:
- Is the right center button currently down?
-
getXButton
Deprecated.Here for old API compatibility. Use the "isXButtonDown" method insteadCheck if the X button is currently down.- Returns:
- Is the X button currently down?
-
getYButton
Deprecated.Here for old API compatibility. Use the "isYButtonDown" method insteadCheck if the Y button is currently down.- Returns:
- Is the Y button currently down?
-
getBButton
Deprecated.Here for old API compatibility. Use the "isBButtonDown" method insteadCheck if the B button is currently down.- Returns:
- Is the B button currently down?
-
getAButton
Deprecated.Here for old API compatibility. Use the "isAButtonDown" method insteadCheck if the A button is currently down.- Returns:
- Is the A button currently down?
-
isLeftStickClickDown
public final boolean isLeftStickClickDown()Check if the left stick is currently down.- Returns:
- Is the left stick currently down?
-
isRightStickClickDown
public final boolean isRightStickClickDown()Check if the right stick is currently down.- Returns:
- Is the right stick currently down?
-
isLeftBumperDown
public final boolean isLeftBumperDown()Check if the left bumper is currently down.- Returns:
- Is the left bumper currently down?
-
isRightBumperDown
public final boolean isRightBumperDown()Check if the right bumper is currently down.- Returns:
- Is the right bumper currently down?
-
isLeftCenterButtonDown
public final boolean isLeftCenterButtonDown()Check if the left center button is currently down.- Returns:
- Is the left center button currently down?
-
isRightCenterButtonDown
public final boolean isRightCenterButtonDown()Check if the right center button is currently down.- Returns:
- Is the right center button currently down?
-
isXButtonDown
public final boolean isXButtonDown()Check if the X button is currently down.- Returns:
- Is the X button currently down?
-
isYButtonDown
public final boolean isYButtonDown()Check if the Y button is currently down.- Returns:
- Is the Y button currently down?
-
isBButtonDown
public final boolean isBButtonDown()Check if the B button is currently down.- Returns:
- Is the B button currently down?
-
isAButtonDown
public final boolean isAButtonDown()Check if the A button is currently down.- Returns:
- Is the A button currently down?
-
isLeftStickClickPressed
public final boolean isLeftStickClickPressed()Check if the left stick is being pressed.- Returns:
- Is the left stick being pressed?
-
isRightStickClickPressed
public final boolean isRightStickClickPressed()Check if the right stick is being pressed.- Returns:
- Is the right stick being pressed?
-
isLeftBumperPressed
public final boolean isLeftBumperPressed()Check if the left bumper is being pressed.- Returns:
- Is the left bumper being pressed?
-
isRightBumperPressed
public final boolean isRightBumperPressed()Check if the right bumper is being pressed.- Returns:
- Is the right bumper being pressed?
-
isLeftCenterButtonPressed
public final boolean isLeftCenterButtonPressed()Check if the left center button is being pressed.- Returns:
- Is the left center button being pressed?
-
isRightCenterButtonPressed
public final boolean isRightCenterButtonPressed()Check if the right center button is being pressed.- Returns:
- Is the right center button being pressed?
-
isXButtonPressed
public final boolean isXButtonPressed()Check if the X button is being pressed.- Returns:
- Is the X button being pressed?
-
isYButtonPressed
public final boolean isYButtonPressed()Check if the Y button is being pressed.- Returns:
- Is the Y button being pressed?
-
isBButtonPressed
public final boolean isBButtonPressed()Check if the B button is being pressed.- Returns:
- Is the B button being pressed?
-
isAButtonPressed
public final boolean isAButtonPressed()Check if the A button is being pressed.- Returns:
- Is the A button being pressed?
-
isLeftStickClickReleased
public final boolean isLeftStickClickReleased()Check if the left stick is being released.- Returns:
- Is the left stick being released?
-
isRightStickClickReleased
public final boolean isRightStickClickReleased()Check if the right stick is being released.- Returns:
- Is the right stick being released?
-
isLeftBumperReleased
public final boolean isLeftBumperReleased()Check if the left bumper is being released.- Returns:
- Is the left bumper being released?
-
isRightBumperReleased
public final boolean isRightBumperReleased()Check if the right bumper is being released.- Returns:
- Is the right bumper being released?
-
isLeftCenterButtonReleased
public final boolean isLeftCenterButtonReleased()Check if the left center button is being released.- Returns:
- Is the left center button being released?
-
isRightCenterButtonReleased
public final boolean isRightCenterButtonReleased()Check if the right center button is being released.- Returns:
- Is the right center button being released?
-
isXButtonReleased
public final boolean isXButtonReleased()Check if the X button is being released.- Returns:
- Is the X button being released?
-
isYButtonReleased
public final boolean isYButtonReleased()Check if the Y button is being released.- Returns:
- Is the Y button being released?
-
isBButtonReleased
public final boolean isBButtonReleased()Check if the B button is being released.- Returns:
- Is the B button being released?
-
isAButtonReleased
public final boolean isAButtonReleased()Check if the A button is being released.- Returns:
- Is the A button being released?
-
getDPADState
Get the state of the DPAD.- Returns:
- The state of the DPAD.
-
isDPAD
public final boolean isDPAD(int angle) Check if the the DPAD is at this angle.- Parameters:
angle
- The angle to check against.- Returns:
- Is the DPAD at this angle?
-
isDPAD
Check if the the DPAD is at this state.- Parameters:
angle
- The state to check against.- Returns:
- Is the DPAD at this state?
-
getDPADUp
Deprecated.Here for old API compatibility. Use the "isUpDown()" method insteadCheck if the DPAD up button is being held down.- Returns:
- Is the DPAD up button being held down?
-
getDPADUpRight
Deprecated.Here for old API compatibility. Use the "isUpRightDown()" method insteadCheck if the DPAD up right button is being held down.- Returns:
- Is the DPAD up right button being held down?
-
getDPADRight
Deprecated.Here for old API compatibility. Use the "isRightDown()" method insteadCheck if the DPAD right button is being held down.- Returns:
- Is the DPAD right button being held down?
-
getDPADDownRight
Deprecated.Here for old API compatibility. Use the "isDownRightDown()" method insteadCheck if the DPAD down right button is being held down.- Returns:
- Is the DPAD down right button being held down?
-
getDPADDown
Deprecated.Here for old API compatibility. Use the "isDownDown()" method insteadCheck if the DPAD down button is being held down.- Returns:
- Is the DPAD down button being held down?
-
getDPADDownLeft
Deprecated.Here for old API compatibility. Use the "isDownLeftDown()" method insteadCheck if the DPAD down left button is being held down.- Returns:
- Is the DPAD down left button being held down?
-
getDPADLeft
Deprecated.Here for old API compatibility. Use the "isLeftDown()" method insteadCheck if the DPAD left button is being held down.- Returns:
- Is the DPAD left button being held down?
-
getDPADUpLeft
Deprecated.Here for old API compatibility. Use the "isUpLeftDown()" method insteadCheck if the DPAD up left button is being held down.- Returns:
- Is the DPAD up left button being held down?
-
isDPADUpDown
public final boolean isDPADUpDown()Check if the DPAD up button is being held down.- Returns:
- Is the DPAD up button being held down?
-
isDPADUpRightDown
public final boolean isDPADUpRightDown()Check if the DPAD up right button is being held down.- Returns:
- Is the DPAD up right button being held down?
-
isDPADRightDown
public final boolean isDPADRightDown()Check if the DPAD right button is being held down.- Returns:
- Is the DPAD right button being held down?
-
isDPADDownRightDown
public final boolean isDPADDownRightDown()Check if the DPAD down right button is being held down.- Returns:
- Is the DPAD down right button being held down?
-
isDPADDownDown
public final boolean isDPADDownDown()Check if the DPAD down button is being held down.- Returns:
- Is the DPAD down button being held down?
-
isDPADDownLeftDown
public final boolean isDPADDownLeftDown()Check if the DPAD down left button is being held down.- Returns:
- Is the DPAD down left button being held down?
-
isDPADLeftDown
public final boolean isDPADLeftDown()Check if the DPAD left button is being held down.- Returns:
- Is the DPAD left button being held down?
-
isDPADUpLeftDown
public final boolean isDPADUpLeftDown()Check if the DPAD up left button is being held down.- Returns:
- Is the DPAD up left button being held down?
-
setRumbleLeft
public final void setRumbleLeft(boolean rumble) Set weather or not to rumble the left side.- Parameters:
rumble
- To rumble or not to rumble.
-
setRumbleRight
public final void setRumbleRight(boolean rumble) Set weather or not to rumble the right side.- Parameters:
rumble
- To rumble or not to rumble.
-
setRumble
public final void setRumble(boolean rumble) Set weather or not to rumble both sides.- Parameters:
rumble
- To rumble or not to rumble.
-
getActiveBooleanMethods
-
logActiveBooleanMethods
public final void logActiveBooleanMethods()
-