CommandNiDsPS4Controller

class commands2.button.CommandNiDsPS4Controller(port: int)[source]

Bases: object

A version of NI DS PS4Controller with Trigger factories for command-based.

Construct an instance of a device.

Parameters:

port – The port index on the Driver Station that the device is plugged into.

circle(loop: EventLoop | None = None) Trigger[source]

Constructs an event instance around the circle button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to, defaults to commands2.CommandScheduler.get_default_button_loop()

Returns:

an event instance representing the circle button’s digital signal attached to the given loop.

cross(loop: EventLoop | None = None) Trigger[source]

Constructs an event instance around the cross button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to, defaults to commands2.CommandScheduler.get_default_button_loop()

Returns:

an event instance representing the cross button’s digital signal attached to the given loop.

get_hid() CommandGenericHID[source]

Get the underlying CommandGenericHID object.

Returns:

the wrapped CommandGenericHID object

get_l2_axis() float[source]

Get the L2 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.

get_left_x() float[source]

Get the X axis value of left side of the controller. Right is positive.

Returns:

the axis value.

get_left_y() float[source]

Get the Y axis value of left side of the controller. Back is positive.

Returns:

the axis value.

get_ni_ds_ps4_controller() NiDsPS4Controller[source]

Get the underlying NiDsPS4Controller object.

Returns:

the wrapped NiDsPS4Controller object

get_r2_axis() float[source]

Get the R2 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.

get_right_x() float[source]

Get the X axis value of right side of the controller. Right is positive.

Returns:

the axis value.

get_right_y() float[source]

Get the Y axis value of right side of the controller. Back is positive.

Returns:

the axis value.

l1(loop: EventLoop | None = None) Trigger[source]

Constructs an event instance around the L1 button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to, defaults to commands2.CommandScheduler.get_default_button_loop()

Returns:

an event instance representing the L1 button’s digital signal attached to the given loop.

l2(loop: EventLoop | None = None) Trigger[source]

Constructs an event instance around the L2 button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to, defaults to commands2.CommandScheduler.get_default_button_loop()

Returns:

an event instance representing the L2 button’s digital signal attached to the given loop.

l3(loop: EventLoop | None = None) Trigger[source]

Constructs an event instance around the L3 button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to, defaults to commands2.CommandScheduler.get_default_button_loop()

Returns:

an event instance representing the L3 button’s digital signal attached to the given loop.

options(loop: EventLoop | None = None) Trigger[source]

Constructs an event instance around the options button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to, defaults to commands2.CommandScheduler.get_default_button_loop()

Returns:

an event instance representing the options button’s digital signal attached to the given loop.

ps(loop: EventLoop | None = None) Trigger[source]

Constructs an event instance around the PS button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to, defaults to commands2.CommandScheduler.get_default_button_loop()

Returns:

an event instance representing the PS button’s digital signal attached to the given loop.

r1(loop: EventLoop | None = None) Trigger[source]

Constructs an event instance around the R1 button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to, defaults to commands2.CommandScheduler.get_default_button_loop()

Returns:

an event instance representing the R1 button’s digital signal attached to the given loop.

r2(loop: EventLoop | None = None) Trigger[source]

Constructs an event instance around the R2 button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to, defaults to commands2.CommandScheduler.get_default_button_loop()

Returns:

an event instance representing the R2 button’s digital signal attached to the given loop.

r3(loop: EventLoop | None = None) Trigger[source]

Constructs an event instance around the R3 button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to, defaults to commands2.CommandScheduler.get_default_button_loop()

Returns:

an event instance representing the R3 button’s digital signal attached to the given loop.

share(loop: EventLoop | None = None) Trigger[source]

Constructs an event instance around the share button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to, defaults to commands2.CommandScheduler.get_default_button_loop()

Returns:

an event instance representing the share button’s digital signal attached to the given loop.

square(loop: EventLoop | None = None) Trigger[source]

Constructs an event instance around the square button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to, defaults to commands2.CommandScheduler.get_default_button_loop()

Returns:

an event instance representing the square button’s digital signal attached to the given loop.

touchpad(loop: EventLoop | None = None) Trigger[source]

Constructs an event instance around the touchpad’s digital signal.

Parameters:

loop – the event loop instance to attach the event to, defaults to commands2.CommandScheduler.get_default_button_loop()

Returns:

an event instance representing the touchpad’s digital signal attached to the given loop.

triangle(loop: EventLoop | None = None) Trigger[source]

Constructs an event instance around the triangle button’s digital signal.

Parameters:

loop – the event loop instance to attach the event to, defaults to commands2.CommandScheduler.get_default_button_loop()

Returns:

an event instance representing the triangle button’s digital signal attached to the given loop.