12-12-2008 11:56 PM
I can't figure out how to turn an x and y input from a joystick into direction and magnitude vectors for the Holonomic Drive VI. Help would be greatly appreciated.
12-15-2008 01:00 PM
Thomas,
If you take a look at the Joystick Input Example (located in the C:\Program Files\National Instruments\LabVIEW 8.5\examples\FRC\Robot and Motor\Joystick directory), you can see that the joystick axis 1 (x) and axis 2 (y) values vary from -1 to 1. You can think of the maximum range of motion of the joystick as a unit circle. As you stated, the Holonomic Drive VI requires a magnitude and direction. For magnitude, you can use trigonometry to calculate the magnitude of the vector from the distance along the X axis and along the Y axis - use the Pythagorean theorem. The direction, measured in degrees from the robots original heading, can also be calculated using trig.