Go to Post Just as you and your team will make hard decisions as you struggle to build a robot, FIRST has had to make hard decisions concerning maximizing safety while making the number of rules as small as possible. - Mike Betts [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 13-02-2010, 01:31
daltore's Avatar
daltore daltore is offline
Electronics/programming/design
AKA: Aaron Osmer
FRC #3529 (ausTIN CANs)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2007
Location: San Antonio, TX
Posts: 272
daltore has a spectacular aura aboutdaltore has a spectacular aura aboutdaltore has a spectacular aura about
Send a message via AIM to daltore Send a message via MSN to daltore Send a message via Yahoo to daltore
Re: 4 motor Mecanum wheel code request

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.
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mecanum Wheel Setup Help Dylan5019 NI LabVIEW 16 10-02-2011 15:39
Mecanum Wheel Considerations abross General Forum 20 23-01-2010 19:34
Mecanum wheel size Mr. A Technical Discussion 7 18-01-2010 08:58
pic: New mecanum wheel? scottydoh Extra Discussion 5 16-01-2010 21:29
pic: 2" Mecanum Wheel Tytus Gerrish Technical Discussion 17 22-04-2006 12:22


All times are GMT -5. The time now is 22:43.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi