Package org.wpilib.commands3.button
Class CommandPS5Controller
java.lang.Object
org.wpilib.commands3.button.CommandGenericHID
org.wpilib.commands3.button.CommandPS5Controller
A version of
PS5Controller with Trigger factories for command-based.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCommandPS5Controller(int port) Construct an instance of a controller.CommandPS5Controller(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 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.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 org.wpilib.commands3.button.CommandGenericHID
axisGreaterThan, axisGreaterThan, axisLessThan, axisLessThan, axisMagnitudeGreaterThan, axisMagnitudeGreaterThan, button, button, getRawAxis, getScheduler, isConnected, pov, pov, povCenter, povDown, povDownLeft, povDownRight, povLeft, povRight, povUp, povUpLeft, povUpRight, setRumble
-
Constructor Details
-
CommandPS5Controller
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.
-
CommandPS5Controller
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 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 event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided. - See Also:
-
square
Constructs a Trigger instance around the square button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the square button's digital signal attached to the given loop.
-
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
Constructs a Trigger instance around the cross button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the cross button's digital signal attached to the given loop.
-
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
Constructs a Trigger instance around the circle button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the circle button's digital signal attached to the given loop.
-
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
Constructs a Trigger instance around the triangle button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the triangle button's digital signal attached to the given loop.
-
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
Constructs a Trigger instance around the left trigger 1 button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the left trigger 1 button's digital signal attached to the given loop.
-
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
Constructs a Trigger instance around the right trigger 1 button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the right trigger 1 button's digital signal attached to the given loop.
-
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
Constructs a Trigger instance around the left trigger 2 button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the left trigger 2 button's digital signal attached to the given loop.
-
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
Constructs a Trigger instance around the right trigger 2 button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the right trigger 2 button's digital signal attached to the given loop.
-
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
Constructs a Trigger instance around the create button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the create button's digital signal attached to the given loop.
-
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
Constructs a Trigger instance around the options button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the options button's digital signal attached to the given loop.
-
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
Constructs a Trigger instance around the L3 (left stick) button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the L3 (left stick) button's digital signal attached to the given loop.
-
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
Constructs a Trigger instance around the R3 (right stick) button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the R3 (right stick) button's digital signal attached to the given loop.
-
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
Constructs a Trigger instance around the PlayStation button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the PlayStation button's digital signal attached to the given loop.
-
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
Constructs a Trigger instance around the touchpad button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the touchpad button's digital signal attached to the given loop.
-
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.
-