Skip to content

Commit 16e7dcd

Browse files
Apply suggestions from code review
Co-authored-by: Sai Kishor Kothakota <[email protected]>
1 parent 0f92493 commit 16e7dcd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pid.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ void Pid::reset()
9090
cmd_ = 0.0;
9191

9292
// If last integral error is already zero, just return
93-
if (std::fabs(i_error_) < std::numeric_limits<double>::epsilon())
93+
if (std::abs(i_error_) < std::numeric_limits<double>::epsilon())
9494
{
9595
return;
9696
}
9797

9898
// Get the gain parameters from the realtime buffer
9999
Gains gains = *gains_buffer_.readFromRT();
100100
// Check to see if we should reset integral error here
101-
if (!gains.save_iterm_) i_error_ = 0.0;
101+
if (!gains.save_iterm_) clear_saved_iterm();
102102
}
103103

104104
void Pid::clear_saved_iterm()

0 commit comments

Comments
 (0)