From ac5d46cfa7824048171e5b93185eb18372bbba6a Mon Sep 17 00:00:00 2001 From: Alberto Jahuey Moncada Date: Fri, 25 Feb 2022 22:27:56 -0600 Subject: [PATCH] [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. --- .../native/include/frc/controller/ProfiledPIDController.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wpimath/src/main/native/include/frc/controller/ProfiledPIDController.h b/wpimath/src/main/native/include/frc/controller/ProfiledPIDController.h index e0b10c761b..82ae0ae723 100644 --- a/wpimath/src/main/native/include/frc/controller/ProfiledPIDController.h +++ b/wpimath/src/main/native/include/frc/controller/ProfiledPIDController.h @@ -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::infinity()) { + void SetTolerance(Distance_t positionTolerance, + Velocity_t velocityTolerance = + Velocity_t(std::numeric_limits::infinity())) { m_controller.SetTolerance(positionTolerance.value(), velocityTolerance.value()); }