Quote:
Originally Posted by Oblarg
Edit 2: I have never worked with python myself, so perhaps I'm missing something, but it seems to me that the onTarget() function in the python WPILib doesn't actually, erm, do anything (other than throw a value error):
Code:
def onTarget(self):
"""Return True if the error is within the percentage of the total input
range, determined by setTolerance. This assumes that the maximum and
minimum input were set using :func:`setInput`.
:returns: True if the error is less than the tolerance
"""
raise ValueError("No tolerance value set when using PIDController.onTarget()")
|
The onTarget method of each instance gets assigned to either PercentageTolerance_onTarget or AbsoluteTolerance_onTarget when you call setTolerance, setAbsoluteTolerance, or setPercentTolerance (i.e. you have to call one of those before calling onTarget):
https://github.com/robotpy/robotpy-w...r.py#L431-L467