Quote:
Originally Posted by Joe Derrick
double robotArcLength = (leftDistance-rightDistance)/2;
double robotDegrees = 360*(robotArcLength/(Math.PI*wheelbase);
|
Also, that should be 180, not 360. If your left wheels have traveled an extra track width, you will have turned one radian (57 degrees), not two (114 deg). If you're just using this for a PID, it probably didn't matter, because you wound up dividing all your PID constants by 2 in the tuning. It should read:
Code:
double robotArcLength = (leftDistance-rightDistance)/2;
double robotDegrees = 180*(robotArcLength/(Math.PI*trackWidth);