mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Remove percent tolerance from PID controller
It breaks the unit system badly; the tolerance member variable has different units depending on percent vs absolute. Absolute tolerance is a lot more natural than percent tolerance anyway.
This commit is contained in:
committed by
Peter Johnson
parent
0ca8d667d2
commit
ff8b8f0a8a
@@ -140,7 +140,7 @@ TEST_P(MotorEncoderTest, PositionPIDController) {
|
||||
Reset();
|
||||
double goal = 1000;
|
||||
frc2::PIDController pidController(0.001, 0.01, 0.0);
|
||||
pidController.SetAbsoluteTolerance(50.0);
|
||||
pidController.SetTolerance(50.0);
|
||||
pidController.SetOutputRange(-0.2, 0.2);
|
||||
pidController.SetSetpoint(goal);
|
||||
|
||||
@@ -166,7 +166,7 @@ TEST_P(MotorEncoderTest, VelocityPIDController) {
|
||||
Reset();
|
||||
|
||||
frc2::PIDController pidController(1e-5, 0.0, 0.0006);
|
||||
pidController.SetAbsoluteTolerance(200.0);
|
||||
pidController.SetTolerance(200.0);
|
||||
pidController.SetOutputRange(-0.3, 0.3);
|
||||
pidController.SetSetpoint(600);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user