View Single Post
  #4   Spotlight this post!  
Unread 08-02-2011, 08:10
Robby Unruh's Avatar
Robby Unruh Robby Unruh is offline
*insert random dial-up tone here*
FRC #3266 (Robots R Us)
Team Role: Coach
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Eaton, OH
Posts: 338
Robby Unruh will become famous soon enough
Re: Programming Mecanum?

Quote:
Originally Posted by Ether View Post
That is explained on the second page:

Code:
front_left = forward + clockwise + right;
front_right = forward - clockwise - right;
rear_left = forward + clockwise - right;
rear_right = forward - clockwise + right;
// Finally, normalize the wheel speed commands
// so that no wheel speed command exceeds magnitude of 1:
max = abs(front_left);
if (abs(front_right)>max) max = abs(front_right);
if (abs(rear_left)>max) max = abs(rear_left);
if (abs(rear_right)>max) max = abs(rear_right);
if (max>1)
{front_left/=max; front_right/=max; rear_left/=max; rear_right/=max;}

// You're done. Send these four wheel commands to their respective wheels
front_left, front_right, rear_left, rear_right are the commands to send to each mecanum wheel.

If that's not what you were asking, please clarify your question and I'll try again.

Okay, thanks again. So I just send those wheels in the drive train like so:

Code:
RobotDrive driveTrain = new RobotDrive(front_left, rear_left, front_right, rear_right);
Then invert the motors like I've been doing, or...?
__________________
[Robots R Us #3266]
2015: Georgia Southern Classic (Winners / Thanks 1319 & 1648!), Queen City
2014: Crossroads, Queen City
2013: Buckeye, Queen City, Crossroads
2012: Buckeye, Queen City

2011: Buckeye
2010: Buckeye
Reply With Quote