[wpilibc] Fix ProfiledPID SetTolerance default velocity value (#4054)

When trying to set the tolerance of a ProfiledPID, it fails if you don't give it a velocity value. It was missing a conversion from double to the appropiate unit.
This commit is contained in:
Alberto Jahuey Moncada
2022-02-25 22:27:56 -06:00
committed by GitHub
parent bc9e96e86f
commit ac5d46cfa7

View File

@@ -224,9 +224,9 @@ class ProfiledPIDController
* @param positionTolerance Position error which is tolerable.
* @param velocityTolerance Velocity error which is tolerable.
*/
void SetTolerance(
Distance_t positionTolerance,
Velocity_t velocityTolerance = std::numeric_limits<double>::infinity()) {
void SetTolerance(Distance_t positionTolerance,
Velocity_t velocityTolerance =
Velocity_t(std::numeric_limits<double>::infinity())) {
m_controller.SetTolerance(positionTolerance.value(),
velocityTolerance.value());
}