Class CommandXboxController
java.lang.Object
edu.wpi.first.wpilibj2.command.button.CommandGenericHID
edu.wpi.first.wpilibj2.command.button.CommandXboxController
A version of 
XboxController with Trigger factories for command-based.- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiona()Constructs a Trigger instance around the A button's digital signal.Constructs a Trigger instance around the A button's digital signal.b()Constructs a Trigger instance around the B button's digital signal.Constructs a Trigger instance around the B button's digital signal.back()Constructs a Trigger instance around the back button's digital signal.Constructs a Trigger instance around the back button's digital signal.getHID()Get the underlying GenericHID object.doubleGet the left trigger axis value of the controller.doublegetLeftX()Get the X axis value of left side of the controller.doublegetLeftY()Get the Y axis value of left side of the controller.doubleGet the right trigger axis value of the controller.doubleGet the X axis value of right side of the controller.doubleGet the Y axis value of right side of the controller.Constructs a Trigger instance around the left bumper button's digital signal.leftBumper(EventLoop loop) Constructs a Trigger instance around the left bumper button's digital signal.Constructs a Trigger instance around the left stick button's digital signal.Constructs a Trigger instance around the left stick button's digital signal.Constructs a Trigger instance around the axis value of the left trigger.leftTrigger(double threshold) Constructs a Trigger instance around the axis value of the left trigger.leftTrigger(double threshold, EventLoop loop) Constructs a Trigger instance around the axis value of the left trigger.Constructs a Trigger instance around the right bumper button's digital signal.rightBumper(EventLoop loop) Constructs a Trigger instance around the right bumper button's digital signal.Constructs a Trigger instance around the right stick button's digital signal.rightStick(EventLoop loop) Constructs a Trigger instance around the right stick button's digital signal.Constructs a Trigger instance around the axis value of the right trigger.rightTrigger(double threshold) Constructs a Trigger instance around the axis value of the right trigger.rightTrigger(double threshold, EventLoop loop) Constructs a Trigger instance around the axis value of the right trigger.start()Constructs a Trigger instance around the start button's digital signal.Constructs a Trigger instance around the start button's digital signal.x()Constructs a Trigger instance around the X button's digital signal.Constructs a Trigger instance around the X button's digital signal.y()Constructs a Trigger instance around the Y button's digital signal.Constructs a Trigger instance around the Y button's digital signal.Methods inherited from class edu.wpi.first.wpilibj2.command.button.CommandGenericHIDaxisGreaterThan, axisGreaterThan, axisLessThan, axisLessThan, axisMagnitudeGreaterThan, axisMagnitudeGreaterThan, button, button, getRawAxis, isConnected, pov, pov, povCenter, povDown, povDownLeft, povDownRight, povLeft, povRight, povUp, povUpLeft, povUpRight, setRumble
- 
Constructor Details- 
CommandXboxControllerConstruct an instance of a controller.- Parameters:
- port- The port index on the Driver Station that the controller is plugged into.
 
 
- 
- 
Method Details- 
getHIDGet the underlying GenericHID object.- Overrides:
- getHIDin class- CommandGenericHID
- Returns:
- the wrapped GenericHID object
 
- 
aConstructs a Trigger instance around the A button's digital signal.- Returns:
- a Trigger instance representing the A button's digital signal attached
     to the default scheduler button loop.
- See Also:
 
- 
aConstructs a Trigger instance around the A button's digital signal.- Parameters:
- loop- the event loop instance to attach the event to.
- Returns:
- a Trigger instance representing the A button's digital signal attached to the given loop.
 
- 
bConstructs a Trigger instance around the B button's digital signal.- Returns:
- a Trigger instance representing the B button's digital signal attached
     to the default scheduler button loop.
- See Also:
 
- 
bConstructs a Trigger instance around the B button's digital signal.- Parameters:
- loop- the event loop instance to attach the event to.
- Returns:
- a Trigger instance representing the B button's digital signal attached to the given loop.
 
- 
xConstructs a Trigger instance around the X button's digital signal.- Returns:
- a Trigger instance representing the X button's digital signal attached
     to the default scheduler button loop.
- See Also:
 
- 
xConstructs a Trigger instance around the X button's digital signal.- Parameters:
- loop- the event loop instance to attach the event to.
- Returns:
- a Trigger instance representing the X button's digital signal attached to the given loop.
 
- 
yConstructs a Trigger instance around the Y button's digital signal.- Returns:
- a Trigger instance representing the Y button's digital signal attached
     to the default scheduler button loop.
- See Also:
 
- 
yConstructs a Trigger instance around the Y button's digital signal.- Parameters:
- loop- the event loop instance to attach the event to.
- Returns:
- a Trigger instance representing the Y button's digital signal attached to the given loop.
 
- 
leftBumperConstructs a Trigger instance around the left bumper button's digital signal.- Returns:
- a Trigger instance representing the left bumper button's digital signal attached
     to the default scheduler button loop.
- See Also:
 
- 
leftBumperConstructs a Trigger instance around the left bumper button's digital signal.- Parameters:
- loop- the event loop instance to attach the event to.
- Returns:
- a Trigger instance representing the left bumper button's digital signal attached to the given loop.
 
- 
rightBumperConstructs a Trigger instance around the right bumper button's digital signal.- Returns:
- a Trigger instance representing the right bumper button's digital signal attached
     to the default scheduler button loop.
- See Also:
 
- 
rightBumperConstructs a Trigger instance around the right bumper button's digital signal.- Parameters:
- loop- the event loop instance to attach the event to.
- Returns:
- a Trigger instance representing the right bumper button's digital signal attached to the given loop.
 
- 
backConstructs a Trigger instance around the back button's digital signal.- Returns:
- a Trigger instance representing the back button's digital signal attached
     to the default scheduler button loop.
- See Also:
 
- 
backConstructs a Trigger instance around the back button's digital signal.- Parameters:
- loop- the event loop instance to attach the event to.
- Returns:
- a Trigger instance representing the back button's digital signal attached to the given loop.
 
- 
startConstructs a Trigger instance around the start button's digital signal.- Returns:
- a Trigger instance representing the start button's digital signal attached
     to the default scheduler button loop.
- See Also:
 
- 
startConstructs a Trigger instance around the start button's digital signal.- Parameters:
- loop- the event loop instance to attach the event to.
- Returns:
- a Trigger instance representing the start button's digital signal attached to the given loop.
 
- 
leftStickConstructs a Trigger instance around the left stick button's digital signal.- Returns:
- a Trigger instance representing the left stick button's digital signal attached
     to the default scheduler button loop.
- See Also:
 
- 
leftStickConstructs a Trigger instance around the left stick button's digital signal.- Parameters:
- loop- the event loop instance to attach the event to.
- Returns:
- a Trigger instance representing the left stick button's digital signal attached to the given loop.
 
- 
rightStickConstructs a Trigger instance around the right stick button's digital signal.- Returns:
- a Trigger instance representing the right stick button's digital signal attached
     to the default scheduler button loop.
- See Also:
 
- 
rightStickConstructs a Trigger instance around the right stick button's digital signal.- Parameters:
- loop- the event loop instance to attach the event to.
- Returns:
- a Trigger instance representing the right stick button's digital signal attached to the given loop.
 
- 
leftTriggerConstructs a Trigger instance around the axis value of the left trigger. The returned trigger will be true when the axis value is greater thanthreshold.- Parameters:
- threshold- the minimum axis value for the returned- Triggerto be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis.
- loop- the event loop instance to attach the Trigger to.
- Returns:
- a Trigger instance that is true when the left trigger's axis exceeds the provided threshold, attached to the given event loop
 
- 
leftTriggerConstructs a Trigger instance around the axis value of the left trigger. The returned trigger will be true when the axis value is greater thanthreshold.- Parameters:
- threshold- the minimum axis value for the returned- Triggerto be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis.
- Returns:
- a Trigger instance that is true when the left trigger's axis exceeds the provided
     threshold, attached to the default scheduler button loop.
 
- 
leftTriggerConstructs a Trigger instance around the axis value of the left trigger. The returned trigger will be true when the axis value is greater than 0.5.- Returns:
- a Trigger instance that is true when the left trigger's axis exceeds 0.5, attached to
     the default scheduler button loop.
 
- 
rightTriggerConstructs a Trigger instance around the axis value of the right trigger. The returned trigger will be true when the axis value is greater thanthreshold.- Parameters:
- threshold- the minimum axis value for the returned- Triggerto be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis.
- loop- the event loop instance to attach the Trigger to.
- Returns:
- a Trigger instance that is true when the right trigger's axis exceeds the provided threshold, attached to the given event loop
 
- 
rightTriggerConstructs a Trigger instance around the axis value of the right trigger. The returned trigger will be true when the axis value is greater thanthreshold.- Parameters:
- threshold- the minimum axis value for the returned- Triggerto be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis.
- Returns:
- a Trigger instance that is true when the right trigger's axis exceeds the provided
     threshold, attached to the default scheduler button loop.
 
- 
rightTriggerConstructs a Trigger instance around the axis value of the right trigger. The returned trigger will be true when the axis value is greater than 0.5.- Returns:
- a Trigger instance that is true when the right trigger's axis exceeds 0.5, attached to
     the default scheduler button loop.
 
- 
getLeftXGet the X axis value of left side of the controller. Right is positive.- Returns:
- The axis value.
 
- 
getRightXGet the X axis value of right side of the controller. Right is positive.- Returns:
- The axis value.
 
- 
getLeftYGet the Y axis value of left side of the controller. Back is positive.- Returns:
- The axis value.
 
- 
getRightYGet the Y axis value of right side of the controller. Back is positive.- Returns:
- The axis value.
 
- 
getLeftTriggerAxisGet the left trigger 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.
 
- 
getRightTriggerAxisGet the right trigger 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.
 
 
-