diff --git a/include/control_toolbox/pid.hpp b/include/control_toolbox/pid.hpp index 3f431f71..38c8a7aa 100644 --- a/include/control_toolbox/pid.hpp +++ b/include/control_toolbox/pid.hpp @@ -208,6 +208,7 @@ class Pid /*! * \brief Reset the state of this PID controller + * @note The integral term is not retained and it is reset to zero */ void reset(); diff --git a/include/control_toolbox/pid_ros.hpp b/include/control_toolbox/pid_ros.hpp index 120d6452..5f82b029 100644 --- a/include/control_toolbox/pid_ros.hpp +++ b/include/control_toolbox/pid_ros.hpp @@ -125,6 +125,7 @@ class PidROS /*! * \brief Reset the state of this PID controller + * @note The integral term is not retained and it is reset to zero */ void reset(); @@ -133,7 +134,7 @@ class PidROS * * \param save_iterm boolean indicating if integral term is retained on reset() */ - void reset(bool save_iterm = false); + void reset(bool save_iterm); /*! * \brief Set the PID error and compute the PID command with nonuniform time diff --git a/src/pid.cpp b/src/pid.cpp index 8d0e0a1d..2a0ed340 100644 --- a/src/pid.cpp +++ b/src/pid.cpp @@ -93,12 +93,6 @@ void Pid::reset(bool save_iterm) d_error_ = 0.0; cmd_ = 0.0; - // If last integral error is already zero, just return - if (std::abs(i_error_) < std::numeric_limits::epsilon()) - { - return; - } - // Check to see if we should reset integral error here if (!save_iterm) clear_saved_iterm(); }