GenericHIDSim
- class wpilib.simulation.GenericHIDSim(*args, **kwargs)
Bases:
pybind11_objectClass to control a simulated generic joystick.
Overloaded function.
__init__(self: wpilib.simulation._simulation.GenericHIDSim, joystick: wpilib._wpilib.GenericHID) -> None
Constructs from a GenericHID object.
- Parameters:
joystick – joystick to simulate
__init__(self: wpilib.simulation._simulation.GenericHIDSim, port: typing.SupportsInt | typing.SupportsIndex) -> None
Constructs from a joystick port number.
- Parameters:
port – port number
- getLeds() int
Get the value of set LEDs.
- Returns:
the led color
- getRumble(type: wpilib._wpilib.GenericHID.RumbleType) float
Get the joystick rumble.
- Parameters:
type – the rumble to read
- Returns:
the rumble value
- notifyNewData() None
Updates joystick data so that new values are visible to the user program.
- setAxesAvailable(count: SupportsInt | SupportsIndex) None
Set the axis count of this device.
- Parameters:
count – the new axis count
- setAxesMaximumIndex(maximumIndex: SupportsInt | SupportsIndex) None
- setButtonsAvailable(count: SupportsInt | SupportsIndex) None
Set the button count of this device.
- Parameters:
count – the new button count
- setButtonsMaximumIndex(maximumIndex: SupportsInt | SupportsIndex) None
- setGamepadType(type: wpilib._wpilib.GenericHID.HIDType) None
Set the type of this device.
- Parameters:
type – the new device type
- setName(name: str) None
Set the name of this device.
- Parameters:
name – the new device name
- setPOV(*args, **kwargs)
Overloaded function.
setPOV(self: wpilib.simulation._simulation.GenericHIDSim, pov: typing.SupportsInt | typing.SupportsIndex, value: wpilib._wpilib.POVDirection) -> None
Set the value of a given POV.
- Parameters:
pov – the POV to set
value – the new value
setPOV(self: wpilib.simulation._simulation.GenericHIDSim, value: wpilib._wpilib.POVDirection) -> None
Set the value of the default POV (port 0).
- Parameters:
value – the new value
- setPOVsAvailable(count: SupportsInt | SupportsIndex) None
Set the POV count of this device.
- Parameters:
count – the new POV count
- setPOVsMaximumIndex(maximumIndex: SupportsInt | SupportsIndex) None
- setRawAxis(axis: SupportsInt | SupportsIndex, value: SupportsFloat | SupportsIndex) None
Set the value of a given axis.
- Parameters:
axis – the axis to set
value – the new value
- setRawButton(button: SupportsInt | SupportsIndex, value: bool) None
Set the value of a given button.
- Parameters:
button – the button to set
value – the new value
- setSupportedOutputs(supportedOutputs: wpilib._wpilib.GenericHID.SupportedOutputs) None