We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da9b7a3 commit 69a250eCopy full SHA for 69a250e
src/common/pid.cpp
@@ -56,3 +56,9 @@ float PIDController::operator() (float error){
56
timestamp_prev = timestamp_now;
57
return output;
58
}
59
+
60
+void PIDController::reset(){
61
+ integral_prev = 0.0f;
62
+ output_prev = 0.0f;
63
+ error_prev = 0.0f;
64
+}
src/common/pid.h
@@ -23,6 +23,7 @@ class PIDController
23
~PIDController() = default;
24
25
float operator() (float error);
26
+ void reset();
27
28
float P; //!< Proportional gain
29
float I; //!< Integral gain
0 commit comments