Package edu.wpi.first.wpilibj
Class MockXboxControllerAdapter
java.lang.Object
xbot.common.controls.sensors.XJoystick
xbot.common.controls.sensors.XXboxController
edu.wpi.first.wpilibj.MockXboxControllerAdapter
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Nested classes/interfaces inherited from class xbot.common.controls.sensors.XXboxController
XXboxController.XboxButton, XXboxController.XXboxControllerFactory
Nested classes/interfaces inherited from class xbot.common.controls.sensors.XJoystick
XJoystick.ButtonSource, XJoystick.XJoystickFactory
-
Field Summary
Fields inherited from class xbot.common.controls.sensors.XXboxController
allocatedButtons, assertionManager, leftXInversion, leftYInversion, port, rightXInversion, rightYInversion
-
Constructor Summary
ConstructorDescriptionMockXboxControllerAdapter
(int port, AdvancedJoystickButtonTrigger.AdvancedJoystickButtonTriggerFactory joystickButtonFactory, AdvancedPovButtonTrigger.AdvancedPovButtonTriggerFactory povButtonFactory, AnalogHIDButtonTrigger.AnalogHIDButtonTriggerFactory analogHidButtonFactory, XRumbleManager.XRumbleManagerFactory rumbleManagerFactory, RobotAssertionManager manager, DevicePolice police) -
Method Summary
Modifier and TypeMethodDescriptionboolean
getButton
(int button) protected double
protected double
protected double
int
getPOV()
double
getRawAxis
(int axis) protected double
protected double
protected double
void
setLeftStick
(double x, double y) void
setLeftStick
(XYPair xy) void
setLeftTrigger
(double left) void
Needed for a few scenarios where we want to emulate the underlying joystick behavior and not the intent after inversion.void
Needed for a few scenarios where we want to emulate the underlying joystick behavior and not the intent after inversion.void
setRightStick
(double x, double y) void
setRightStick
(XYPair xy) void
setRightTrigger
(double right) Methods inherited from class xbot.common.controls.sensors.XXboxController
getifAvailable, getLeftFieldOrientedVector, getLeftStickX, getLeftStickY, getLeftTrigger, getLeftVector, getRightFieldOrientedVector, getRightStickX, getRightStickY, getRightTrigger, getRightVector, getXboxButton, setLeftInversion, setRightInversion
Methods inherited from class xbot.common.controls.sensors.XJoystick
addAnalogButton, addAnalogButton, getAnalogIfAvailable, getAxisInverted, getifAvailable, getPort, getPovIfAvailable, getVectorForAxisPair, setAxisInverted
-
Constructor Details
-
MockXboxControllerAdapter
@AssistedInject public MockXboxControllerAdapter(@Assisted("port") int port, AdvancedJoystickButtonTrigger.AdvancedJoystickButtonTriggerFactory joystickButtonFactory, AdvancedPovButtonTrigger.AdvancedPovButtonTriggerFactory povButtonFactory, AnalogHIDButtonTrigger.AnalogHIDButtonTriggerFactory analogHidButtonFactory, XRumbleManager.XRumbleManagerFactory rumbleManagerFactory, RobotAssertionManager manager, DevicePolice police)
-
-
Method Details
-
setLeftStick
public void setLeftStick(double x, double y) -
setLeftStick
-
setRightStick
public void setRightStick(double x, double y) -
setRightStick
-
setRawLeftStick
Needed for a few scenarios where we want to emulate the underlying joystick behavior and not the intent after inversion.- Parameters:
xy
- XYPair to directly set. (Remember that by default, most joysticks have an inverted Y axis!)
-
setRawRightStick
Needed for a few scenarios where we want to emulate the underlying joystick behavior and not the intent after inversion.- Parameters:
xy
- XYPair to directly set. (Remember that by default, most joysticks have an inverted Y axis!)
-
setLeftTrigger
public void setLeftTrigger(double left) -
setRightTrigger
public void setRightTrigger(double right) -
getButton
public boolean getButton(int button) -
getRawAxis
public double getRawAxis(int axis) - Specified by:
getRawAxis
in classXJoystick
-
getPOV
public int getPOV() -
getGenericHID
- Specified by:
getGenericHID
in classXJoystick
-
getRumbleManager
- Specified by:
getRumbleManager
in interfaceIRumbler
- Overrides:
getRumbleManager
in classXXboxController
-
getLeftRawTriggerAxis
protected double getLeftRawTriggerAxis()- Specified by:
getLeftRawTriggerAxis
in classXXboxController
-
getRightRawTriggerAxis
protected double getRightRawTriggerAxis()- Specified by:
getRightRawTriggerAxis
in classXXboxController
-
getLeftRawX
protected double getLeftRawX()- Specified by:
getLeftRawX
in classXXboxController
-
getLeftRawY
protected double getLeftRawY()- Specified by:
getLeftRawY
in classXXboxController
-
getRightRawX
protected double getRightRawX()- Specified by:
getRightRawX
in classXXboxController
-
getRightRawY
protected double getRightRawY()- Specified by:
getRightRawY
in classXXboxController
-