Skip to content

Commit

Permalink
[wpimath] Document default tolerances of PIDController (#7377)
Browse files Browse the repository at this point in the history
  • Loading branch information
Advay17 authored Nov 12, 2024
1 parent 425bf83 commit 0734571
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public double getVelocityTolerance() {
}

/**
* Returns the error tolerance of this controller.
* Returns the error tolerance of this controller. Defaults to 0.05.
*
* @return the error tolerance of the controller.
*/
Expand All @@ -255,7 +255,7 @@ public double getErrorTolerance() {
}

/**
* Returns the error derivative tolerance of this controller.
* Returns the error derivative tolerance of this controller. Defaults to ∞.
*
* @return the error derivative tolerance of the controller.
*/
Expand Down Expand Up @@ -301,7 +301,8 @@ public double getSetpoint() {
}

/**
* Returns true if the error is within the tolerance of the setpoint.
* Returns true if the error is within the tolerance of the setpoint. The error tolerance defaults
* to 0.05, and the error derivative tolerance defaults to ∞.
*
* <p>This will return false until at least one input value has been computed.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ class WPILIB_DLLEXPORT PIDController
constexpr units::second_t GetPeriod() const { return m_period; }

/**
* Gets the error tolerance of this controller.
* Gets the error tolerance of this controller. Defaults to 0.05.
*
* @return The error tolerance of the controller.
*/
constexpr double GetErrorTolerance() const { return m_errorTolerance; }

/**
* Gets the error derivative tolerance of this controller.
* Gets the error derivative tolerance of this controller. Defaults to ∞.
*
* @return The error derivative tolerance of the controller.
*/
Expand Down Expand Up @@ -252,6 +252,8 @@ class WPILIB_DLLEXPORT PIDController

/**
* Returns true if the error is within the tolerance of the setpoint.
* The error tolerance defauls to 0.05, and the error derivative tolerance
* defaults to ∞.
*
* This will return false until at least one input value has been computed.
*/
Expand Down

0 comments on commit 0734571

Please sign in to comment.