[wpilib] PIDController: Recompute the error in AtSetpoint() (#2822)

This makes AtSetpoint() return false after the setpoint is changed with
SetSetpoint().

Closes #2821.

Co-authored-by: Prateek Machiraju <prateek.machiraju@gmail.com>
This commit is contained in:
Tyler Veness
2020-11-28 14:33:17 -08:00
committed by GitHub
parent 2056f0ce09
commit 3413bfc06a
5 changed files with 45 additions and 5 deletions

View File

@@ -238,6 +238,7 @@ class PIDController : public frc::Sendable,
double m_velocityTolerance = std::numeric_limits<double>::infinity();
double m_setpoint = 0;
double m_measurement = 0;
};
} // namespace frc2