View Single Post
  #6   Spotlight this post!  
Unread 25-10-2011, 21:33
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
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: help with mecanum drive code

Quote:
Originally Posted by austin1743 View Post
Ross, i have added the js1 (joystick1) into the code thanks for catching that

Joseph thanks for the mecanum in a nut shell. I know mecanum wheels have some weird math vectors behind them which i sort of understand but how does that relate to the controller? I ask this as I am a little confused on why the code would have magnitude from the controller?
If the driver is using a joystick, the magnitude can be computed using sqrt(X^2+Y^2), or perhaps max(abs(X),abs(Y)). That is used as a speed command - how fast the driver wants the vehicle to go.

The direction is computed using for example theta = atan2(-Y,X). It is the clockwise angle with zero in the forward direction. It is the driver command to tell which direction the driver wants the vehicle to move.



Last edited by Ether : 25-10-2011 at 21:51. Reason: added abs()
Reply With Quote