View Single Post
  Spotlight this post!  
Unread 28-01-2011, 21:44
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,043
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: Single Joystick Tank Drive

Quote:
Originally Posted by Bot190 View Post
As far as I can tell from your description, you are describing Arcade drive exactly. It takes an x and y axis, and outputs to 2 or 4 motors similar to tank drive.

In other word, full left on the joystick would make the right side go full forward, and left side go full backwards. Full right would make right go full backward, and left go full forwards. And so on.

Some drivers find the following a bit more intuitive to drive:

if(Yj<=0){L=-Yj+Xj; R=-Yj-Xj;}

else {L= -Yj-Xj; R=-Yj+Xj;}

max=abs(L); if(max<abs(R))max=abs(R);

if(max>1){L/=max; R/=max;}

send "L" to the left wheels and "R" to the right wheels


Reply With Quote