mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
In addition to m_prevError and m_totalError, m_positionError and m_velocityError need to be reset to 0 when reset() is called. Otherwise, the next time calculate() is called, the old values will be used as the previous error, but this is inaccurate since the caller wanted to reset the state of the PID controller.