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:
Tyler Veness
2019-08-25 13:01:51 -07:00
committed by Peter Johnson
parent 0ca8d667d2
commit ff8b8f0a8a
29 changed files with 121 additions and 507 deletions

View File

@@ -118,21 +118,6 @@ class ProfiledPIDController : public SendableBase {
*/
units::meter_t GetGoal() const;
/**
* Returns true if the error is within tolerance of the setpoint.
*
* This will return false until at least one input value has been computed.
*
* @param positionTolerance The maximum allowable position error.
* @param velocityTolerance The maximum allowable velocity error.
* @param toleranceType The type of tolerance specified.
*/
bool AtGoal(
double positionTolerance,
double velocityTolerance = std::numeric_limits<double>::infinity(),
frc2::PIDController::Tolerance toleranceType =
frc2::PIDController::Tolerance::kAbsolute) const;
/**
* Returns true if the error is within the tolerance of the error.
*
@@ -154,21 +139,6 @@ class ProfiledPIDController : public SendableBase {
*/
double GetSetpoint() const;
/**
* Returns true if the error is within tolerance of the setpoint.
*
* This will return false until at least one input value has been computed.
*
* @param positionTolerance The maximum allowable position error.
* @param velocityTolerance The maximum allowable velocity error.
* @param toleranceType The type of tolerance specified.
*/
bool AtSetpoint(
double positionTolerance,
double velocityTolerance = std::numeric_limits<double>::infinity(),
frc2::PIDController::Tolerance toleranceType =
frc2::PIDController::Tolerance::kAbsolute) const;
/**
* Returns true if the error is within the tolerance of the error.
*
@@ -180,14 +150,6 @@ class ProfiledPIDController : public SendableBase {
*/
bool AtSetpoint() const;
/**
* Sets the minimum and maximum values expected from the input.
*
* @param minimumInput The minimum value expected from the input.
* @param maximumInput The maximum value expected from the input.
*/
void SetInputRange(double minimumInput, double maximumInput);
/**
* Enables continuous input.
*
@@ -214,24 +176,13 @@ class ProfiledPIDController : public SendableBase {
void SetOutputRange(double minimumOutput, double maximumOutput);
/**
* Sets the absolute error which is considered tolerable for use with
* Sets the error which is considered tolerable for use with
* AtSetpoint().
*
* @param positionTolerance Position error which is tolerable.
* @param velocityTolerance Velocity error which is tolerable.
*/
void SetAbsoluteTolerance(
double positionTolerance,
double velocityTolerance = std::numeric_limits<double>::infinity());
/**
* Sets the percent error which is considered tolerable for use with
* AtSetpoint().
*
* @param positionTolerance Position error which is tolerable.
* @param velocityTolerance Velocity error which is tolerable.
*/
void SetPercentTolerance(
void SetTolerance(
double positionTolerance,
double velocityTolerance = std::numeric_limits<double>::infinity());