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
Nested ClassesModifier and TypeClassDescriptionstatic classNested classes/interfaces inherited from class xbot.common.controls.sensors.XXboxController
XXboxController.XboxButton, XXboxController.XXboxControllerFactoryNested 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
ConstructorsConstructorDescriptionMockXboxControllerAdapter(int port, AdvancedJoystickButtonTrigger.AdvancedJoystickButtonTriggerFactory joystickButtonFactory, AdvancedPovButtonTrigger.AdvancedPovButtonTriggerFactory povButtonFactory, AnalogHIDButtonTrigger.AnalogHIDButtonTriggerFactory analogHidButtonFactory, XRumbleManager.XRumbleManagerFactory rumbleManagerFactory, RobotAssertionManager manager, DevicePolice police) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetButton(int button) protected doubleprotected doubleprotected doubleintgetPOV()doublegetRawAxis(int axis) protected doubleprotected doubleprotected doublevoidsetLeftStick(double x, double y) voidsetLeftStick(XYPair xy) voidsetLeftTrigger(double left) voidNeeded for a few scenarios where we want to emulate the underlying joystick behavior and not the intent after inversion.voidNeeded for a few scenarios where we want to emulate the underlying joystick behavior and not the intent after inversion.voidsetRightStick(double x, double y) voidsetRightStick(XYPair xy) voidsetRightTrigger(double right) Methods inherited from class xbot.common.controls.sensors.XXboxController
getifAvailable, getLeftFieldOrientedVector, getLeftStickX, getLeftStickY, getLeftTrigger, getLeftVector, getRightFieldOrientedVector, getRightStickX, getRightStickY, getRightTrigger, getRightVector, getXboxButton, setLeftInversion, setRightInversionMethods 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:
getRawAxisin classXJoystick
-
getPOV
public int getPOV() -
getGenericHID
- Specified by:
getGenericHIDin classXJoystick
-
getRumbleManager
- Specified by:
getRumbleManagerin interfaceIRumbler- Overrides:
getRumbleManagerin classXXboxController
-
getLeftRawTriggerAxis
protected double getLeftRawTriggerAxis()- Specified by:
getLeftRawTriggerAxisin classXXboxController
-
getRightRawTriggerAxis
protected double getRightRawTriggerAxis()- Specified by:
getRightRawTriggerAxisin classXXboxController
-
getLeftRawX
protected double getLeftRawX()- Specified by:
getLeftRawXin classXXboxController
-
getLeftRawY
protected double getLeftRawY()- Specified by:
getLeftRawYin classXXboxController
-
getRightRawX
protected double getRightRawX()- Specified by:
getRightRawXin classXXboxController
-
getRightRawY
protected double getRightRawY()- Specified by:
getRightRawYin classXXboxController
-