Class MockXboxControllerAdapter
java.lang.Object
xbot.common.controls.sensors.XJoystick
xbot.common.controls.sensors.XXboxController
xbot.common.controls.sensors.mock_adapters.MockXboxControllerAdapter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNested classes/interfaces inherited from class XXboxController
XXboxController.XboxAxisButton, XXboxController.XboxButton, XXboxController.XXboxControllerFactoryNested classes/interfaces inherited from class XJoystick
XJoystick.ButtonSource, XJoystick.XJoystickFactory -
Field Summary
Fields inherited from class XXboxController
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 TypeMethodDescriptiondoublegetAxis(org.wpilib.driverstation.XboxController.Axis axis) booleangetButton(int button) booleangetButton(org.wpilib.driverstation.XboxController.Button button) org.wpilib.driverstation.GenericHIDgetHID()doubleprotected doublegetLeftX()protected doublegetLeftY()org.wpilib.driverstation.POVDirectiongetPOV()doublegetRawAxis(int axis) doubleprotected doubleprotected doublevoidsetButton(org.wpilib.driverstation.XboxController.Button button, boolean pressed) voidsetLeftStick(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 XXboxController
getLeftFieldOrientedVector, getLeftStickX, getLeftStickY, getLeftVector, getRightFieldOrientedVector, getRightStickX, getRightStickY, getRightVector, getXboxAxisButtonIfAvailable, getXboxButtonIfAvailable, onPovAllocated, setLeftInversion, setRightInversionMethods inherited from class XJoystick
addAnalogButton, addAnalogButton, assertPovDirectionsAvailable, getAnalogIfAvailable, getAxisInverted, getifAvailable, getPort, getPovDirection, 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) -
setButton
public void setButton(org.wpilib.driverstation.XboxController.Button button, boolean pressed) -
getButton
-
getButton
public boolean getButton(org.wpilib.driverstation.XboxController.Button button) - Specified by:
getButtonin classXXboxController
-
getRawAxis
public double getRawAxis(int axis) - Specified by:
getRawAxisin classXJoystick
-
getAxis
public double getAxis(org.wpilib.driverstation.XboxController.Axis axis) - Specified by:
getAxisin classXXboxController
-
getPOV
-
getHID
-
getRumbleManager
- Specified by:
getRumbleManagerin interfaceIRumbler- Overrides:
getRumbleManagerin classXXboxController
-
getLeftTrigger
public double getLeftTrigger() -
getRightTrigger
public double getRightTrigger() -
getLeftX
protected double getLeftX()- Specified by:
getLeftXin classXXboxController
-
getLeftY
protected double getLeftY()- Specified by:
getLeftYin classXXboxController
-
getRightX
protected double getRightX()- Specified by:
getRightXin classXXboxController
-
getRightY
protected double getRightY()- Specified by:
getRightYin classXXboxController
-