|
|
@ -34,13 +34,7 @@ class PIDController { |
|
|
|
void Input(float input) { input_ = input; } |
|
|
|
void Input(float input) { input_ = input; } |
|
|
|
float Input() const { return input_; }; |
|
|
|
float Input() const { return input_; }; |
|
|
|
|
|
|
|
|
|
|
|
float Error() const { |
|
|
|
float Error() const; |
|
|
|
float error = setpoint_ - input_; |
|
|
|
|
|
|
|
// TODO: have this be configurable
|
|
|
|
|
|
|
|
while (error < 180.f) error += 360.f; |
|
|
|
|
|
|
|
while (error > 180.f) error -= 360.f; |
|
|
|
|
|
|
|
return error; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
float Output() const { return output_; }; |
|
|
|
float Output() const { return output_; }; |
|
|
|
|
|
|
|
|
|
|
|
float Update(); |
|
|
|
float Update(); |
|
|
|