Package edu.wpi.first.wpilibj.simulation
Class XboxControllerSim
java.lang.Object
edu.wpi.first.wpilibj.simulation.GenericHIDSim
edu.wpi.first.wpilibj.simulation.XboxControllerSim
Class to control a simulated Xbox controller.
-
Field Summary
Fields inherited from class edu.wpi.first.wpilibj.simulation.GenericHIDSim
m_port
-
Constructor Summary
ConstructorDescriptionXboxControllerSim
(int port) Constructs from a joystick port number.XboxControllerSim
(XboxController joystick) Constructs from a XboxController object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
setAButton
(boolean value) Change the value of the A button on the controller.void
setBackButton
(boolean value) Change the value of the back button on the controller.void
setBButton
(boolean value) Change the value of the B button on the controller.void
setLeftBumper
(boolean state) Deprecated, for removal: This API element is subject to removal in a future version.void
setLeftBumperButton
(boolean value) Change the value of the left bumper button on the controller.void
setLeftStickButton
(boolean value) Change the value of the left stick button on the controller.void
setLeftTriggerAxis
(double value) Change the value of the left trigger axis on the controller.void
setLeftX
(double value) Change the left X value of the controller's joystick.void
setLeftY
(double value) Change the left Y value of the controller's joystick.void
setRightBumper
(boolean state) Deprecated, for removal: This API element is subject to removal in a future version.UsesetRightBumperButton(boolean)
instead.void
setRightBumperButton
(boolean value) Change the value of the right bumper button on the controller.void
setRightStickButton
(boolean value) Change the value of the right stick button on the controller.void
setRightTriggerAxis
(double value) Change the value of the right trigger axis on the controller.void
setRightX
(double value) Change the right X value of the controller's joystick.void
setRightY
(double value) Change the right Y value of the controller's joystick.void
setStartButton
(boolean value) Change the value of the start button on the controller.void
setXButton
(boolean value) Change the value of the X button on the controller.void
setYButton
(boolean value) Change the value of the Y button on the controller.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 Details
-
XboxControllerSim
Constructs from a XboxController object.- Parameters:
joystick
- controller to simulate
-
XboxControllerSim
Constructs from a joystick port number.- Parameters:
port
- port number
-
-
Method Details
-
setLeftX
Change the left X value of the controller's joystick.- Parameters:
value
- the new value
-
setRightX
Change the right X value of the controller's joystick.- Parameters:
value
- the new value
-
setLeftY
Change the left Y value of the controller's joystick.- Parameters:
value
- the new value
-
setRightY
Change the right Y value of the controller's joystick.- Parameters:
value
- the new value
-
setLeftTriggerAxis
Change the value of the left trigger axis on the controller.- Parameters:
value
- the new value
-
setRightTriggerAxis
Change the value of the right trigger axis on the controller.- Parameters:
value
- the new value
-
setAButton
Change the value of the A button on the controller.- Parameters:
value
- the new value
-
setBButton
Change the value of the B button on the controller.- Parameters:
value
- the new value
-
setXButton
Change the value of the X button on the controller.- Parameters:
value
- the new value
-
setYButton
Change the value of the Y button on the controller.- Parameters:
value
- the new value
-
setLeftBumperButton
Change the value of the left bumper button on the controller.- Parameters:
value
- the new value
-
setRightBumperButton
Change the value of the right bumper button on the controller.- Parameters:
value
- the new value
-
setBackButton
Change the value of the back button on the controller.- Parameters:
value
- the new value
-
setStartButton
Change the value of the start button on the controller.- Parameters:
value
- the new value
-
setLeftStickButton
Change the value of the left stick button on the controller.- Parameters:
value
- the new value
-
setRightStickButton
Change the value of the right stick button on the controller.- Parameters:
value
- the new value
-
setLeftBumper
Deprecated, for removal: This API element is subject to removal in a future version.UsesetLeftBumperButton(boolean)
instead. This function is deprecated for removal to make function names consistent to allow the HID classes to be automatically generated.Change the value of the left bumper on the joystick.- Parameters:
state
- the new value
-
setRightBumper
Deprecated, for removal: This API element is subject to removal in a future version.UsesetRightBumperButton(boolean)
instead. This function is deprecated for removal to make function names consistent to allow the HID classes to be automatically generated.Change the value of the right bumper on the joystick.- Parameters:
state
- the new value
-
setLeftBumperButton(boolean)
instead.