View Single Post
  #2   Spotlight this post!  
Unread 21-01-2010, 12:31
kE7JLM's Avatar
kE7JLM kE7JLM is offline
KE7JLM `
AKA: John Harris
FRC #0842 (Falcon Robotics)
Team Role: Driver
 
Join Date: May 2007
Rookie Year: 2006
Location: Phoenix, AZ`
Posts: 136
kE7JLM is a name known to allkE7JLM is a name known to allkE7JLM is a name known to allkE7JLM is a name known to allkE7JLM is a name known to allkE7JLM is a name known to all
Send a message via MSN to kE7JLM
Re: Questions about mecanum wheels

What is your wheel config?

Here is the code I've done for off season projects, you may want to add dead zones. This also does not have the power problems -

Code:
                if (ws.ButtonState.Two == true)
                {
                    leftmotorcontrol.motors[0].Velocity = -100 * (ws.AccelState.Values.X - ws.AccelState.Values.Y + turn); // front left
                    leftmotorcontrol.motors[1].Velocity = -100 * (ws.AccelState.Values.X + ws.AccelState.Values.Y + turn); // rear left
                    rightmotorcontrol.motors[0].Velocity = 100 *(ws.AccelState.Values.X + ws.AccelState.Values.Y - turn); // front right
                    rightmotorcontrol.motors[1].Velocity = 100 * (ws.AccelState.Values.X - ws.AccelState.Values.Y - turn); // rear right
                }
                else
                {
                    leftmotorcontrol.motors[0].Velocity = 0.00;
                    leftmotorcontrol.motors[1].Velocity = 0.00;
                    rightmotorcontrol.motors[0].Velocity = 0.00;
                    rightmotorcontrol.motors[1].Velocity = 0.00;
                }
The if statement is a safety measure

I was using a wiimote so the "joystick values" (Really i used the accelerometers) gave an output of -1 to 1, you get a 0 - 255?. Its really simple just add up the x,y,z(rotation) and give each wheel the values they need.Diagrams help alot.

Are you using two or one joystick?

Take a look at this thread -
http://www.chiefdelphi.com/forums/sh...hlight=wiimote

PM me if you need more help
__________________
Team 842 Programmer

Pictures at:
http://picasaweb.google.com/KE7JLM
&
http://picasaweb.google.com/john.h.842

Videos -
http://www.youtube.com/user/KE7JLM

When your not busy with FIRST try NURC