JoystickSim¶
- class wpilib.simulation.JoystickSim(*args, **kwargs)¶
Bases:
GenericHIDSim
Class to control a simulated joystick.
Overloaded function.
__init__(self: wpilib.simulation._simulation.JoystickSim, joystick: wpilib._wpilib.Joystick) -> None
Constructs from a Joystick object.
- Parameters:
joystick – joystick to simulate
__init__(self: wpilib.simulation._simulation.JoystickSim, port: int) -> None
Constructs from a joystick port number.
- Parameters:
port – port number
- setThrottle(value: float) None ¶
Set the throttle value of the joystick.
- Parameters:
value – the new throttle value
- setTop(state: bool) None ¶
Set the top state of the joystick.
- Parameters:
state – the new state
- setTrigger(state: bool) None ¶
Set the trigger value of the joystick.
- Parameters:
state – the new value
- setTwist(value: float) None ¶
Set the twist value of the joystick.
- Parameters:
value – the new twist value
- setX(value: float) None ¶
Set the X value of the joystick.
- Parameters:
value – the new X value
- setY(value: float) None ¶
Set the Y value of the joystick.
- Parameters:
value – the new Y value
- setZ(value: float) None ¶
Set the Z value of the joystick.
- Parameters:
value – the new Z value