WPILibC++ 2024.3.2
frc::sim::PS5ControllerSim Class Reference

Class to control a simulated PS5 controller. More...

#include <frc/simulation/PS5ControllerSim.h>

Inheritance diagram for frc::sim::PS5ControllerSim:
frc::sim::GenericHIDSim

Public Member Functions

 PS5ControllerSim (const PS5Controller &joystick)
 Constructs from a PS5Controller object. More...
 
 PS5ControllerSim (int port)
 Constructs from a joystick port number. More...
 
void SetLeftX (double value)
 Change the X axis value of the controller's left stick. More...
 
void SetRightX (double value)
 Change the X axis value of the controller's right stick. More...
 
void SetLeftY (double value)
 Change the Y axis value of the controller's left stick. More...
 
void SetRightY (double value)
 Change the Y axis value of the controller's right stick. More...
 
void SetL2Axis (double value)
 Change the L2 axis axis value of the controller. More...
 
void SetR2Axis (double value)
 Change the R2 axis value of the controller. More...
 
void SetSquareButton (bool value)
 Change the value of the Square button on the controller. More...
 
void SetCrossButton (bool value)
 Change the value of the Cross button on the controller. More...
 
void SetCircleButton (bool value)
 Change the value of the Circle button on the controller. More...
 
void SetTriangleButton (bool value)
 Change the value of the Triangle button on the controller. More...
 
void SetL1Button (bool value)
 Change the value of the L1 button on the controller. More...
 
void SetR1Button (bool value)
 Change the value of the R1 button on the controller. More...
 
void SetL2Button (bool value)
 Change the value of the L2 button on the controller. More...
 
void SetR2Button (bool value)
 Change the value of the R2 button on the controller. More...
 
void SetCreateButton (bool value)
 Change the value of the Create button on the controller. More...
 
void SetOptionsButton (bool value)
 Change the value of the Options button on the controller. More...
 
void SetL3Button (bool value)
 Change the value of the L3 (left stick) button on the controller. More...
 
void SetR3Button (bool value)
 Change the value of the R3 (right stick) button on the controller. More...
 
void SetPSButton (bool value)
 Change the value of the PS button on the controller. More...
 
void SetTouchpad (bool value)
 Change the value of the touchpad button on the controller. More...
 
- Public Member Functions inherited from frc::sim::GenericHIDSim
 GenericHIDSim (const GenericHID &joystick)
 Constructs from a GenericHID object. More...
 
 GenericHIDSim (int port)
 Constructs from a joystick port number. More...
 
void NotifyNewData ()
 Updates joystick data so that new values are visible to the user program. More...
 
void SetRawButton (int button, bool value)
 Set the value of a given button. More...
 
void SetRawAxis (int axis, double value)
 Set the value of a given axis. More...
 
void SetPOV (int pov, int value)
 Set the value of a given POV. More...
 
void SetPOV (int value)
 Set the value of the default POV (port 0). More...
 
void SetAxisCount (int count)
 Set the axis count of this device. More...
 
void SetPOVCount (int count)
 Set the POV count of this device. More...
 
void SetButtonCount (int count)
 Set the button count of this device. More...
 
void SetType (GenericHID::HIDType type)
 Set the type of this device. More...
 
void SetName (const char *name)
 Set the name of this device. More...
 
void SetAxisType (int axis, int type)
 Set the type of an axis. More...
 
bool GetOutput (int outputNumber)
 Read the output of a button. More...
 
int64_t GetOutputs ()
 Get the encoded 16-bit integer that passes button values. More...
 
double GetRumble (GenericHID::RumbleType type)
 Get the joystick rumble. More...
 

Additional Inherited Members

- Protected Attributes inherited from frc::sim::GenericHIDSim
int m_port
 GenericHID port. More...
 

Detailed Description

Class to control a simulated PS5 controller.

Constructor & Destructor Documentation

◆ PS5ControllerSim() [1/2]

frc::sim::PS5ControllerSim::PS5ControllerSim ( const PS5Controller joystick)
explicit

Constructs from a PS5Controller object.

Parameters
joystickcontroller to simulate

◆ PS5ControllerSim() [2/2]

frc::sim::PS5ControllerSim::PS5ControllerSim ( int  port)
explicit

Constructs from a joystick port number.

Parameters
portport number

Member Function Documentation

◆ SetCircleButton()

void frc::sim::PS5ControllerSim::SetCircleButton ( bool  value)

Change the value of the Circle button on the controller.

Parameters
valuethe new value

◆ SetCreateButton()

void frc::sim::PS5ControllerSim::SetCreateButton ( bool  value)

Change the value of the Create button on the controller.

Parameters
valuethe new value

◆ SetCrossButton()

void frc::sim::PS5ControllerSim::SetCrossButton ( bool  value)

Change the value of the Cross button on the controller.

Parameters
valuethe new value

◆ SetL1Button()

void frc::sim::PS5ControllerSim::SetL1Button ( bool  value)

Change the value of the L1 button on the controller.

Parameters
valuethe new value

◆ SetL2Axis()

void frc::sim::PS5ControllerSim::SetL2Axis ( double  value)

Change the L2 axis axis value of the controller.

Parameters
valuethe new value

◆ SetL2Button()

void frc::sim::PS5ControllerSim::SetL2Button ( bool  value)

Change the value of the L2 button on the controller.

Parameters
valuethe new value

◆ SetL3Button()

void frc::sim::PS5ControllerSim::SetL3Button ( bool  value)

Change the value of the L3 (left stick) button on the controller.

Parameters
valuethe new value

◆ SetLeftX()

void frc::sim::PS5ControllerSim::SetLeftX ( double  value)

Change the X axis value of the controller's left stick.

Parameters
valuethe new value

◆ SetLeftY()

void frc::sim::PS5ControllerSim::SetLeftY ( double  value)

Change the Y axis value of the controller's left stick.

Parameters
valuethe new value

◆ SetOptionsButton()

void frc::sim::PS5ControllerSim::SetOptionsButton ( bool  value)

Change the value of the Options button on the controller.

Parameters
valuethe new value

◆ SetPSButton()

void frc::sim::PS5ControllerSim::SetPSButton ( bool  value)

Change the value of the PS button on the controller.

Parameters
valuethe new value

◆ SetR1Button()

void frc::sim::PS5ControllerSim::SetR1Button ( bool  value)

Change the value of the R1 button on the controller.

Parameters
valuethe new value

◆ SetR2Axis()

void frc::sim::PS5ControllerSim::SetR2Axis ( double  value)

Change the R2 axis value of the controller.

Parameters
valuethe new value

◆ SetR2Button()

void frc::sim::PS5ControllerSim::SetR2Button ( bool  value)

Change the value of the R2 button on the controller.

Parameters
valuethe new value

◆ SetR3Button()

void frc::sim::PS5ControllerSim::SetR3Button ( bool  value)

Change the value of the R3 (right stick) button on the controller.

Parameters
valuethe new value

◆ SetRightX()

void frc::sim::PS5ControllerSim::SetRightX ( double  value)

Change the X axis value of the controller's right stick.

Parameters
valuethe new value

◆ SetRightY()

void frc::sim::PS5ControllerSim::SetRightY ( double  value)

Change the Y axis value of the controller's right stick.

Parameters
valuethe new value

◆ SetSquareButton()

void frc::sim::PS5ControllerSim::SetSquareButton ( bool  value)

Change the value of the Square button on the controller.

Parameters
valuethe new value

◆ SetTouchpad()

void frc::sim::PS5ControllerSim::SetTouchpad ( bool  value)

Change the value of the touchpad button on the controller.

Parameters
valuethe new value

◆ SetTriangleButton()

void frc::sim::PS5ControllerSim::SetTriangleButton ( bool  value)

Change the value of the Triangle button on the controller.

Parameters
valuethe new value

The documentation for this class was generated from the following file: