Quote:
|
Originally Posted by Inverted
I figured that much, but when I tried to mess with the terms, switching the + and -, I only succeeded in making the whole control scheme inverted (how ironic).
|
When I encounter problems like this where I'm not sure if my logic or formulas are working I create some test cases on paper with real numbers and see what happens. When I do the math on the original code it appears to me that the steering is reversed - based on the comments! But I don't have a working robot in front of me to verify.
You went to far in modifying the code. If this original doesn't work:
Code:
pwm13 = pwm14 = Limit_Mix(2000 + p1_y + p1_x - 127);
pwm15 = pwm16 = Limit_Mix(2000 + p1_y - p1_x + 127);
then either swap the pwm vars between formulas or change just the way the x and y values are mixed like this:
Code:
pwm13 = pwm14 = Limit_Mix(2000 + p1_y - p1_x + 127);
pwm15 = pwm16 = Limit_Mix(2000 + p1_y + p1_x - 127);