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 is the worker class for platoon controller. It is responsible for generating and smoothing the speed and steering control commands from trajectory points. More...
#include <platooning_control_worker.hpp>
Public Member Functions | |
PlatooningControlWorker () | |
Default constructor for platooning control worker. More... | |
double | get_last_speed_command () const |
Returns latest speed command. More... | |
void | generate_speed (const carma_planning_msgs::msg::TrajectoryPlanPoint &point) |
Generates speed commands (in m/s) based on the trajectory point. More... | |
void | set_leader (const PlatoonLeaderInfo &leader) |
Sets the platoon leader object using info from msg. More... | |
void | set_current_speed (double speed) |
set current speed More... | |
Public Attributes | |
PlatoonLeaderInfo | platoon_leader |
std::shared_ptr< PlatooningControlPluginConfig > | ctrl_config_ = std::make_shared<PlatooningControlPluginConfig>() |
double | speedCmd = 0 |
double | currentSpeed = 0 |
double | lastCmdSpeed = 0.0 |
double | speedCmd_ = 0 |
double | steerCmd_ = 0 |
double | angVelCmd_ = 0 |
double | desired_gap_ = ctrl_config_->stand_still_headway_m |
double | actual_gap_ = 0.0 |
bool | last_cmd_set_ = false |
Private Attributes | |
PIDController | pid_ctrl_ |
double | dist_to_front_vehicle |
This is the worker class for platoon controller. It is responsible for generating and smoothing the speed and steering control commands from trajectory points.
Definition at line 59 of file platooning_control_worker.hpp.
platooning_control::PlatooningControlWorker::PlatooningControlWorker | ( | ) |
Default constructor for platooning control worker.
Definition at line 25 of file platooning_control_worker.cpp.
References pid_ctrl_.
void platooning_control::PlatooningControlWorker::generate_speed | ( | const carma_planning_msgs::msg::TrajectoryPlanPoint & | point | ) |
Generates speed commands (in m/s) based on the trajectory point.
point | trajectory point |
Definition at line 35 of file platooning_control_worker.cpp.
References actual_gap_, platooning_control::PIDController::calculate(), platooning_control::PlatoonLeaderInfo::commandSpeed, ctrl_config_, currentSpeed, desired_gap_, last_cmd_set_, lastCmdSpeed, pid_ctrl_, platoon_leader, platooning_control::PIDController::reset(), speedCmd_, platooning_control::PlatoonLeaderInfo::staticId, and platooning_control::PlatoonLeaderInfo::vehiclePosition.
Referenced by platooning_control::PlatooningControlPlugin::generate_control_signals().
double platooning_control::PlatooningControlWorker::get_last_speed_command | ( | ) | const |
Returns latest speed command.
Definition at line 31 of file platooning_control_worker.cpp.
References speedCmd_.
void platooning_control::PlatooningControlWorker::set_current_speed | ( | double | speed | ) |
set current speed
speed | speed value |
Definition at line 137 of file platooning_control_worker.cpp.
References currentSpeed.
Referenced by platooning_control::PlatooningControlPlugin::generate_control_signals().
void platooning_control::PlatooningControlWorker::set_leader | ( | const PlatoonLeaderInfo & | leader | ) |
Sets the platoon leader object using info from msg.
leader | leader information msg received from strategic plugin |
Definition at line 133 of file platooning_control_worker.cpp.
References platoon_leader.
Referenced by platooning_control::PlatooningControlPlugin::generate_control_signals().
double platooning_control::PlatooningControlWorker::actual_gap_ = 0.0 |
Definition at line 108 of file platooning_control_worker.hpp.
Referenced by generate_speed(), and platooning_control::PlatooningControlPlugin::platoon_info_cb().
double platooning_control::PlatooningControlWorker::angVelCmd_ = 0 |
Definition at line 106 of file platooning_control_worker.hpp.
std::shared_ptr<PlatooningControlPluginConfig> platooning_control::PlatooningControlWorker::ctrl_config_ = std::make_shared<PlatooningControlPluginConfig>() |
Definition at line 99 of file platooning_control_worker.hpp.
Referenced by platooning_control::PlatooningControlPlugin::PlatooningControlPlugin(), and generate_speed().
double platooning_control::PlatooningControlWorker::currentSpeed = 0 |
Definition at line 102 of file platooning_control_worker.hpp.
Referenced by generate_speed(), and set_current_speed().
double platooning_control::PlatooningControlWorker::desired_gap_ = ctrl_config_->stand_still_headway_m |
Definition at line 107 of file platooning_control_worker.hpp.
Referenced by generate_speed(), and platooning_control::PlatooningControlPlugin::platoon_info_cb().
|
private |
Definition at line 117 of file platooning_control_worker.hpp.
bool platooning_control::PlatooningControlWorker::last_cmd_set_ = false |
Definition at line 109 of file platooning_control_worker.hpp.
Referenced by generate_speed().
double platooning_control::PlatooningControlWorker::lastCmdSpeed = 0.0 |
Definition at line 103 of file platooning_control_worker.hpp.
Referenced by generate_speed().
|
private |
Definition at line 115 of file platooning_control_worker.hpp.
Referenced by PlatooningControlWorker(), and generate_speed().
PlatoonLeaderInfo platooning_control::PlatooningControlWorker::platoon_leader |
Definition at line 96 of file platooning_control_worker.hpp.
Referenced by generate_speed(), and set_leader().
double platooning_control::PlatooningControlWorker::speedCmd = 0 |
Definition at line 101 of file platooning_control_worker.hpp.
double platooning_control::PlatooningControlWorker::speedCmd_ = 0 |
Definition at line 104 of file platooning_control_worker.hpp.
Referenced by platooning_control::PlatooningControlPlugin::generate_control_signals(), generate_speed(), get_last_speed_command(), and platooning_control::PlatooningControlPlugin::platoon_info_cb().
double platooning_control::PlatooningControlWorker::steerCmd_ = 0 |
Definition at line 105 of file platooning_control_worker.hpp.