robotpy / robotpy-wpilib

Moved to https://github.com/robotpy/mostrobotpy
https://robotpy.github.io
Other
169 stars 59 forks source link

onTarget() doesn't actually have any function? #196

Closed schlumpyj closed 8 years ago

schlumpyj commented 8 years ago

I asked the Delphi community why the sample PID program wasn't working, even with me trying to use the onTarget() to stop the loop and a user pointed out that there isn't actually any function to onTarget other than to raise a ValueError. Thread: https://www.chiefdelphi.com/forums/showthread.php?threadid=149281

virtuald commented 8 years ago

If you call setXXXTolerance first, it will replace the onTarget function. See https://github.com/robotpy/robotpy-wpilib/blob/master/wpilib/wpilib/pidcontroller.py#L445