533 [[deprecated(
"Use GetTouchpadButton instead")]]
543 [[deprecated(
"Use GetTouchpadButtonPressed instead")]]
554 [[deprecated(
"Use GetTouchpadButtonReleased instead")]]
568 static constexpr int kL1 = 5;
570 static constexpr int kR1 = 6;
572 static constexpr int kL2 = 7;
574 static constexpr int kR2 = 8;
580 static constexpr int kL3 = 11;
582 static constexpr int kR3 = 12;
584 static constexpr int kPS = 13;
600 static constexpr int kL2 = 3;
602 static constexpr int kR2 = 4;
This class provides an easy way to link actions to active high logic signals.
Definition BooleanEvent.h:30
A declarative way to bind a set of actions to a loop and execute them when the loop is polled.
Definition EventLoop.h:15
Handle input from standard HID devices connected to the Driver Station.
Definition GenericHID.h:24
Handle input from PS5 controllers connected to the Driver Station.
Definition PS5Controller.h:30
bool GetOptionsButtonReleased()
Whether the options button was released since the last check.
bool GetSquareButtonPressed()
Whether the square button was pressed since the last check.
BooleanEvent PS(EventLoop *loop) const
Constructs an event instance around the PlayStation button's digital signal.
bool GetL3ButtonPressed()
Whether the L3 (left stick) button was pressed since the last check.
bool GetCrossButtonPressed()
Whether the cross button was pressed since the last check.
bool GetSquareButtonReleased()
Whether the square button was released since the last check.
bool GetTouchpadButtonReleased()
Whether the touchpad button was released since the last check.
void InitSendable(wpi::SendableBuilder &builder) override
Initializes this Sendable object.
bool GetCircleButtonReleased()
Whether the circle button was released since the last check.
bool GetCircleButtonPressed()
Whether the circle button was pressed since the last check.
bool GetL3ButtonReleased()
Whether the L3 (left stick) button was released since the last check.
bool GetTouchpadButtonPressed()
Whether the touchpad button was pressed since the last check.
~PS5Controller() override=default
bool GetPSButtonReleased()
Whether the PlayStation button was released since the last check.
BooleanEvent R2(EventLoop *loop) const
Constructs an event instance around the right trigger 2 button's digital signal.
BooleanEvent R1(EventLoop *loop) const
Constructs an event instance around the right trigger 1 button's digital signal.
bool GetL1ButtonReleased()
Whether the left trigger 1 button was released since the last check.
bool GetR1ButtonReleased()
Whether the right trigger 1 button was released since the last check.
BooleanEvent L2(EventLoop *loop) const
Constructs an event instance around the left trigger 2 button's digital signal.
PS5Controller & operator=(PS5Controller &&)=default
bool GetCircleButton() const
Read the value of the circle button on the controller.
bool GetTouchpadButton() const
Read the value of the touchpad button on the controller.
bool GetPSButtonPressed()
Whether the PlayStation button was pressed since the last check.
BooleanEvent Touchpad(EventLoop *loop) const
Constructs an event instance around the touchpad button's digital signal.
bool GetPSButton() const
Read the value of the PlayStation button on the controller.
PS5Controller(PS5Controller &&)=default
BooleanEvent L1(EventLoop *loop) const
Constructs an event instance around the left trigger 1 button's digital signal.
double GetLeftY() const
Get the Y axis value of left side of the controller.
bool GetSquareButton() const
Read the value of the square button on the controller.
bool GetR3ButtonReleased()
Whether the R3 (right stick) button was released since the last check.
bool GetL2ButtonReleased()
Whether the left trigger 2 button was released since the last check.
double GetR2Axis() const
Get the right trigger 2 axis value of the controller.
double GetRightY() const
Get the Y axis value of right side of the controller.
bool GetR3Button() const
Read the value of the R3 (right stick) button on the controller.
bool GetL2Button() const
Read the value of the left trigger 2 button on the controller.
BooleanEvent Circle(EventLoop *loop) const
Constructs an event instance around the circle button's digital signal.
BooleanEvent Square(EventLoop *loop) const
Constructs an event instance around the square button's digital signal.
double GetLeftX() const
Get the X axis value of left side of the controller.
bool GetR2Button() const
Read the value of the right trigger 2 button on the controller.
bool GetOptionsButton() const
Read the value of the options button on the controller.
BooleanEvent Create(EventLoop *loop) const
Constructs an event instance around the create button's digital signal.
bool GetTouchpad() const
Read the value of the touchpad button on the controller.
BooleanEvent R3(EventLoop *loop) const
Constructs an event instance around the R3 (right stick) button's digital signal.
bool GetL3Button() const
Read the value of the L3 (left stick) button on the controller.
bool GetTriangleButton() const
Read the value of the triangle button on the controller.
bool GetR2ButtonReleased()
Whether the right trigger 2 button was released since the last check.
bool GetL1Button() const
Read the value of the left trigger 1 button on the controller.
bool GetR2ButtonPressed()
Whether the right trigger 2 button was pressed since the last check.
bool GetTouchpadReleased()
Whether the touchpad was released since the last check.
bool GetOptionsButtonPressed()
Whether the options button was pressed since the last check.
bool GetTouchpadPressed()
Whether the touchpad was pressed since the last check.
double GetRightX() const
Get the X axis value of right side of the controller.
PS5Controller(int port)
Construct an instance of a controller.
BooleanEvent Cross(EventLoop *loop) const
Constructs an event instance around the cross button's digital signal.
bool GetL2ButtonPressed()
Whether the left trigger 2 button was pressed since the last check.
bool GetCrossButtonReleased()
Whether the cross button was released since the last check.
bool GetCreateButton() const
Read the value of the create button on the controller.
bool GetL1ButtonPressed()
Whether the left trigger 1 button was pressed since the last check.
bool GetCreateButtonPressed()
Whether the create button was pressed since the last check.
double GetL2Axis() const
Get the left trigger 2 axis value of the controller.
bool GetCreateButtonReleased()
Whether the create button was released since the last check.
bool GetTriangleButtonPressed()
Whether the triangle button was pressed since the last check.
bool GetR3ButtonPressed()
Whether the R3 (right stick) button was pressed since the last check.
bool GetTriangleButtonReleased()
Whether the triangle button was released since the last check.
bool GetR1ButtonPressed()
Whether the right trigger 1 button was pressed since the last check.
bool GetR1Button() const
Read the value of the right trigger 1 button on the controller.
bool GetCrossButton() const
Read the value of the cross button on the controller.
BooleanEvent Triangle(EventLoop *loop) const
Constructs an event instance around the triangle button's digital signal.
BooleanEvent L3(EventLoop *loop) const
Constructs an event instance around the L3 (left stick) button's digital signal.
BooleanEvent Options(EventLoop *loop) const
Constructs an event instance around the options button's digital signal.
Helper class for building Sendable dashboard representations.
Definition SendableBuilder.h:21
A helper class for use with objects that add themselves to SendableRegistry.
Definition SendableHelper.h:21
Interface for Sendable objects.
Definition Sendable.h:16
Represents an axis on an PS5Controller.
Definition PS5Controller.h:590
static constexpr int kRightY
Right Y axis.
Definition PS5Controller.h:598
static constexpr int kLeftY
Left Y axis.
Definition PS5Controller.h:594
static constexpr int kL2
Left trigger 2.
Definition PS5Controller.h:600
static constexpr int kLeftX
Left X axis.
Definition PS5Controller.h:592
static constexpr int kRightX
Right X axis.
Definition PS5Controller.h:596
static constexpr int kR2
Right trigger 2.
Definition PS5Controller.h:602