Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
pid_controller.hpp
Go to the documentation of this file.
1/*------------------------------------------------------------------------------
2* Copyright (C) 2024 LEIDOS.
3*
4* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5* use this file except in compliance with the License. You may obtain a copy of
6* the License at
7*
8* http://www.apache.org/licenses/LICENSE-2.0
9*
10* Unless required by applicable law or agreed to in writing, software
11* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13* License for the specific language governing permissions and limitations under
14* the License.
15
16------------------------------------------------------------------------------*/
17
18#include <rclcpp/rclcpp.hpp>
20
22{
28 {
29 public:
30
35
39 std::shared_ptr<PlatooningControlPluginConfig> config_ = std::make_shared<PlatooningControlPluginConfig>();
40
41
42 // ~PIDController();
43
44 // Kp - proportional gain
45 // Ki - Integral gain
46 // Kd - derivative gain
47 // dt - loop interval time
48 // max - maximum value of manipulated variable
49 // min - minimum value of manipulated variable
50 // PID( double dt, double max, double min, double Kp, double Kd, double Ki );
51
58 double calculate( double setpoint, double pv );
59 // ~PID();
60
61 void reset();
62
63 private:
64
65 double _pre_error = 0.0;
66 double _integral = 0.0;
67 };
68}
This class includes logic for PID controller. PID controller is used in this plugin to maintain the i...
std::shared_ptr< PlatooningControlPluginConfig > config_
plugin config object
PIDController()
Constructor for the PID controller class.
double calculate(double setpoint, double pv)
function to calculate control command based on setpoint and process vale