Quote:
Originally Posted by AustinH
The problem comes when we attempt to use a PID loop to hold the robot at 180° relative to the field. Normal joystick rotation works just fine.
|
Which language are you using?
A simple solution for this specific case would be to use the following logic:
if(angle < 0)
adjusted angle = angle + 360
else
adjusted angle = angle
Then, use adjusted angle wherever you would have used angle in the rest of the code. To get it to work for the more general case, you have to be a little more creative, but you can use this same idea.