mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +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
@@ -26,8 +26,7 @@ TurnToAngle::TurnToAngle(double targetAngleDegrees, DriveSubsystem* drive)
|
||||
// Set the controller tolerance - the delta tolerance ensures the robot is
|
||||
// stationary at the setpoint before it is considered as having reached the
|
||||
// reference
|
||||
m_controller.SetAbsoluteTolerance(kTurnToleranceDeg,
|
||||
kTurnRateToleranceDegPerS);
|
||||
m_controller.SetTolerance(kTurnToleranceDeg, kTurnRateToleranceDegPerS);
|
||||
|
||||
AddRequirements({drive});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user