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.
|
This class includes logic for PID controller. PID controller is used in this plugin to maintain the inter-vehicle gap by adjusting the speed. More...
#include <pid_controller.hpp>
Public Member Functions | |
PIDController () | |
Constructor for the PID controller class. More... | |
double | calculate (double setpoint, double pv) |
function to calculate control command based on setpoint and process vale More... | |
void | reset () |
Public Attributes | |
std::shared_ptr< PlatooningControlPluginConfig > | config_ = std::make_shared<PlatooningControlPluginConfig>() |
plugin config object More... | |
Private Attributes | |
double | _pre_error = 0.0 |
double | _integral = 0.0 |
This class includes logic for PID controller. PID controller is used in this plugin to maintain the inter-vehicle gap by adjusting the speed.
Definition at line 27 of file pid_controller.hpp.
platooning_control::PIDController::PIDController | ( | ) |
double platooning_control::PIDController::calculate | ( | double | setpoint, |
double | pv | ||
) |
function to calculate control command based on setpoint and process vale
setpoint | desired value |
pv | current value |
Definition at line 24 of file pid_controller.cpp.
References _integral, _pre_error, and config_.
Referenced by platooning_control::PlatooningControlWorker::generate_speed().
void platooning_control::PIDController::reset | ( | ) |
Definition at line 68 of file pid_controller.cpp.
References _integral, and _pre_error.
Referenced by platooning_control::PlatooningControlWorker::generate_speed().
|
private |
Definition at line 66 of file pid_controller.hpp.
Referenced by calculate(), and reset().
|
private |
Definition at line 65 of file pid_controller.hpp.
Referenced by calculate(), and reset().
std::shared_ptr<PlatooningControlPluginConfig> platooning_control::PIDController::config_ = std::make_shared<PlatooningControlPluginConfig>() |