Class CommandNiDsPS5Controller
java.lang.Object
org.wpilib.command3.button.CommandNiDsPS5Controller
A version of
NiDsPS5Controller with Trigger factories for command-based.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCommandNiDsPS5Controller(int port) Construct an instance of a controller.CommandNiDsPS5Controller(Scheduler scheduler, int port) Construct an instance of a controller. -
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.create()Constructs a Trigger instance around the create button's digital signal.Constructs a Trigger instance around the create 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 CommandGenericHID 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.Get the underlying NiDsPS5Controller object.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.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.
-
Constructor Details
-
CommandNiDsPS5Controller
public CommandNiDsPS5Controller(int port) Construct an instance of a controller. Commands bound to buttons on the controller will be scheduled on thedefault schedulerusing its default event loop.- Parameters:
port- The port index on the Driver Station that the controller is plugged into.
-
CommandNiDsPS5Controller
Construct an instance of a controller. Commands bound to buttons on the controller will be scheduled on the given scheduler using its default event loop.- Parameters:
scheduler- The scheduler that should execute the triggered commands.port- The port index on the Driver Station that the controller is plugged into.
-
-
Method Details
-
getHID
Get the underlying CommandGenericHID object.- Returns:
- the wrapped CommandGenericHID object
-
getNiDsPS5Controller
Get the underlying NiDsPS5Controller object.- Returns:
- the wrapped NiDsPS5Controller 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 event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - 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 event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - 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 event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - 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 event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - 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 event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - 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 event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - 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 event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - 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 event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
R2
-
create
Constructs a Trigger instance around the create button's digital signal.- Returns:
- a Trigger instance representing the create button's digital signal attached
to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
create
-
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 event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - 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 event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - 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 event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - 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 event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - 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 event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
touchpad
-
getLeftX
public double getLeftX()Get the X axis value of left side of the controller. Right is positive.- Returns:
- The axis value.
-
getLeftY
public double getLeftY()Get the Y axis value of left side of the controller. Back is positive.- Returns:
- The axis value.
-
getRightX
public double getRightX()Get the X axis value of right side of the controller. Right is positive.- Returns:
- The axis value.
-
getRightY
public double getRightY()Get the Y axis value of right side of the controller. Back is positive.- Returns:
- The axis value.
-
getL2Axis
public double 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
public double 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.
-