We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f92493 commit 16e7dcdCopy full SHA for 16e7dcd
src/pid.cpp
@@ -90,15 +90,15 @@ void Pid::reset()
90
cmd_ = 0.0;
91
92
// If last integral error is already zero, just return
93
- if (std::fabs(i_error_) < std::numeric_limits<double>::epsilon())
+ if (std::abs(i_error_) < std::numeric_limits<double>::epsilon())
94
{
95
return;
96
}
97
98
// Get the gain parameters from the realtime buffer
99
Gains gains = *gains_buffer_.readFromRT();
100
// Check to see if we should reset integral error here
101
- if (!gains.save_iterm_) i_error_ = 0.0;
+ if (!gains.save_iterm_) clear_saved_iterm();
102
103
104
void Pid::clear_saved_iterm()
0 commit comments