Class JoystickSim
java.lang.Object
org.wpilib.simulation.GenericHIDSim
org.wpilib.simulation.JoystickSim
Class to control a simulated joystick.
-
Field Summary
Fields inherited from class GenericHIDSim
m_port -
Constructor Summary
ConstructorsConstructorDescriptionJoystickSim(int port) Constructs from a joystick port number.JoystickSim(Joystick joystick) Constructs from a Joystick object. -
Method Summary
Modifier and TypeMethodDescriptionvoidsetThrottle(double value) Set the throttle value of the joystick.voidsetTop(boolean state) Set the top state of the joystick.voidsetTrigger(boolean state) Set the trigger value of the joystick.voidsetTwist(double value) Set the twist value of the joystick.voidsetX(double value) Set the X value of the joystick.voidsetY(double value) Set the Y value of the joystick.voidsetZ(double value) Set the Z value of the joystick.Methods inherited from class GenericHIDSim
getLeds, getRumble, notifyNewData, setAxesAvailable, setAxesMaximumIndex, setButtonsAvailable, setButtonsMaximumIndex, setGamepadType, setName, setPOV, setPOV, setPOVsAvailable, setPOVsMaximumIndex, setRawAxis, setRawButton, setSupportedOutputs
-
Constructor Details
-
JoystickSim
Constructs from a Joystick object.- Parameters:
joystick- joystick to simulate
-
JoystickSim
public JoystickSim(int port) Constructs from a joystick port number.- Parameters:
port- port number
-
-
Method Details
-
setX
public void setX(double value) Set the X value of the joystick.- Parameters:
value- the new X value
-
setY
public void setY(double value) Set the Y value of the joystick.- Parameters:
value- the new Y value
-
setZ
public void setZ(double value) Set the Z value of the joystick.- Parameters:
value- the new Z value
-
setTwist
public void setTwist(double value) Set the twist value of the joystick.- Parameters:
value- the new twist value
-
setThrottle
public void setThrottle(double value) Set the throttle value of the joystick.- Parameters:
value- the new throttle value
-
setTrigger
public void setTrigger(boolean state) Set the trigger value of the joystick.- Parameters:
state- the new value
-
setTop
public void setTop(boolean state) Set the top state of the joystick.- Parameters:
state- the new state
-