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
-
Fields inherited from class edu.wpi.first.wpilibj.simulation.GenericHIDSim
m_port
-
-
Constructor Summary
Constructors Constructor Description JoystickSim(int port)
Constructs from a joystick port number.JoystickSim(Joystick joystick)
Constructs from a Joystick object.
-
Method Summary
All Methods Instance Methods Concrete Methods 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 Detail
-
JoystickSim
public JoystickSim(Joystick joystick)
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 Detail
-
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
-
-