Package edu.wpi.first.wpilibj.simulation
Class PS5ControllerSim
java.lang.Object
edu.wpi.first.wpilibj.simulation.GenericHIDSim
edu.wpi.first.wpilibj.simulation.PS5ControllerSim
Class to control a simulated PS5 controller.
-
Field Summary
Fields inherited from class edu.wpi.first.wpilibj.simulation.GenericHIDSim
m_port -
Constructor Summary
ConstructorsConstructorDescriptionPS5ControllerSim(int port) Constructs from a joystick port number.PS5ControllerSim(PS5Controller joystick) Constructs from a PS5Controller object. -
Method Summary
Modifier and TypeMethodDescriptionvoidsetCircleButton(boolean value) Change the value of the circle button on the controller.voidsetCreateButton(boolean value) Change the value of the create button on the controller.voidsetCrossButton(boolean value) Change the value of the cross button on the controller.voidsetL1Button(boolean value) Change the value of the left trigger 1 button on the controller.voidsetL2Axis(double value) Change the value of the left trigger 2 axis on the controller.voidsetL2Button(boolean value) Change the value of the left trigger 2 button on the controller.voidsetL3Button(boolean value) Change the value of the L3 (left stick) button on the controller.voidsetLeftX(double value) Change the left X value of the controller's joystick.voidsetLeftY(double value) Change the left Y value of the controller's joystick.voidsetOptionsButton(boolean value) Change the value of the options button on the controller.voidsetPSButton(boolean value) Change the value of the PlayStation button on the controller.voidsetR1Button(boolean value) Change the value of the right trigger 1 button on the controller.voidsetR2Axis(double value) Change the value of the right trigger 2 axis on the controller.voidsetR2Button(boolean value) Change the value of the right trigger 2 button on the controller.voidsetR3Button(boolean value) Change the value of the R3 (right stick) button on the controller.voidsetRightX(double value) Change the right X value of the controller's joystick.voidsetRightY(double value) Change the right Y value of the controller's joystick.voidsetSquareButton(boolean value) Change the value of the square button on the controller.voidsetTouchpad(boolean value) Deprecated, for removal: This API element is subject to removal in a future version.voidsetTouchpadButton(boolean value) Change the value of the touchpad button on the controller.voidsetTriangleButton(boolean value) Change the value of the triangle button on the controller.Methods inherited from class edu.wpi.first.wpilibj.simulation.GenericHIDSim
getOutput, getOutputs, getRumble, notifyNewData, setAxisCount, setAxisType, setButtonCount, setName, setPOV, setPOV, setPOVCount, setRawAxis, setRawButton, setType
-
Constructor Details
-
PS5ControllerSim
Constructs from a PS5Controller object.- Parameters:
joystick- controller to simulate
-
PS5ControllerSim
Constructs from a joystick port number.- Parameters:
port- port number
-
-
Method Details
-
setLeftX
Change the left X value of the controller's joystick.- Parameters:
value- the new value
-
setLeftY
Change the left Y value of the controller's joystick.- Parameters:
value- the new value
-
setRightX
Change the right X value of the controller's joystick.- Parameters:
value- the new value
-
setRightY
Change the right Y value of the controller's joystick.- Parameters:
value- the new value
-
setL2Axis
Change the value of the left trigger 2 axis on the controller.- Parameters:
value- the new value
-
setR2Axis
Change the value of the right trigger 2 axis on the controller.- Parameters:
value- the new value
-
setSquareButton
Change the value of the square button on the controller.- Parameters:
value- the new value
-
setCrossButton
Change the value of the cross button on the controller.- Parameters:
value- the new value
-
setCircleButton
Change the value of the circle button on the controller.- Parameters:
value- the new value
-
setTriangleButton
Change the value of the triangle button on the controller.- Parameters:
value- the new value
-
setL1Button
Change the value of the left trigger 1 button on the controller.- Parameters:
value- the new value
-
setR1Button
Change the value of the right trigger 1 button on the controller.- Parameters:
value- the new value
-
setL2Button
Change the value of the left trigger 2 button on the controller.- Parameters:
value- the new value
-
setR2Button
Change the value of the right trigger 2 button on the controller.- Parameters:
value- the new value
-
setCreateButton
Change the value of the create button on the controller.- Parameters:
value- the new value
-
setOptionsButton
Change the value of the options button on the controller.- Parameters:
value- the new value
-
setL3Button
Change the value of the L3 (left stick) button on the controller.- Parameters:
value- the new value
-
setR3Button
Change the value of the R3 (right stick) button on the controller.- Parameters:
value- the new value
-
setPSButton
Change the value of the PlayStation button on the controller.- Parameters:
value- the new value
-
setTouchpadButton
Change the value of the touchpad button on the controller.- Parameters:
value- the new value
-
setTouchpad
Deprecated, for removal: This API element is subject to removal in a future version.UsesetTouchpadButton(boolean)instead. This function is deprecated for removal to make function names consistent to allow the HID classes to be automatically generated.Change the value of the touchpad button on the controller.- Parameters:
value- the new value
-
setTouchpadButton(boolean)instead.