At the moment, these commands finish if onTarget() is true for just one cycle. However, this can happen while passing through the target value (i.e. overshooting). The result is that PID is disabled while still in motion and the final resting position/orientation can be significantly different that requested.
@Gabe-Mitnick suggests only letting isFinished() return true if we are onTarget() and the rate (e.g. ahrs.getRate() or encoder.getRate()) are sufficiently small.
At the moment, these commands finish if onTarget() is true for just one cycle. However, this can happen while passing through the target value (i.e. overshooting). The result is that PID is disabled while still in motion and the final resting position/orientation can be significantly different that requested.
@Gabe-Mitnick suggests only letting isFinished() return true if we are onTarget() and the rate (e.g. ahrs.getRate() or encoder.getRate()) are sufficiently small.