Class XGamepad
java.lang.Object
xbot.common.controls.sensors.XJoystick
xbot.common.controls.sensors.XGamepad
- All Implemented Interfaces:
IGamepad
- Direct Known Subclasses:
GamepadWpiAdapter, MockGamepad
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSemantic gamepad buttons, ordered to match WPILib's Gamepad.Button values.static interfaceNested classes/interfaces inherited from class XJoystick
XJoystick.ButtonSource, XJoystick.XJoystickFactory -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedXGamepad(int port, AdvancedJoystickButtonTrigger.AdvancedJoystickButtonTriggerFactory joystickButtonFactory, AdvancedPovButtonTrigger.AdvancedPovButtonTriggerFactory povButtonFactory, AnalogHIDButtonTrigger.AnalogHIDButtonTriggerFactory analogHidButtonFactory, RobotAssertionManager assertionManager, DevicePolice police) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleangetButton(int buttonToken) abstract booleangetButton(XGamepad.GamepadButton button) Allocates a trigger using a semantic button rather than a device-specific raw button number.org.wpilib.math.geometry.Translation2ddoubledoubleorg.wpilib.math.geometry.Translation2dprotected abstract doublegetLeftX()protected abstract doublegetLeftY()org.wpilib.math.geometry.Translation2ddoubledoubleorg.wpilib.math.geometry.Translation2dprotected abstract doubleprotected abstract doubleprotected voidonPovAllocated(org.wpilib.driverstation.POVDirection direction) voidsetLeftInversion(boolean xInverted, boolean yInverted) voidsetRightInversion(boolean xInverted, boolean yInverted) Methods inherited from class XJoystick
addAnalogButton, addAnalogButton, assertPovDirectionsAvailable, getAnalogIfAvailable, getAxisInverted, getHID, getifAvailable, getPort, getPOV, getPovDirection, getPovIfAvailable, getRawAxis, getVectorForAxisPair, setAxisInvertedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IGamepad
getLeftTrigger, getRightTrigger
-
Field Details
-
LEFT_X_AXIS
public static final int LEFT_X_AXIS- See Also:
-
LEFT_Y_AXIS
public static final int LEFT_Y_AXIS- See Also:
-
RIGHT_X_AXIS
public static final int RIGHT_X_AXIS- See Also:
-
RIGHT_Y_AXIS
public static final int RIGHT_Y_AXIS- See Also:
-
LEFT_TRIGGER_AXIS
public static final int LEFT_TRIGGER_AXIS- See Also:
-
RIGHT_TRIGGER_AXIS
public static final int RIGHT_TRIGGER_AXIS- See Also:
-
-
Constructor Details
-
XGamepad
protected XGamepad(int port, AdvancedJoystickButtonTrigger.AdvancedJoystickButtonTriggerFactory joystickButtonFactory, AdvancedPovButtonTrigger.AdvancedPovButtonTriggerFactory povButtonFactory, AnalogHIDButtonTrigger.AnalogHIDButtonTriggerFactory analogHidButtonFactory, RobotAssertionManager assertionManager, DevicePolice police)
-
-
Method Details
-
getGamepadButtonIfAvailable
Allocates a trigger using a semantic button rather than a device-specific raw button number. -
onPovAllocated
protected void onPovAllocated(org.wpilib.driverstation.POVDirection direction) - Overrides:
onPovAllocatedin classXJoystick
-
getButton
-
getButton
-
getLeftStickX
public double getLeftStickX() -
getLeftStickY
public double getLeftStickY() -
getRightStickX
public double getRightStickX() -
getRightStickY
public double getRightStickY() -
getLeftVector
public org.wpilib.math.geometry.Translation2d getLeftVector()- Specified by:
getLeftVectorin interfaceIGamepad
-
getRightVector
public org.wpilib.math.geometry.Translation2d getRightVector()- Specified by:
getRightVectorin interfaceIGamepad
-
getLeftFieldOrientedVector
public org.wpilib.math.geometry.Translation2d getLeftFieldOrientedVector()- Specified by:
getLeftFieldOrientedVectorin interfaceIGamepad
-
getRightFieldOrientedVector
public org.wpilib.math.geometry.Translation2d getRightFieldOrientedVector()- Specified by:
getRightFieldOrientedVectorin interfaceIGamepad
-
setLeftInversion
public void setLeftInversion(boolean xInverted, boolean yInverted) - Specified by:
setLeftInversionin interfaceIGamepad
-
setRightInversion
public void setRightInversion(boolean xInverted, boolean yInverted) - Specified by:
setRightInversionin interfaceIGamepad
-
getLeftX
protected abstract double getLeftX() -
getLeftY
protected abstract double getLeftY() -
getRightX
protected abstract double getRightX() -
getRightY
protected abstract double getRightY()
-