Package xbot.common.controls.sensors
Class XJoystick
java.lang.Object
xbot.common.controls.sensors.XJoystick
- Direct Known Subclasses:
JoystickWPIAdapter
,MockJoystick
,XFTCGamepad
,XXboxController
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static interface
-
Field Summary
-
Constructor Summary
ConstructorDescriptionXJoystick
(int port, AdvancedJoystickButtonTrigger.AdvancedJoystickButtonTriggerFactory joystickButtonFactory, AdvancedPovButtonTrigger.AdvancedPovButtonTriggerFactory povButtonFactory, AnalogHIDButtonTrigger.AnalogHIDButtonTriggerFactory analogHidButtonFactory, RobotAssertionManager assertionManager, int numButtons, DevicePolice police) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnalogButton
(int axisNumber, double minThreshold, double maxThreshold) void
boolean
getAxisInverted
(int axisNumber) abstract boolean
getButton
(int button) abstract GenericHID
getifAvailable
(int buttonNumber) int
getPort()
abstract int
getPOV()
getPovIfAvailable
(int povNumber) Uses the d-pad as a button source.abstract double
getRawAxis
(int axisNumber) protected Translation2d
getVectorForAxisPair
(int xAxis, int yAxis) void
setAxisInverted
(int axisNumber, boolean inverted)
-
Field Details
-
port
protected int port
-
-
Constructor Details
-
XJoystick
public XJoystick(int port, AdvancedJoystickButtonTrigger.AdvancedJoystickButtonTriggerFactory joystickButtonFactory, AdvancedPovButtonTrigger.AdvancedPovButtonTriggerFactory povButtonFactory, AnalogHIDButtonTrigger.AnalogHIDButtonTriggerFactory analogHidButtonFactory, RobotAssertionManager assertionManager, int numButtons, DevicePolice police)
-
-
Method Details
-
getPort
public int getPort() -
getAxisInverted
public boolean getAxisInverted(int axisNumber) -
setAxisInverted
public void setAxisInverted(int axisNumber, boolean inverted) -
getVectorForAxisPair
-
getButton
public abstract boolean getButton(int button) -
getRawAxis
public abstract double getRawAxis(int axisNumber) -
getGenericHID
-
getPOV
public abstract int getPOV() -
addAnalogButton
public void addAnalogButton(int axisNumber, double minThreshold, double maxThreshold) -
addAnalogButton
-
getifAvailable
-
getPovIfAvailable
Uses the d-pad as a button source.- Parameters:
povNumber
- 0 == Up, 90 == Right, 180 == down, 270 == left- Returns:
- A trigger that represents the given POV direction.
-
getAnalogIfAvailable
public AnalogHIDButtonTrigger getAnalogIfAvailable(AnalogHIDButtonTrigger.AnalogHIDDescription desc)
-