View Single Post
  #1   Spotlight this post!  
Unread 17-02-2010, 08:45
furiousgeorge's Avatar
furiousgeorge furiousgeorge is offline
Registered User
FRC #3055
 
Join Date: Jan 2009
Location: Austin
Posts: 74
furiousgeorge will become famous soon enoughfuriousgeorge will become famous soon enough
Re: 4 motor Mecanum wheel code request

Quote:
Originally Posted by daltore View Post
There is a Holonomic.vi in the WPIlib LabView files (should be under RobotDrive?). This VI takes 4 required inputs:

1) RobotDrive data cluster
2) Magnitude - Requires a value from -1 to 1. If you're using one joystick for strafing, this will be Pythgorean theorem (sqrt(Xaxis^2 + Yaxis^2)).
3) Direction - Requires a value from -180 to 180 (degrees). If you're using one joystick for strafing, this will be the Arctan2 between the two joysticks (found under Mathematics>Elementary>Trigonometric, it should be the last VI). Plug in the Y axis to Y and the X axis to X. This returns a value in radians, so you have to convert to degrees by dividing by Pi (Numeric>Constants>Pi) and multiplying by 180.
4) Rotation - Requires a value from -1 to 1. You can use the X axis of a second joystick, the rotation axis from a 3-axis joystick, or anything else that's convenient.

You can actually split the duties up between joysticks so you have forward/backward on one joystick and strafing on another joystick, and it will still work perfectly, just run the wires correctly. Our Girl Scouts team last year used this VI and to rotate, used the left and right buttons on top of one of the joysticks (full rotate left or full rotate right). We're using a 3-axis joystick this year that controls all of the driving. To rotate, you have to push the trigger, and to rotate with more control, you can push the button under the thumb, and it squares the value being sent to Rotate (all of the strafing still works, we just didn't want to accidentally rotate because the Z axis is so sensitive).

Hope this helps. If you were planning on using a different setup (like what Alan said with the tank steering with strafing) let us know and someone will be able to help you with that. This is just one way.
I am actually interested in finding out how to program our team's mecanum wheels so that we can have a tank drive style steering with strafing. This is our second year of FRC and so I know some of the lingo of LabView, but pictures help a lot. Thanks
Reply With Quote