View Single Post
  #5   Spotlight this post!  
Unread 13-01-2011, 08:17
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
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
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"

Last edited by The Lucas : 13-01-2011 at 08:20.