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
- get_leds() int
Get the value of set LEDs.
- Returns:
the led color
- get_rumble(type: wpilib._wpilib.GenericHID.RumbleType) float
Get the joystick rumble.
- Parameters:
type – the rumble to read
- Returns:
the rumble value
- notify_new_data() None
Updates joystick data so that new values are visible to the user program.
- set_axes_available(count: SupportsInt | SupportsIndex) None
Set the axis count of this device.
- Parameters:
count – the new axis count
- set_axes_maximum_index(maximum_index: SupportsInt | SupportsIndex) None
- set_buttons_available(count: SupportsInt | SupportsIndex) None
Set the button count of this device.
- Parameters:
count – the new button count
- set_buttons_maximum_index(maximum_index: SupportsInt | SupportsIndex) None
- set_gamepad_type(type: wpilib._wpilib.GenericHID.HIDType) None
Set the type of this device.
- Parameters:
type – the new device type
- set_name(name: str) None
Set the name of this device.
- Parameters:
name – the new device name
- set_pov(*args, **kwargs)
Overloaded function.
set_pov(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
set_pov(self: wpilib.simulation._simulation.GenericHIDSim, value: wpilib._wpilib.POVDirection) -> None
Set the value of the default POV (port 0).
- Parameters:
value – the new value
- set_povs_available(count: SupportsInt | SupportsIndex) None
Set the POV count of this device.
- Parameters:
count – the new POV count
- set_povs_maximum_index(maximum_index: SupportsInt | SupportsIndex) None
- set_raw_axis(axis: SupportsInt | SupportsIndex, value: SupportsFloat | SupportsIndex) None
Set the value of a given axis.
- Parameters:
axis – the axis to set
value – the new value
- set_raw_button(button: SupportsInt | SupportsIndex, value: bool) None
Set the value of a given button.
- Parameters:
button – the button to set
value – the new value
- set_supported_outputs(supported_outputs: wpilib._wpilib.GenericHID.SupportedOutputs) None