Quote:
Originally Posted by Shantali
Hi all,
I'm programming for rookie team. I barely have any experience with Java or robotics for that matter.
My goal is to make the robot drive with a single joystick in differential "tank" drive.
Here's the schematic that I found that would be ideal...
http://web.goodrobot.com/blog/wp-con.../tankdrive.png
I'm using Iterative robot template.
Any help would be greatttly appreciated!
J
|
Try this:
// Xj,Yj are the joystick readings
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