View Single Post
  #15   Spotlight this post!  
Unread 24-11-2011, 23:15
Djur's Avatar
Djur Djur is offline
WPILib
AKA: Sam Carlberg
no team
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Massachusetts
Posts: 182
Djur will become famous soon enough
Re: help with mecanum drive code

Quote:
Originally Posted by Ether View Post
Code:
"y" is the forward command

"x" is the strafe right command

"z" is the rotate clockwise command


Step1:

Compute the 4 wheel speeds:

FL = y + x + z

FR = y - x - z

RL = y - x + z

RR = y + x - z


Step2:

Find the max absolute value of the above four commands, 
and if it is greater than 1, 
divide all four commands by that max absolute value.
That's very interesting, although I see no point at which a robot would need to do that except for showing off.
__________________
WPILib dev (RobotBuilder, SmartDashboard, GRIP)
Reply With Quote