View Single Post
  #7   Spotlight this post!  
Unread 04-02-2014, 21:16
slibert slibert is offline
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 350
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Re: How to grdually speed up the robot?

Quote:
Originally Posted by James Lightfoot View Post
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....
Reply With Quote