CommandDualSenseEdgeController
- class commands2.button.CommandDualSenseEdgeController(hid: int | DualSenseEdgeController)[source]
Bases:
objectA version of
wpilib.DualSenseEdgeControllerwithTriggerfactories for command-based.Construct an instance of a controller.
- Parameters:
hid – The port index on the Driver Station that the controller is plugged into, or the DualSenseEdgeController object to use for this controller.
- axis_greater_than(axis: Axis, threshold: float, loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance that is true when the axis value is greater than
threshold, attached to the given loop.- Parameters:
axis – the
wpilib.DualSenseEdgeController.Axisto readthreshold – the value above which this Trigger should return true.
loop – the event loop instance to attach the Trigger to.
- Returns:
a Trigger instance that is true when the axis value is greater than the provided threshold.
- axis_less_than(axis: Axis, threshold: float, loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance that is true when the axis value is less than
threshold, attached to the given loop.- Parameters:
axis – the
wpilib.DualSenseEdgeController.Axisto readthreshold – the value below which this Trigger should return true.
loop – the event loop instance to attach the Trigger to
- Returns:
a Trigger instance that is true when the axis value is less than the provided threshold.
- axis_magnitude_greater_than(axis: Axis, threshold: float, loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance that is true when the axis magnitude is greater than
threshold, attached to the given loop.- Parameters:
axis – the
wpilib.DualSenseEdgeController.Axisto readthreshold – the value above which this Trigger should return true.
loop – the event loop instance to attach the Trigger to.
- Returns:
a Trigger instance that is true when the axis magnitude is greater than the provided threshold.
- button(button: Button, loop: EventLoop | None = None) Trigger[source]
Constructs an event instance around this button’s digital signal.
- Parameters:
button – the
wpilib.DualSenseEdgeController.Buttonto readloop – the event loop instance to attach the event to
- circle(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the Circle button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the Circle button’s digital signal attached to the given loop.
- create(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the Create button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the Create button’s digital signal attached to the given loop.
- cross(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the Cross button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the Cross button’s digital signal attached to the given loop.
- dpad_down(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the Dpad Down button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the Dpad Down button’s digital signal attached to the given loop.
- dpad_left(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the Dpad Left button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the Dpad Left button’s digital signal attached to the given loop.
- dpad_right(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the Dpad Right button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the Dpad Right button’s digital signal attached to the given loop.
- dpad_up(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the Dpad Up button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the Dpad Up button’s digital signal attached to the given loop.
- get_axis(axis: Axis) float[source]
Get the value of the axis.
- Parameters:
axis – the
wpilib.DualSenseEdgeController.Axisto read
- get_controller() DualSenseEdgeController[source]
Get the wrapped controller object.
- Returns:
the wrapped controller object
- get_hid() CommandGenericHID[source]
Get the underlying CommandGenericHID object.
- Returns:
the wrapped CommandGenericHID object
- l1(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the L1 button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the L1 button’s digital signal attached to the given loop.
- l2(threshold: float = 0.5, loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the L2 axis value. The returned Trigger will be true when the axis value is greater than
threshold.- Parameters:
threshold – the minimum axis value for the returned Trigger to 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, defaults to
commands2.CommandScheduler.get_default_button_loop()
- Returns:
a Trigger instance that is true when the L2 axis exceeds the provided threshold, attached to the given event loop.
- l3(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the L3 button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the L3 button’s digital signal attached to the given loop.
- left_function(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the Left Function button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the Left Function button’s digital signal attached to the given loop.
- left_paddle1(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the Left Paddle 1 button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the Left Paddle 1 button’s digital signal attached to the given loop.
- microphone(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the Microphone button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the Microphone button’s digital signal attached to the given loop.
- options(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the Options button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the Options button’s digital signal attached to the given loop.
- ps(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the PS button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the PS button’s digital signal attached to the given loop.
- r1(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the R1 button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the R1 button’s digital signal attached to the given loop.
- r2(threshold: float = 0.5, loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the R2 axis value. The returned Trigger will be true when the axis value is greater than
threshold.- Parameters:
threshold – the minimum axis value for the returned Trigger to 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, defaults to
commands2.CommandScheduler.get_default_button_loop()
- Returns:
a Trigger instance that is true when the R2 axis exceeds the provided threshold, attached to the given event loop.
- r3(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the R3 button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the R3 button’s digital signal attached to the given loop.
- right_function(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the Right Function button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the Right Function button’s digital signal attached to the given loop.
- right_paddle1(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the Right Paddle 1 button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the Right Paddle 1 button’s digital signal attached to the given loop.
- square(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the Square button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the Square button’s digital signal attached to the given loop.
- touchpad(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the Touchpad button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the Touchpad button’s digital signal attached to the given loop.
- triangle(loop: EventLoop | None = None) Trigger[source]
Constructs a Trigger instance around the Triangle button’s digital signal.
- Parameters:
loop – the event loop instance to attach the Trigger to, defaults to
commands2.CommandScheduler.get_default_button_loop()- Returns:
a Trigger instance representing the Triangle button’s digital signal attached to the given loop.