Package edu.wpi.first.wpilibj.simulation
Class XboxControllerSim
java.lang.Object
edu.wpi.first.wpilibj.simulation.GenericHIDSim
edu.wpi.first.wpilibj.simulation.XboxControllerSim
public class XboxControllerSim extends GenericHIDSim
Class to control a simulated Xbox 360 or Xbox One controller.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description XboxControllerSim(int port)Constructs from a joystick port number.XboxControllerSim(XboxController joystick)Constructs from a XboxController object. -
Method Summary
Modifier and Type Method Description voidsetAButton(boolean state)Change the value of the A button.voidsetBackButton(boolean state)Change the value of the Back button.voidsetBButton(boolean state)Change the value of the B button.voidsetLeftBumper(boolean state)Change the value of the left bumper on the joystick.voidsetLeftStickButton(boolean state)Change the value of the left stick button on the joystick.voidsetLeftTriggerAxis(double value)Change the value of the left trigger axis on the joystick.voidsetLeftX(double value)Change the left X value of the joystick.voidsetLeftY(double value)Change the left Y value of the joystick.voidsetRightBumper(boolean state)Change the value of the right bumper on the joystick.voidsetRightStickButton(boolean state)Change the value of the right stick button on the joystick.voidsetRightTriggerAxis(double value)Change the value of the right trigger axis on the joystick.voidsetRightX(double value)Change the right X value of the joystick.voidsetRightY(double value)Change the right Y value of the joystick.voidsetStartButton(boolean state)Change the value of the Start button.voidsetXButton(boolean state)Change the value of the X button.voidsetYButton(boolean state)Change the value of the Y button.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 joystick.- Parameters:
value- the new value
-
setRightX
Change the right X value of the joystick.- Parameters:
value- the new value
-
setLeftY
Change the left Y value of the joystick.- Parameters:
value- the new value
-
setRightY
Change the right Y value of the joystick.- Parameters:
value- the new value
-
setLeftTriggerAxis
Change the value of the left trigger axis on the joystick.- Parameters:
value- the new value
-
setRightTriggerAxis
Change the value of the right trigger axis on the joystick.- Parameters:
value- the new value
-
setLeftBumper
Change the value of the left bumper on the joystick.- Parameters:
state- the new value
-
setRightBumper
Change the value of the right bumper on the joystick.- Parameters:
state- the new value
-
setLeftStickButton
Change the value of the left stick button on the joystick.- Parameters:
state- the new value
-
setRightStickButton
Change the value of the right stick button on the joystick.- Parameters:
state- the new value
-
setAButton
Change the value of the A button.- Parameters:
state- the new value
-
setBButton
Change the value of the B button.- Parameters:
state- the new value
-
setXButton
Change the value of the X button.- Parameters:
state- the new value
-
setYButton
Change the value of the Y button.- Parameters:
state- the new value
-
setBackButton
Change the value of the Back button.- Parameters:
state- the new value
-
setStartButton
Change the value of the Start button.- Parameters:
state- the new value
-