Class TorqueController

java.lang.Object
org.texastorque.torquelib.sensors.TorqueController

public final class TorqueController extends Object
A class representation of a controller, used for gathering driver input.
  • 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

      public TorqueController(TorqueController.ControllerPort port)
      Create a new TorqueController.
      Parameters:
      port - The controller port.
    • TorqueController

      public TorqueController(TorqueController.ControllerPort port, double deadband)
      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 public final boolean getLeftTrigger()
      Deprecated.
      Here for old API compatibility. Use the "isLeftTriggerDown" method instead
      Check if the left trigger is currently down.
      Returns:
      Is the left trigger currently down?
    • getRightTrigger

      @Deprecated public final boolean getRightTrigger()
      Deprecated.
      Here for old API compatibility. Use the "isRightTriggerDown" method instead
      Check 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 public final boolean getLeftStickClick()
      Deprecated.
      Here for old API compatibility. Use the "isLeftStickClickDown" method instead
      Check if the left stick is currently down.
      Returns:
      Is the left stick currently down?
    • getRightStickClick

      @Deprecated public final boolean getRightStickClick()
      Deprecated.
      Here for old API compatibility. Use the "isRightStickClickDown" method instead
      Check if the right stick is currently down.
      Returns:
      Is the right stick currently down?
    • getLeftBumper

      @Deprecated public final boolean getLeftBumper()
      Deprecated.
      Here for old API compatibility. Use the "isLeftBumperDown" method instead
      Check if the left bumper is currently down.
      Returns:
      Is the left bumper currently down?
    • getRightBumper

      @Deprecated public final boolean getRightBumper()
      Deprecated.
      Here for old API compatibility. Use the "isRightBumperDown" method instead
      Check if the right bumper is currently down.
      Returns:
      Is the right bumper currently down?
    • getLeftCenterButton

      @Deprecated public final boolean getLeftCenterButton()
      Deprecated.
      Here for old API compatibility. Use the "isLeftCenterButtonDown" method instead
      Check if the left center button is currently down.
      Returns:
      Is the left center button currently down?
    • getRightCenterButton

      @Deprecated public final boolean getRightCenterButton()
      Deprecated.
      Here for old API compatibility. Use the "isRightCenterButtonDown" method instead
      Check if the right center button is currently down.
      Returns:
      Is the right center button currently down?
    • getXButton

      @Deprecated public final boolean getXButton()
      Deprecated.
      Here for old API compatibility. Use the "isXButtonDown" method instead
      Check if the X button is currently down.
      Returns:
      Is the X button currently down?
    • getYButton

      @Deprecated public final boolean getYButton()
      Deprecated.
      Here for old API compatibility. Use the "isYButtonDown" method instead
      Check if the Y button is currently down.
      Returns:
      Is the Y button currently down?
    • getBButton

      @Deprecated public final boolean getBButton()
      Deprecated.
      Here for old API compatibility. Use the "isBButtonDown" method instead
      Check if the B button is currently down.
      Returns:
      Is the B button currently down?
    • getAButton

      @Deprecated public final boolean getAButton()
      Deprecated.
      Here for old API compatibility. Use the "isAButtonDown" method instead
      Check 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

      public final TorqueController.DPADState 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

      public final boolean isDPAD(TorqueController.DPADState state)
      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 public final boolean getDPADUp()
      Deprecated.
      Here for old API compatibility. Use the "isUpDown()" method instead
      Check if the DPAD up button is being held down.
      Returns:
      Is the DPAD up button being held down?
    • getDPADUpRight

      @Deprecated public final boolean getDPADUpRight()
      Deprecated.
      Here for old API compatibility. Use the "isUpRightDown()" method instead
      Check if the DPAD up right button is being held down.
      Returns:
      Is the DPAD up right button being held down?
    • getDPADRight

      @Deprecated public final boolean getDPADRight()
      Deprecated.
      Here for old API compatibility. Use the "isRightDown()" method instead
      Check if the DPAD right button is being held down.
      Returns:
      Is the DPAD right button being held down?
    • getDPADDownRight

      @Deprecated public final boolean getDPADDownRight()
      Deprecated.
      Here for old API compatibility. Use the "isDownRightDown()" method instead
      Check if the DPAD down right button is being held down.
      Returns:
      Is the DPAD down right button being held down?
    • getDPADDown

      @Deprecated public final boolean getDPADDown()
      Deprecated.
      Here for old API compatibility. Use the "isDownDown()" method instead
      Check if the DPAD down button is being held down.
      Returns:
      Is the DPAD down button being held down?
    • getDPADDownLeft

      @Deprecated public final boolean getDPADDownLeft()
      Deprecated.
      Here for old API compatibility. Use the "isDownLeftDown()" method instead
      Check if the DPAD down left button is being held down.
      Returns:
      Is the DPAD down left button being held down?
    • getDPADLeft

      @Deprecated public final boolean getDPADLeft()
      Deprecated.
      Here for old API compatibility. Use the "isLeftDown()" method instead
      Check if the DPAD left button is being held down.
      Returns:
      Is the DPAD left button being held down?
    • getDPADUpLeft

      @Deprecated public final boolean getDPADUpLeft()
      Deprecated.
      Here for old API compatibility. Use the "isUpLeftDown()" method instead
      Check 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

      public final ArrayList<Method> getActiveBooleanMethods()
    • logActiveBooleanMethods

      public final void logActiveBooleanMethods()