Skip to content

Commit 410c61d

Browse files
Apply suggestions from code review
Co-authored-by: Sai Kishor Kothakota <[email protected]>
1 parent 8c7a6bc commit 410c61d

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

include/control_toolbox/pid.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ class Pid
208208

209209
/*!
210210
* \brief Reset the state of this PID controller
211+
* @note The integral term is not retained and it is reset to zero
211212
*/
212213
void reset();
213214

include/control_toolbox/pid_ros.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ class PidROS
125125

126126
/*!
127127
* \brief Reset the state of this PID controller
128+
* @note The integral term is not retained and it is reset to zero
128129
*/
129130
void reset();
130131

@@ -133,7 +134,7 @@ class PidROS
133134
*
134135
* \param save_iterm boolean indicating if integral term is retained on reset()
135136
*/
136-
void reset(bool save_iterm = false);
137+
void reset(bool save_iterm);
137138

138139
/*!
139140
* \brief Set the PID error and compute the PID command with nonuniform time

src/pid.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,6 @@ void Pid::reset(bool save_iterm)
9393
d_error_ = 0.0;
9494
cmd_ = 0.0;
9595

96-
// If last integral error is already zero, just return
97-
if (std::abs(i_error_) < std::numeric_limits<double>::epsilon())
98-
{
99-
return;
100-
}
101-
10296
// Check to see if we should reset integral error here
10397
if (!save_iterm) clear_saved_iterm();
10498
}

0 commit comments

Comments
 (0)