![]() |
Re: Best way to control the mechanum wheels
Wow thanks I can wait to try it out
|
Re: Best way to control the mechanum wheels
Quote:
|
Re: Best way to control the mechanum wheels
The algorithms for the speeds to drive each wheel are in white papers here, i'm sure. For omnidirectional drives, I like to use the setup with one joystick doing direction, plus one more axis doing turning. My team has found that twisting a stick makes it harder to drive. This setup is ideal for a game controller, which is quite trivial to program if you know how to do a normal joystick (see getRawAxis). If you are up to it, making the drive field-centric using a gyroscope makes it much more intuitive to drive.
|
Re: Best way to control the mechanum wheels
Quote:
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. |
Re: Best way to control the mechanum wheels
|
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 |
Re: Best way to control the mechanum wheels
Grab a sheet of paper and a writing utensil, hook up your controller to the robot's controller, and use labview to output all inputs to the screen. Write down what inputs are where.
For mecanum drive, we have always found its best to separate twist from your cardinal directions, make it the x-axis of a separate joystick. Some 3-axis joysticks have a tendency to twist while moving any other direction. Another thing you should seriously consider doing with mecanum drive is field-centric positioning with a gyro. It takes a little extra trigonometry, a little extra debugging, but it makes driving the robot SO much easier. In my experience, anyone could drive this type of robot without any training at all, and do it very well. I'd like to think 868's success last year was in part due to this. Let us know if you need help getting set up with that, I may have my old tutorials lying around. |
Re: Best way to control the mechanum wheels
Quote:
|
Re: Best way to control the mechanum wheels
Quote:
|
Re: Best way to control the mechanum wheels
You get a holonomic drive VI with the Labview libraries. All you have to do is plug your three joystick axes into that VI, and it gives you the output levels for each of the four drive motors.
|
Re: Best way to control the mechanum wheels
Quote:
Quote:
|
Re: Best way to control the mechanum wheels
During the season, or in the offseason, you can modify, rewrite, or replace any of the libraries above the FPGA access libraries. Since writing that from scratch would literally take you years, may I suggest learning to read the code that is there.
FYI, one of my biggest turn-offs when interviewing job candidates is the NIH syndrome. NIH == Not Invented Here. It seems to be a phase all programmers and engineers go through, but almost nobody is productive enough to be able to compete well until they get over it. Learn to read, debug, analyze, criticize, praise, understand, extend, and communicate the designs of others. It will serve you well. You cannot modify the FPGA. That would remove the ability for FIRST to control the outputs and provide a safe experience for team members, volunteers, etc. Greg McKaskle |
Re: Best way to control the mechanum wheels
Seems like a lot of teams (ours included) are giving mecanum a shot this year. Here are a few things I've picked up...
-Basic mecanum is pretty easy to achieve using the built in "holonomic drive" function, which either taken in 3 axis values (x=strafe,y=fwd/rev,z=rotation) or a polar coordinate (magnitude and direction). The derived equations are based on the solution to the Inverse Kinematics Problem (see: http://www.simbotics.org/files/first...irectional.pdf). -There are various ways to taken in inputs. One method is a twisting joystick. Another method is using two joysticks--one for x and y translation, and one for rotation. A final method is a joystick and two buttons--the joystick handles translation, and the two buttons handle left and right rotation at constant speed. -To make mecanum better, use closed-loop control on the robot's header angle and/or wheel speeds. This can be accomplished with a gyro and encoders. -To make mecanum better better, you can consider driver-centric control. This means that, no matter what the robot's header angle is, pushing the joystick away from you means that the robot moves away from you. This can be best accomplished by using the Polar coordinates implementation of mecanum, and using the gyro angle to modify the angle. -To make mecanum better better better, consider using steering curves (see: http://www.chiefdelphi.com/media/papers/2421). |
Re: Best way to control the mechanum wheels
mecanum wheels were so much fun using last year
if you'd like to see how we used it in our labview code, just download our code See attachment from this thread http://www.chiefdelphi.com/forums/sh...ad.php?t=87949 |
| All times are GMT -5. The time now is 23:58. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi