View Single Post
  #12   Spotlight this post!  
Unread 25-11-2011, 00:14
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
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 Djur View Post
This is our team's custom mecanum code:

Code:
jaguarDrive((jX+jY)/2, (jY-jX)/2, -(jY-jX)/2, -(jX+jY)/2);
jX and jY are just the X and Y coordinates our joysticks read (-1 through 1).


This is by far the simplest solution I've seen.
Simplicity comes at a price:

If jX is zero, your forward command to the wheels is limited to +/-0.5.

If jY is zero, your strafe command to the wheels is limited to +/-0.5

Only when |jX|=|jY|=1 will you ever be commanding full power.


Quote:
Originally Posted by Djur View Post
That's very interesting, although I see no point at which a robot would need to do that except for showing off.
Most folks like to be able to turn while driving, rather than have to stop and rotate-in-place.





Last edited by Ether : 25-11-2011 at 00:17.
Reply With Quote