Package edu.wpi.first.wpilibj.simulation
Class JoystickSim
java.lang.Object
edu.wpi.first.wpilibj.simulation.GenericHIDSim
edu.wpi.first.wpilibj.simulation.JoystickSim
public class JoystickSim extends GenericHIDSim
Class to control a simulated joystick.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description JoystickSim(int port)
Constructs from a joystick port number.JoystickSim(Joystick joystick)
Constructs from a Joystick object. -
Method Summary
Modifier and Type Method Description void
setThrottle(double value)
Set the throttle value of the joystick.void
setTop(boolean state)
Set the top state of the joystick.void
setTrigger(boolean state)
Set the trigger value of the joystick.void
setTwist(double value)
Set the twist value of the joystick.void
setX(double value)
Set the X value of the joystick.void
setY(double value)
Set the Y value of the joystick.void
setZ(double value)
Set the Z value of the joystick.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
-
JoystickSim
Constructs from a Joystick object.- Parameters:
joystick
- joystick to simulate
-
JoystickSim
Constructs from a joystick port number.- Parameters:
port
- port number
-
-
Method Details
-
setX
Set the X value of the joystick.- Parameters:
value
- the new X value
-
setY
Set the Y value of the joystick.- Parameters:
value
- the new Y value
-
setZ
Set the Z value of the joystick.- Parameters:
value
- the new Z value
-
setTwist
Set the twist value of the joystick.- Parameters:
value
- the new twist value
-
setThrottle
Set the throttle value of the joystick.- Parameters:
value
- the new throttle value
-
setTrigger
Set the trigger value of the joystick.- Parameters:
state
- the new value
-
setTop
Set the top state of the joystick.- Parameters:
state
- the new state
-