|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Best way to control the mechanum wheels
So I've heard that it's easier to control the robot with four mechunum wheels with an x-box controller. Is this true? If it is true how do you program that, because I'm our teams programmer?
|
|
#2
|
|||
|
|||
|
Re: Best way to control the mechanum wheels
First, before touching any code, write down everything on paper. Now I personally have no experience with mechanum drive, but I do have lots of experiences when the robot goes haywire because I used the wrong operation or something silly like that. Always double check before hitting "run".
I would say if the X axis (or what ever you are trying to control the strafing with) is past a certain point then switch to "strafing" mode. Then make the wheels rotate based on the x axis. Its quiet simple IMHO. I assume you would have the same code for the regular 4, 6, 8 wheel drive then tag on the strafing. |
|
#3
|
|||
|
|||
|
Re: Best way to control the mechanum wheels
slow down there i forgot to say this our first year with mecanum wheels should we just stick to the basics with the joysticks?
|
|
#4
|
||||
|
||||
|
Re: Best way to control the mechanum wheels
You should use a joystick with a twist axis. Forward and back make the robot go forward and back, side to side makes it strafe, and twisting the joystick turns the robot. I have no idea about the programming though, I do mechanical/CAD.
|
|
#5
|
|||
|
|||
|
Re: Best way to control the mechanum wheels
No, I say go for it bro. If you do not have the resources to build a prototype, I can make a software simulator for you. It won't be a robot driving on screen, but I can do motors on screen displaying its PWMs. First get the regular 4 wheel drive working with 1 joystick (the xbox controller in this case) then I will assist you with the mechanum drive. From the looks of it, its just the 4 wheel arcade with some extra
|
|
#6
|
|||||
|
|||||
|
Re: Best way to control the mechanum wheels
Quote:
Stick to the joysticks. There's prewritten code around somewhere; you would of course have to find it in your favorite language and tweak it for your robot. I don't recommend doing mecanum in the six weeks if you haven't done it before; if you do it that way, KISS is a MUST. Start with stuff that's already out there. David, you're close to right about the method, except that you forgot one thing: 4 independent motors vs 2 pairs of 2 motors. 2 pairs of 2 motors, you can Y-cable. 4 independent, it's a lot harder to Y-cable for some reason. Also use caution: Should you go to fallback (mecanum goes to 4WD rather easily), make sure you comment out the strafing--Alan Anderson of FRC45 found that out the hard way. You could also do a complete directional program. That might be a bit harder. |
|
#7
|
|||
|
|||
|
Re: Best way to control the mechanum wheels
My team really wants to do mecanum wheels... Anyone got any sample code for two joysticks+mecanum wheels?
|
|
#8
|
|||
|
|||
|
Re: Best way to control the mechanum wheels
This is my 2nd year programming and last year we had a basic 4 wheel drive. For this year the team has chosen to go with mecanum. I'm using labview. It would be awesome if someone could teach me the programming behind mecanum drive.
|
|
#9
|
|||
|
|||
|
Re: Best way to control the mechanum wheels
Im using c++ anyone got any good libraries?
|
|
#10
|
|||
|
|||
|
Re: Best way to control the mechanum wheels
The only library allowed is the WPILib.
|
|
#11
|
|||||
|
|||||
|
Re: Best way to control the mechanum wheels
Show me the rule, because I can't find that one in the Game Manual Section 4.
In 2008, I know I found a link to some "canned" mecanum code lying around CD. However, the programming language that year was C, so it wouldn't work this year without modification. I might be able to find it again... but it would take a while. |
|
#12
|
||||
|
||||
|
Re: Best way to control the mechanum wheels
http://runnymede-robotics.googlecode..._Team_1310_V2/
http://www.youtube.com/user/1310Robo.../0/7mBxVPvyYwQ |
|
#13
|
|||||
|
|||||
|
Re: Best way to control the mechanum wheels
tomy,
For C++ (LV, & Java also) WPILib provides a couple Mecanum drive methods in the RobotDrive Class. I recommend you start out with MecanumDrive_Cartesian() function. Documentation of this function (generated using Doxygen on comments in WPILib) is provided online by Dustin Spicuzza of Team 2423 is here. It hasn't been updated since last Feb 5th but I dont expect any changes since then. I don't know enough about how the left and right thumbsticks for the Xbox controller are mapped to axises in WPILib to give you a specific call. However, my suggestion is if you have a driver with experience on an Arcade Drive (single joystick for 4wd or 6wd) then use one thumbstick for y and rotation parameters in MecanumDrive_Cartesian() and the x-axis of another thumbstick for x. With this configuration, the driver can use one thumbstick to drive like the arcade drive (that they are experienced with) and add strafing with the other thumbstick. If you do not have experienced driver then decide which thumbstick mapping you think is best. I encourage you to develop advanced features like the ones in Team 1310's code above once you are comfortable with Mecanum. The MecanumDrive_Cartesian() should be all you need to protoype the Mecanum and start training drivers. If you need any help initializing the RobotDrive with your 4 motors or anything else, just ask and I am sure someone on this forum will help ASAP Good Luck Last edited by The Lucas : 13-01-2011 at 08:20. |
|
#14
|
|||||
|
|||||
|
Re: Best way to control the mechanum wheels
I'm not aware of that restriction. Where did you find it?
|
|
#15
|
|||
|
|||
|
Re: Best way to control the mechanum wheels
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|