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 voidsetCircleButton(boolean value)Change the value of the Circle 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 L1 button on the controller.voidsetL2Axis(double value)Change the L2 axis axis value of the controller.voidsetL2Button(boolean value)Change the value of the L2 button on the controller.voidsetL3Button(boolean value)Change the value of the L3 (left stick) button on the controller.voidsetLeftX(double value)Change the X axis value of the controller's left stick.voidsetLeftY(double value)Change the Y axis value of the controller's left stick.voidsetOptionsButton(boolean value)Change the value of the Options button on the controller.voidsetPSButton(boolean value)Change the value of the PS button on the controller.voidsetR1Button(boolean value)Change the value of the R1 button on the controller.voidsetR2Axis(double value)Change the R2 axis value of the controller.voidsetR2Button(boolean value)Change the value of the R2 button on the controller.voidsetR3Button(boolean value)Change the value of the R3 (right stick) button on the controller.voidsetRightX(double value)Change the X axis value of the controller's right stick.voidsetRightY(double value)Change the Y axis value of the controller's right stick.voidsetShareButton(boolean value)Change the value of the Share button on the controller.voidsetSquareButton(boolean value)Change the value of the Square button on the controller.voidsetTouchpad(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
-
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 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
-