|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
||||
|
||||
|
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. |
|
#2
|
|||
|
|||
|
Re: 4 motor Mecanum wheel code request
First thanks for the quick replies!
I have to say I'm not too sure what strafing is (googled it a little) I'm guessing thats when you use the rollers on the wheels to make the robot go sideways. I don't know too much about driving systems or their different advantages, (mostly math and lower level languages) but thats a different topic. I would first ask for just the basic tank drive, just because we lost ours from last year, only with 2 motors per side. (I know LabView has a basic vi of the tank drive, but like I said most of my experience is with things like C++, too me Labview is just confusing.) With the tank drive (y axis on 2 joysticks) leaves the x axis unused, I'm assuming that is where you would want to use the strafing [moving perpendicular to the wheels (correct me if I'm wrong on my vocabulary here]) but that leaves open 2 possible movements you can make with the joy sticks (that I can think of) one where both joy sticks go outward from each other, and the other where they point inward/toward each other. I'm not too sure what that would do or how those "gestures" could be utilized. What I'd like is some thing that can utilize as much as possible, but still be simple to use. and thats where I have trouble with LabView is that seems like a lot of if statements, and I never quit get how those work. So could we get a few basic examples, one with basic tank drive for 4 wheels, and one with the strafing. Plus maybe the strafing on one and tank on the other, but really this isn't my area of expertise. I'm only able to really talk with my team during the week, and am not sure exactly where they were going with this. I'd just like to see a couple of different ones that I know work so I can kind of figure out how they work and how to edit them, because at the moment I'm not too sure what would work better. Again thanks for any and all help, and all help already given! I don't want to ask for too much but I don't know too much about the drive system aspect, and if we were doing this in C++ a few of our teachers and I would probably be the main programmers, so we're kinda in the dark! |
|
#3
|
|||
|
|||
|
Re: 4 motor Mecanum wheel code request
Quote:
If you actually want to learn LV, I'd suggest watching a few tutorials, perhaps with the students. NI has quite a few, and there are also good ones on LVMastery.com. Greg McKaskle |
|
#4
|
|||
|
|||
|
Re: 4 motor Mecanum wheel code request
sorry, apparently my reply didn't get posted, been too busy to retype it.
Quote:
I haven't looked through every thing yet though, we just recently got LabView on some other computers so we can really learn it (before it was just on the NetBook). Quote:
Most of our programmers can only program during the school day though, as they don't have LabView on their computers, (my self included) so we decided to ask so if we don't manage to learn LabView and program it in time we'll at least have some thing. Again thanks for any and all help and all help already given! |
|
#5
|
|||
|
|||
|
Re: 4 motor Mecanum wheel code request
here u go if you need deadzones for direction tell me because we already figured out a way to do it http://www.chiefdelphi.com/forums/at...7&d=1265942765
|
|
#6
|
|||
|
|||
|
Re: 4 motor Mecanum wheel code request
I was pointing out the Getting Started Examples link because as you mention, LV ships with thousands of VIs that cover many devices and used in many industries. If you look at the FRC specific ones, they should all be more applicable.
One thing you may find helpful, open the Help>>Show Context Help. This will give information as you idle over a particular node or wire. Greg McKaskle |
|
#7
|
||||
|
||||
|
Re: 4 motor Mecanum wheel code request
Quote:
![]() |
|
#8
|
||||
|
||||
|
Re: 4 motor Mecanum wheel code request
Quote:
http://www.chiefdelphi.com/forums/sh...383#post916383 ~ |
|
#9
|
|||
|
|||
|
Re: 4 motor Mecanum wheel code request
Ether's Post was a lifesaver for holonomic drive(partly because it is so easy to make sense of.) I whipped this up after reading it. All you need to do is plug in your joystick dev ref to the one side, and then plug the 4 values that output on the right into your 4 drive VI's.
Download it here: http://files.me.com/eovnu87435ds/k0i3pn (Link expires March 19, 2010) Note, I did not test this yet, since we didn't get our mechanum wheels yet hope this helps, and of course, all credit goes to Ether |
|
#10
|
||||
|
||||
|
Re: 4 motor Mecanum wheel code request
Quote:
http://www.chiefdelphi.com/forums/sh...d.php?p=907174 http://www.chiefdelphi.com/forums/sh...d.php?p=907168 ~ |
|
#11
|
|||
|
|||
|
Re: 4 motor Mecanum wheel code request
Sorry I've been pretty busy I have 4 college classes to keep up with too.
I talked with our machine tool instructor and he explained a little better what we need, and to answer Alan Anderson's question way back, we need Tank drive plus strafe, 2 joysticks both controlling one side of the robot on the y for tank drive and one or both as strafe on the x. He is going to have some more students look for code through emailing people on youtube. Again sorry I haven't been keeping up on this thread vary well, our tech center has 8th grade visits right now, so I wasn't even any where near the robot to try any of this code all week, nor am I now, and I won't be until Tuesday (Feb 23) Again thanks for all the help the! The pdf that Ether posted http://lib.store.yahoo.net/lib/yhst-...lSpecSheet.pdf has has defiantly cleared a few things up for me, and the code http://files.me.com/eovnu87435ds/k0i3pn looks interesting, will try it when If I ever get my hands on the robot before the deadline lol. |
|
#12
|
|||||
|
|||||
|
Re: 4 motor Mecanum wheel code request
That's very easy to do using the "Mecanum - Cartesian" vi. Use the average of the joysticks' X values as the X input, the average of the joysticks' Y values as the Y input, and the difference between the Y values (divided by 2) as the rotation input.
|
|
#13
|
|||
|
|||
|
Re: 4 motor Mecanum wheel code request
Quote:
Is there any where I can download those example files onto my computer so I don't have to be at the school? Thanks to all the help again! |
|
#14
|
|||||
|
|||||
|
Re: 4 motor Mecanum wheel code request
You can use the disks from the Kit of Parts to load LabVIEW for FRC on your own computer. Then download and install the LabVIEW update (see http://www.usfirst.org/frccontrolsystem for the link).
The HolonomicDrive vi is in the RobotDrive palette of the WPI Robotics Library functions. Once placed on the block diagram, it can be changed from Polar to Cartesian input. |
|
#15
|
||||
|
||||
|
Alan- is this sort of what you were talking about?
I guess I should note that Axis 3 and Axis 4 are a second set of X+Y axis from our Logitech Dual-Action Gamepad |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |