mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
There were three bugs: 1. The input range variables used in ProfiledPIDController::Calculate() weren't being updated 2. The modulus error calculation was incorrect. 3. The setpoint wasn't being wrapped like the goal, so the invariant that the error remains less than half the input range was violated. (Thanks to @CptJJ for pointing this out and suggesting a fix.)