WPILibC++ 2025.2.1
|
Class to control a simulated PS4 controller. More...
#include <frc/simulation/PS4ControllerSim.h>
Public Member Functions | |
PS4ControllerSim (const PS4Controller &joystick) | |
Constructs from a PS4Controller object. | |
PS4ControllerSim (int port) | |
Constructs from a joystick port number. | |
void | SetLeftX (double value) |
Change the left X value of the controller's joystick. | |
void | SetLeftY (double value) |
Change the left Y value of the controller's joystick. | |
void | SetRightX (double value) |
Change the right X value of the controller's joystick. | |
void | SetRightY (double value) |
Change the right Y value of the controller's joystick. | |
void | SetL2Axis (double value) |
Change the value of the left trigger 2 axis on the controller. | |
void | SetR2Axis (double value) |
Change the value of the right trigger 2 axis on the controller. | |
void | SetSquareButton (bool value) |
Change the value of the square button on the controller. | |
void | SetCrossButton (bool value) |
Change the value of the cross button on the controller. | |
void | SetCircleButton (bool value) |
Change the value of the circle button on the controller. | |
void | SetTriangleButton (bool value) |
Change the value of the triangle button on the controller. | |
void | SetL1Button (bool value) |
Change the value of the left trigger 1 button on the controller. | |
void | SetR1Button (bool value) |
Change the value of the right trigger 1 button on the controller. | |
void | SetL2Button (bool value) |
Change the value of the left trigger 2 button on the controller. | |
void | SetR2Button (bool value) |
Change the value of the right trigger 2 button on the controller. | |
void | SetShareButton (bool value) |
Change the value of the share button on the controller. | |
void | SetOptionsButton (bool value) |
Change the value of the options button on the controller. | |
void | SetL3Button (bool value) |
Change the value of the L3 (left stick) button on the controller. | |
void | SetR3Button (bool value) |
Change the value of the R3 (right stick) button on the controller. | |
void | SetPSButton (bool value) |
Change the value of the PlayStation button on the controller. | |
void | SetTouchpadButton (bool value) |
Change the value of the touchpad button on the controller. | |
void | SetTouchpad (bool value) |
Change the value of the touchpad button on the controller. | |
Public Member Functions inherited from frc::sim::GenericHIDSim | |
GenericHIDSim (const GenericHID &joystick) | |
Constructs from a GenericHID object. | |
GenericHIDSim (int port) | |
Constructs from a joystick port number. | |
void | NotifyNewData () |
Updates joystick data so that new values are visible to the user program. | |
void | SetRawButton (int button, bool value) |
Set the value of a given button. | |
void | SetRawAxis (int axis, double value) |
Set the value of a given axis. | |
void | SetPOV (int pov, int value) |
Set the value of a given POV. | |
void | SetPOV (int value) |
Set the value of the default POV (port 0). | |
void | SetAxisCount (int count) |
Set the axis count of this device. | |
void | SetPOVCount (int count) |
Set the POV count of this device. | |
void | SetButtonCount (int count) |
Set the button count of this device. | |
void | SetType (GenericHID::HIDType type) |
Set the type of this device. | |
void | SetName (const char *name) |
Set the name of this device. | |
void | SetAxisType (int axis, int type) |
Set the type of an axis. | |
bool | GetOutput (int outputNumber) |
Read the output of a button. | |
int64_t | GetOutputs () |
Get the encoded 16-bit integer that passes button values. | |
double | GetRumble (GenericHID::RumbleType type) |
Get the joystick rumble. | |
Additional Inherited Members | |
Protected Attributes inherited from frc::sim::GenericHIDSim | |
int | m_port |
GenericHID port. | |
Class to control a simulated PS4 controller.
|
explicit |
Constructs from a PS4Controller object.
joystick | controller to simulate |
|
explicit |
Constructs from a joystick port number.
port | port number |
void frc::sim::PS4ControllerSim::SetCircleButton | ( | bool | value | ) |
Change the value of the circle button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetCrossButton | ( | bool | value | ) |
Change the value of the cross button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetL1Button | ( | bool | value | ) |
Change the value of the left trigger 1 button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetL2Axis | ( | double | value | ) |
Change the value of the left trigger 2 axis on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetL2Button | ( | bool | value | ) |
Change the value of the left trigger 2 button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetL3Button | ( | bool | value | ) |
Change the value of the L3 (left stick) button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetLeftX | ( | double | value | ) |
Change the left X value of the controller's joystick.
value | the new value |
void frc::sim::PS4ControllerSim::SetLeftY | ( | double | value | ) |
Change the left Y value of the controller's joystick.
value | the new value |
void frc::sim::PS4ControllerSim::SetOptionsButton | ( | bool | value | ) |
Change the value of the options button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetPSButton | ( | bool | value | ) |
Change the value of the PlayStation button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetR1Button | ( | bool | value | ) |
Change the value of the right trigger 1 button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetR2Axis | ( | double | value | ) |
Change the value of the right trigger 2 axis on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetR2Button | ( | bool | value | ) |
Change the value of the right trigger 2 button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetR3Button | ( | bool | value | ) |
Change the value of the R3 (right stick) button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetRightX | ( | double | value | ) |
Change the right X value of the controller's joystick.
value | the new value |
void frc::sim::PS4ControllerSim::SetRightY | ( | double | value | ) |
Change the right Y value of the controller's joystick.
value | the new value |
void frc::sim::PS4ControllerSim::SetShareButton | ( | bool | value | ) |
Change the value of the share button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetSquareButton | ( | bool | value | ) |
Change the value of the square button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetTouchpad | ( | bool | value | ) |
Change the value of the touchpad button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetTouchpadButton | ( | bool | value | ) |
Change the value of the touchpad button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetTriangleButton | ( | bool | value | ) |
Change the value of the triangle button on the controller.
value | the new value |