Class CommandNiDsPS4Controller
java.lang.Object
org.wpilib.command2.button.CommandGenericHID
org.wpilib.command2.button.CommandNiDsPS4Controller
A version of
NiDsPS4Controller with Trigger factories for command-based.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncircle()Constructs a Trigger instance around the circle button's digital signal.Constructs a Trigger instance around the circle button's digital signal.cross()Constructs a Trigger instance around the cross button's digital signal.Constructs a Trigger instance around the cross button's digital signal.getHID()Get the underlying GenericHID object.doubleGet the left trigger 2 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 2 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.L1()Constructs a Trigger instance around the left trigger 1 button's digital signal.Constructs a Trigger instance around the left trigger 1 button's digital signal.L2()Constructs a Trigger instance around the left trigger 2 button's digital signal.Constructs a Trigger instance around the left trigger 2 button's digital signal.L3()Constructs a Trigger instance around the L3 (left stick) button's digital signal.Constructs a Trigger instance around the L3 (left stick) button's digital signal.options()Constructs a Trigger instance around the options button's digital signal.Constructs a Trigger instance around the options button's digital signal.PS()Constructs a Trigger instance around the PlayStation button's digital signal.Constructs a Trigger instance around the PlayStation button's digital signal.R1()Constructs a Trigger instance around the right trigger 1 button's digital signal.Constructs a Trigger instance around the right trigger 1 button's digital signal.R2()Constructs a Trigger instance around the right trigger 2 button's digital signal.Constructs a Trigger instance around the right trigger 2 button's digital signal.R3()Constructs a Trigger instance around the R3 (right stick) button's digital signal.Constructs a Trigger instance around the R3 (right stick) button's digital signal.share()Constructs a Trigger instance around the share button's digital signal.Constructs a Trigger instance around the share button's digital signal.square()Constructs a Trigger instance around the square button's digital signal.Constructs a Trigger instance around the square button's digital signal.touchpad()Constructs a Trigger instance around the touchpad button's digital signal.Constructs a Trigger instance around the touchpad button's digital signal.triangle()Constructs a Trigger instance around the triangle button's digital signal.Constructs a Trigger instance around the triangle button's digital signal.Methods inherited from class CommandGenericHID
axisGreaterThan, axisGreaterThan, axisLessThan, axisLessThan, axisMagnitudeGreaterThan, axisMagnitudeGreaterThan, button, button, getRawAxis, isConnected, pov, pov, povCenter, povDown, povDownLeft, povDownRight, povLeft, povRight, povUp, povUpLeft, povUpRight, setRumble
-
Constructor Details
-
CommandNiDsPS4Controller
Construct an instance of a controller.- Parameters:
port- The port index on the Driver Station that the controller is plugged into.
-
-
Method Details
-
getHID
Get the underlying GenericHID object.- Overrides:
getHIDin classCommandGenericHID- Returns:
- the wrapped GenericHID object
-
square
Constructs a Trigger instance around the square button's digital signal.- Returns:
- a Trigger instance representing the square button's digital signal attached
to the
default scheduler button loop. - See Also:
-
square
-
cross
Constructs a Trigger instance around the cross button's digital signal.- Returns:
- a Trigger instance representing the cross button's digital signal attached
to the
default scheduler button loop. - See Also:
-
cross
-
circle
Constructs a Trigger instance around the circle button's digital signal.- Returns:
- a Trigger instance representing the circle button's digital signal attached
to the
default scheduler button loop. - See Also:
-
circle
-
triangle
Constructs a Trigger instance around the triangle button's digital signal.- Returns:
- a Trigger instance representing the triangle button's digital signal attached
to the
default scheduler button loop. - See Also:
-
triangle
-
L1
Constructs a Trigger instance around the left trigger 1 button's digital signal.- Returns:
- a Trigger instance representing the left trigger 1 button's digital signal attached
to the
default scheduler button loop. - See Also:
-
L1
-
R1
Constructs a Trigger instance around the right trigger 1 button's digital signal.- Returns:
- a Trigger instance representing the right trigger 1 button's digital signal attached
to the
default scheduler button loop. - See Also:
-
R1
-
L2
Constructs a Trigger instance around the left trigger 2 button's digital signal.- Returns:
- a Trigger instance representing the left trigger 2 button's digital signal attached
to the
default scheduler button loop. - See Also:
-
L2
-
R2
Constructs a Trigger instance around the right trigger 2 button's digital signal.- Returns:
- a Trigger instance representing the right trigger 2 button's digital signal attached
to the
default scheduler button loop. - See Also:
-
R2
-
options
Constructs a Trigger instance around the options button's digital signal.- Returns:
- a Trigger instance representing the options button's digital signal attached
to the
default scheduler button loop. - See Also:
-
options
-
L3
Constructs a Trigger instance around the L3 (left stick) button's digital signal.- Returns:
- a Trigger instance representing the L3 (left stick) button's digital signal attached
to the
default scheduler button loop. - See Also:
-
L3
-
R3
Constructs a Trigger instance around the R3 (right stick) button's digital signal.- Returns:
- a Trigger instance representing the R3 (right stick) button's digital signal attached
to the
default scheduler button loop. - See Also:
-
R3
-
PS
Constructs a Trigger instance around the PlayStation button's digital signal.- Returns:
- a Trigger instance representing the PlayStation button's digital signal attached
to the
default scheduler button loop. - See Also:
-
PS
-
touchpad
Constructs a Trigger instance around the touchpad button's digital signal.- Returns:
- a Trigger instance representing the touchpad button's digital signal attached
to the
default scheduler button loop. - See Also:
-
touchpad
-
getLeftX
Get the X axis value of left side of the controller. Right is positive.- Returns:
- The axis value.
-
getLeftY
Get the Y axis value of left side of the controller. Back is positive.- Returns:
- The axis value.
-
getRightX
Get the X axis value of right side of the controller. Right is positive.- Returns:
- The axis value.
-
getRightY
Get the Y axis value of right side of the controller. Back is positive.- Returns:
- The axis value.
-
getL2Axis
Get the left trigger 2 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.
-
getR2Axis
Get the right trigger 2 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.
-