Package edu.wpi.first.wpilibj.simulation
Class PS4ControllerSim
java.lang.Object
edu.wpi.first.wpilibj.simulation.GenericHIDSim
edu.wpi.first.wpilibj.simulation.PS4ControllerSim
public class PS4ControllerSim extends GenericHIDSim
Class to control a simulated PS4 controller.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PS4ControllerSim(int port)
Constructs from a joystick port number.PS4ControllerSim(PS4Controller joystick)
Constructs from a PS4Controller object. -
Method Summary
Modifier and Type Method Description void
setCircleButton(boolean value)
Change the value of the Circle button on the controller.void
setCrossButton(boolean value)
Change the value of the Cross button on the controller.void
setL1Button(boolean value)
Change the value of the L1 button on the controller.void
setL2Axis(double value)
Change the L2 axis value of the controller.void
setL2Button(boolean value)
Change the value of the L2 button on the controller.void
setL3Button(boolean value)
Change the value of the L3 (left stick) button on the controller.void
setLeftX(double value)
Change the X axis value of the controller's left stick.void
setLeftY(double value)
Change the Y axis value of the controller's left stick.void
setOptionsButton(boolean value)
Change the value of the Options button on the controller.void
setPSButton(boolean value)
Change the value of the PS button on the controller.void
setR1Button(boolean value)
Change the value of the R1 button on the controller.void
setR2Axis(double value)
Change the R2 axis value of the controller.void
setR2Button(boolean value)
Change the value of the R2 button on the controller.void
setR3Button(boolean value)
Change the value of the R3 (right stick) button on the controller.void
setRightX(double value)
Change the X axis value of the controller's right stick.void
setRightY(double value)
Change the Y axis value of the controller's right stick.void
setShareButton(boolean value)
Change the value of the Share button on the controller.void
setSquareButton(boolean value)
Change the value of the Square button on the controller.void
setTouchpad(boolean value)
Change the value of the touchpad button on the controller.void
setTriangleButton(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
-
PS4ControllerSim
Constructs from a PS4Controller object.- Parameters:
joystick
- controller to simulate
-
PS4ControllerSim
Constructs from a joystick port number.- Parameters:
port
- port number
-
-
Method Details
-
setLeftX
Change the X axis value of the controller's left stick.- Parameters:
value
- the new value
-
setRightX
Change the X axis value of the controller's right stick.- Parameters:
value
- the new value
-
setLeftY
Change the Y axis value of the controller's left stick.- Parameters:
value
- the new value
-
setRightY
Change the Y axis value of the controller's right stick.- Parameters:
value
- the new value
-
setL2Axis
Change the L2 axis value of the controller.- Parameters:
value
- the new value
-
setR2Axis
Change the R2 axis value of 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 L1 button on the controller.- Parameters:
value
- the new value
-
setR1Button
Change the value of the R1 button on the controller.- Parameters:
value
- the new value
-
setL2Button
Change the value of the L2 button on the controller.- Parameters:
value
- the new value
-
setR2Button
Change the value of the R2 button on the controller.- Parameters:
value
- the new value
-
setShareButton
Change the value of the Share 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 PS button on the controller.- Parameters:
value
- the new value
-
setTouchpad
Change the value of the touchpad button on the controller.- Parameters:
value
- the new value
-