XboxControllerSim

class wpilib.simulation.XboxControllerSim(*args, **kwargs)

Bases: wpilib.simulation.GenericHIDSim

Class to control a simulated Xbox 360 or Xbox One controller.

Overloaded function.

  1. __init__(self: wpilib.simulation._simulation.XboxControllerSim, joystick: wpilib._wpilib.XboxController) -> None

Constructs from a XboxController object.

Parameters

joystick – controller to simulate

  1. __init__(self: wpilib.simulation._simulation.XboxControllerSim, port: int) -> None

Constructs from a joystick port number.

Parameters

port – port number

setAButton(state: bool)None

Change the value of the A button.

Parameters

state – the new value

setBButton(state: bool)None

Change the value of the B button.

Parameters

state – the new value

setBackButton(state: bool)None

Change the value of the Back button.

Parameters

state – the new value

setBumper(hand: wpilib.interfaces._interfaces.GenericHID.Hand, state: bool)None

Change the value of a bumper on the joystick.

Parameters
  • hand – the joystick hand

  • state – the new value

setStartButton(state: bool)None

Change the value of the Start button.

Parameters

state – the new value

setStickButton(hand: wpilib.interfaces._interfaces.GenericHID.Hand, state: bool)None

Change the value of a button on the joystick.

Parameters
  • hand – the joystick hand

  • state – the new value

setTriggerAxis(hand: wpilib.interfaces._interfaces.GenericHID.Hand, value: float)None

Change the value of a trigger axis on the joystick.

Parameters
  • hand – the joystick hand

  • value – the new value

setX(hand: wpilib.interfaces._interfaces.GenericHID.Hand, value: float)None

Change the X value of the joystick.

Parameters
  • hand – the joystick hand

  • value – the new value

setXButton(state: bool)None

Change the value of the X button.

Parameters

state – the new value

setY(hand: wpilib.interfaces._interfaces.GenericHID.Hand, value: float)None

Change the Y value of the joystick.

Parameters
  • hand – the joystick hand

  • value – the new value

setYButton(state: bool)None

Change the value of the Y button.

Parameters

state – the new value