Quote:
Originally Posted by compboy07
The getX() method is for the kinectStick.
|
No, getX() is inherited in both Joystick and kinectStick from GenericHID.
Look in the libraries at Joystick.java and you'll find
Code:
/**
* Get the X value of the joystick.
* This depends on the mapping of the joystick connected to the current port.
*
* @param hand Unused
* @return The X value of the joystick.
*/
public double getX(Hand hand) {
return getRawAxis(m_axes[AxisType.kX.value]);
}
/**
* Get the Y value of the joystick.
* This depends on the mapping of the joystick connected to the current port.
*
* @param hand Unused
* @return The Y value of the joystick.
*/
public double getY(Hand hand) {
return getRawAxis(m_axes[AxisType.kY.value]);
}
TL;DR getX() works for joysticks, not just kinectSticks.