Class CommandXboxController

java.lang.Object
edu.wpi.first.wpilibj2.command.button.CommandGenericHID
edu.wpi.first.wpilibj2.command.button.CommandXboxController

public class CommandXboxController
extends CommandGenericHID
A subclass of XboxController with Trigger factories for command-based.
See Also:
XboxController
  • Constructor Details

  • Method Details

    • getHID

      Get the underlying GenericHID object.
      Overrides:
      getHID in class CommandGenericHID
      Returns:
      the wrapped GenericHID object
    • leftBumper

      public Trigger leftBumper()
      Constructs an event instance around the left bumper's digital signal.
      Returns:
      an event instance representing the left bumper's digital signal attached to the default scheduler button loop.
      See Also:
      leftBumper(EventLoop)
    • leftBumper

      public Trigger leftBumper​(EventLoop loop)
      Constructs an event instance around the left bumper's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      an event instance representing the right bumper's digital signal attached to the given loop.
    • rightBumper

      public Trigger rightBumper()
      Constructs an event instance around the right bumper's digital signal.
      Returns:
      an event instance representing the right bumper's digital signal attached to the default scheduler button loop.
      See Also:
      rightBumper(EventLoop)
    • rightBumper

      public Trigger rightBumper​(EventLoop loop)
      Constructs an event instance around the right bumper's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      an event instance representing the left bumper's digital signal attached to the given loop.
    • leftStick

      public Trigger leftStick()
      Constructs an event instance around the left stick button's digital signal.
      Returns:
      an event instance representing the left stick button's digital signal attached to the default scheduler button loop.
      See Also:
      leftStick(EventLoop)
    • leftStick

      public Trigger leftStick​(EventLoop loop)
      Constructs an event instance around the left stick button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      an event instance representing the left stick button's digital signal attached to the given loop.
    • rightStick

      public Trigger rightStick()
      Constructs an event instance around the right stick button's digital signal.
      Returns:
      an event instance representing the right stick button's digital signal attached to the default scheduler button loop.
      See Also:
      rightStick(EventLoop)
    • rightStick

      public Trigger rightStick​(EventLoop loop)
      Constructs an event instance around the right stick button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      an event instance representing the right stick button's digital signal attached to the given loop.
    • a

      public Trigger a()
      Constructs an event instance around the A button's digital signal.
      Returns:
      an event instance representing the A button's digital signal attached to the default scheduler button loop.
      See Also:
      a(EventLoop)
    • a

      public Trigger a​(EventLoop loop)
      Constructs an event instance around the A button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      an event instance representing the A button's digital signal attached to the given loop.
    • b

      public Trigger b()
      Constructs an event instance around the B button's digital signal.
      Returns:
      an event instance representing the B button's digital signal attached to the default scheduler button loop.
      See Also:
      b(EventLoop)
    • b

      public Trigger b​(EventLoop loop)
      Constructs an event instance around the B button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      an event instance representing the B button's digital signal attached to the given loop.
    • x

      public Trigger x()
      Constructs an event instance around the X button's digital signal.
      Returns:
      an event instance representing the X button's digital signal attached to the default scheduler button loop.
      See Also:
      x(EventLoop)
    • x

      public Trigger x​(EventLoop loop)
      Constructs an event instance around the X button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      an event instance representing the X button's digital signal attached to the given loop.
    • y

      public Trigger y()
      Constructs an event instance around the Y button's digital signal.
      Returns:
      an event instance representing the Y button's digital signal attached to the default scheduler button loop.
      See Also:
      y(EventLoop)
    • y

      public Trigger y​(EventLoop loop)
      Constructs an event instance around the Y button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      an event instance representing the Y button's digital signal attached to the given loop.
    • start

      public Trigger start()
      Constructs an event instance around the start button's digital signal.
      Returns:
      an event instance representing the start button's digital signal attached to the default scheduler button loop.
      See Also:
      start(EventLoop)
    • start

      public Trigger start​(EventLoop loop)
      Constructs an event instance around the start button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      an event instance representing the start button's digital signal attached to the given loop.
    • back

      public Trigger back()
      Constructs an event instance around the back button's digital signal.
      Returns:
      an event instance representing the back button's digital signal attached to the default scheduler button loop.
      See Also:
      back(EventLoop)
    • back

      public Trigger back​(EventLoop loop)
      Constructs an event instance around the back button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      an event instance representing the back button's digital signal attached to the given loop.
    • getLeftX

      public double getLeftX()
      Get the X axis value of left side of the controller.
      Returns:
      The axis value.
    • getRightX

      public double getRightX()
      Get the X axis value of right side of the controller.
      Returns:
      The axis value.
    • getLeftY

      public double getLeftY()
      Get the Y axis value of left side of the controller.
      Returns:
      The axis value.
    • getRightY

      public double getRightY()
      Get the Y axis value of right side of the controller.
      Returns:
      The axis value.
    • getLeftTriggerAxis

      public double getLeftTriggerAxis()
      Get the left trigger (LT) axis value of the controller. Note that this axis is bound to the range of [0, 1] as opposed to the usual [-1, 1].
      Returns:
      The axis value.
    • getRightTriggerAxis

      public double getRightTriggerAxis()
      Get the right trigger (RT) axis value of the controller. Note that this axis is bound to the range of [0, 1] as opposed to the usual [-1, 1].
      Returns:
      The axis value.