From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Holonomic Drive VI

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.

0 Kudos
Message 1 of 2
(6,724 Views)

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.

Ben

National Instruments
Certified LabVIEW Associate Developer
Certified TestStand Developer
0 Kudos
Message 2 of 2
(2,513 Views)