Closed newjanson closed 7 years ago
You're correct in saying that it is a simple P gain on the angle difference. The calculation for this value comes from Team 254's Presentation on Motion Profiling. It seems to work well in most cases, but can be changed to your preference.
The negative part doesn't matter, it just means you'll have to switch the left and right motors
// Switch the +/- if you don't want turn's P gain to be negative
left.set(l+ turn);
right.set(r - turn);
Thanks!
I have been reading over the Tankdrive EncoderFollower documentation, and I'm not sure what this means:
The line that I'm unsure about is
double turn = 0.8 * (-1.0/80.0) * angleDifference;
. What does0.8 * (-1.0/80.0)
mean? Is this just a mystery P value of 0.01? Why is it negative?I'm sorry if I'm missing something, but I don't get what significance 80 or 0.8 has in this equation.