Quote:
Originally Posted by Joe Ross
I'm curious where you found that information in the javadocs. I couldn't find it.
|
The method summary of getRawAxis() in Joystick links to this source code:
Code:
public double getRawAxis(final int axis) {
return m_ds.getStickAxis(m_port, axis);
}
getStickAxis() is a method of DriverStation:
Code:
private DriverStation m_ds;
and in the DriverStation class the getStickAxis() method used with m_ds earlier is as follows:
Code:
public double getStickAxis(int stick, int axis) {
if (axis < 1 || axis > kJoystickAxes) {
return 0.0;
}
int value;
switch (stick) {
...
default:
return 0.0;
}
double result;
if (value < 0) {
result = ((double) value) / 128.0;
} else {
result = ((double) value) / 127.0;
}
// wpi_assert(result <= 1.0 && result >= -1.0);
if (result > 1.0) {
result = 1.0;
} else if (result < -1.0) {
result = -1.0;
}
return result;
}