EasyNav Simple Stack
Loading...
Searching...
No Matches
PIDController.hpp
Go to the documentation of this file.
1// Copyright 2021 Intelligent Robotics Lab
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
17
18#ifndef EASYNAV_SIMPLE_CONTROLLER__PIDCONTROLLER_HPP_
19#define EASYNAV_SIMPLE_CONTROLLER__PIDCONTROLLER_HPP_
20
21#include <cmath>
22
23namespace easynav
24{
25
28{
29public:
40 PIDController(double min_ref, double max_ref, double min_output, double max_output);
41
49 void set_pid(double n_KP, double n_KI, double n_KD);
50
59 double get_output(double new_reference);
60
61private:
62 double KP_;
63 double KI_;
64 double KD_;
65
66 double min_ref_;
67 double max_ref_;
68 double min_output_;
69 double max_output_;
70
71 double prev_error_;
72 double int_error_;
73};
74
75} // namespace easynav
76
77#endif // EASYNAV_SIMPLE_CONTROLLER__PIDCONTROLLER_HPP_
PIDController(double min_ref, double max_ref, double min_output, double max_output)
Constructor.
Definition PIDController.cpp:22
double get_output(double new_reference)
Computes the control output for the given reference input.
Definition PIDController.cpp:44
void set_pid(double n_KP, double n_KI, double n_KD)
Sets the PID gains.
Definition PIDController.cpp:36
Definition SimpleMap.hpp:37