Quote:
Originally Posted by James Lightfoot
Hello all. Rocky mentor here w/ a quick question. Wheter we use a Logitech joystick or an Xbox controller (on USB), does a stick give a value of -1 to 1 (analog) or -1, 0, +1 (digital)?
Thanks 
|
Values from the joystick are continuous, so a value of 0.3 when pushing an axis forward slightly is reasonable.
We typically output the values so they can be viewed in NetConsole, like this:
System.out.println("X: " + joystick.getX() + ", Y: " + joystick.getY() + ", Rot: " + joystick.getTwist() );
However, we found out (we switched to java this year, it used to work in C++) that the getRotate() didn't work as we expected, so instead we use
double rotate = joystick.getRawAxis(4);
In fact, joystick.getTwist() for us was returning 0 until we moved it a bit, then it'd be stuck at 1. Not sure what's going on there....