Class CommandDualSenseController
java.lang.Object
org.wpilib.command3.button.CommandDualSenseController
A version of
DualSenseController with Trigger factories for command-based.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCommandDualSenseController(int port) Construct an instance of a controller.CommandDualSenseController(Scheduler scheduler, int port) Construct an instance of a controller.CommandDualSenseController(Scheduler scheduler, DualSenseController controller) Construct an instance of a controller.CommandDualSenseController(DualSenseController controller) 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.dpadDown()Constructs a Trigger instance around the Dpad Down button's digital signal.Constructs a Trigger instance around the Dpad Down button's digital signal.dpadLeft()Constructs a Trigger instance around the Dpad Left button's digital signal.Constructs a Trigger instance around the Dpad Left button's digital signal.Constructs a Trigger instance around the Dpad Right button's digital signal.Constructs a Trigger instance around the Dpad Right button's digital signal.dpadUp()Constructs a Trigger instance around the Dpad Up button's digital signal.Constructs a Trigger instance around the Dpad Up button's digital signal.Get the wrapped controller object.getHID()Get the underlying CommandGenericHID object.doublegetL2()Get the L 2 value of the controller.doublegetLeftX()Get the Left X value of the controller.doublegetLeftY()Get the Left Y value of the controller.doublegetR2()Get the R 2 value of the controller.doubleGet the Right X value of the controller.doubleGet the Right Y value of the controller.L1()Constructs a Trigger instance around the L 1 button's digital signal.Constructs a Trigger instance around the L 1 button's digital signal.L2()Constructs a Trigger instance around the axis value of the L 2.L2(double threshold) Constructs a Trigger instance around the axis value of the L 2.Constructs a Trigger instance around the axis value of the L 2.L3()Constructs a Trigger instance around the L 3 button's digital signal.Constructs a Trigger instance around the L 3 button's digital signal.Constructs a Trigger instance around the Microphone button's digital signal.microphone(EventLoop loop) Constructs a Trigger instance around the Microphone 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 PS button's digital signal.Constructs a Trigger instance around the PS button's digital signal.R1()Constructs a Trigger instance around the R 1 button's digital signal.Constructs a Trigger instance around the R 1 button's digital signal.R2()Constructs a Trigger instance around the axis value of the R 2.R2(double threshold) Constructs a Trigger instance around the axis value of the R 2.Constructs a Trigger instance around the axis value of the R 2.R3()Constructs a Trigger instance around the R 3 button's digital signal.Constructs a Trigger instance around the R 3 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
-
CommandDualSenseController
public CommandDualSenseController(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.
-
CommandDualSenseController
Construct an instance of a controller. Commands bound to buttons on the controller will be scheduled on thedefault schedulerusing its default event loop.- Parameters:
controller- The DualSenseController object to use for this controller.
-
CommandDualSenseController
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.
-
CommandDualSenseController
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.controller- The DualSenseController object to use for this controller.
-
-
Method Details
-
getHID
Get the underlying CommandGenericHID object.- Returns:
- the wrapped CommandGenericHID object
-
getController
Get the wrapped controller object.- Returns:
- the wrapped controller object
-
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
-
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
-
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
-
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
-
PS
Constructs a Trigger instance around the PS button's digital signal.- Returns:
- a Trigger instance representing the PS 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
-
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 L 3 button's digital signal.- Returns:
- a Trigger instance representing the L 3 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 R 3 button's digital signal.- Returns:
- a Trigger instance representing the R 3 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
-
L1
Constructs a Trigger instance around the L 1 button's digital signal.- Returns:
- a Trigger instance representing the L 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 R 1 button's digital signal.- Returns:
- a Trigger instance representing the R 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
-
dpadUp
Constructs a Trigger instance around the Dpad Up button's digital signal.- Returns:
- a Trigger instance representing the Dpad Up 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:
-
dpadUp
-
dpadDown
Constructs a Trigger instance around the Dpad Down button's digital signal.- Returns:
- a Trigger instance representing the Dpad Down 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:
-
dpadDown
-
dpadLeft
Constructs a Trigger instance around the Dpad Left button's digital signal.- Returns:
- a Trigger instance representing the Dpad Left 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:
-
dpadLeft
-
dpadRight
Constructs a Trigger instance around the Dpad Right button's digital signal.- Returns:
- a Trigger instance representing the Dpad Right 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:
-
dpadRight
-
microphone
Constructs a Trigger instance around the Microphone button's digital signal.- Returns:
- a Trigger instance representing the Microphone 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:
-
microphone
-
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
-
L2
Constructs a Trigger instance around the axis value of the L 2. The returned trigger will be true when the axis value is greater thanthreshold.- Parameters:
threshold- the minimum axis value for the returnedTriggerto 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 L 2 axis exceeds the provided threshold, attached to the given event loop
-
L2
Constructs a Trigger instance around the axis value of the L 2. The returned trigger will be true when the axis value is greater thanthreshold.- Parameters:
threshold- the minimum axis value for the returnedTriggerto 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 L 2 axis exceeds the provided
threshold, attached to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided.
-
L2
Constructs a Trigger instance around the axis value of the L 2. The returned trigger will be true when the axis value is greater than 0.5.- Returns:
- a Trigger instance that is true when the L 2 axis exceeds 0.5, attached to
the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided.
-
R2
Constructs a Trigger instance around the axis value of the R 2. The returned trigger will be true when the axis value is greater thanthreshold.- Parameters:
threshold- the minimum axis value for the returnedTriggerto 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 R 2 axis exceeds the provided threshold, attached to the given event loop
-
R2
Constructs a Trigger instance around the axis value of the R 2. The returned trigger will be true when the axis value is greater thanthreshold.- Parameters:
threshold- the minimum axis value for the returnedTriggerto 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 R 2 axis exceeds the provided
threshold, attached to the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided.
-
R2
Constructs a Trigger instance around the axis value of the R 2. The returned trigger will be true when the axis value is greater than 0.5.- Returns:
- a Trigger instance that is true when the R 2 axis exceeds 0.5, attached to
the
default scheduler event loopon the scheduler passed to the controller's constructor, or thedefault schedulerif a scheduler was not explicitly provided.
-
getLeftX
public double getLeftX()Get the Left X value of the controller.- Returns:
- The axis value.
-
getLeftY
public double getLeftY()Get the Left Y value of the controller.- Returns:
- The axis value.
-
getRightX
public double getRightX()Get the Right X value of the controller.- Returns:
- The axis value.
-
getRightY
public double getRightY()Get the Right Y value of the controller.- Returns:
- The axis value.
-
getL2
public double getL2()Get the L 2 value of the controller.- Returns:
- The axis value.
-
getR2
public double getR2()Get the R 2 value of the controller.- Returns:
- The axis value.
-