View Single Post
  #3   Spotlight this post!  
Unread 07-02-2011, 11:32
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,088
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Programming Mecanum?

Quote:
Originally Posted by Robby Unruh View Post
Thanks for the link. I'm still a little confused here, though.
Could you please explain how I'm supposed to use forward/backward/clockwise in the drive train programming?
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.



Last edited by Ether : 07-02-2011 at 11:35.
Reply With Quote