Carma-platform v4.11.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.
cooperative_lanechange::CooperativeLaneChangePlugin Class Reference

The class responsible for generating cooperative lanechange trajectories from received lane change maneuvers. More...

#include <cooperative_lanechange_node.hpp>

Inheritance diagram for cooperative_lanechange::CooperativeLaneChangePlugin:
Inheritance graph
Collaboration diagram for cooperative_lanechange::CooperativeLaneChangePlugin:
Collaboration graph

Public Member Functions

 CooperativeLaneChangePlugin (const rclcpp::NodeOptions &)
 CooperativeLaneChangePlugin constructor. More...
 
rcl_interfaces::msg::SetParametersResult parameter_update_callback (const std::vector< rclcpp::Parameter > &parameters)
 Callback for dynamic parameter updates. More...
 
std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > plan_lanechange (carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr req)
 Creates a vector of Trajectory Points from maneuver information in trajectory request. More...
 
double find_current_gap (long veh2_lanelet_id, double veh2_downtrack, carma_planning_msgs::msg::VehicleState &ego_state) const
 Calculates distance between subject vehicle and vehicle 2. More...
 
void mobilityresponse_cb (const carma_v2x_msgs::msg::MobilityResponse::UniquePtr msg)
 Callback to subscribed mobility response topic. More...
 
carma_v2x_msgs::msg::MobilityRequest create_mobility_request (std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > &trajectory_plan, carma_planning_msgs::msg::Maneuver &maneuver)
 Creates a mobility request message from planned trajectory and requested maneuver info. More...
 
carma_v2x_msgs::msg::Trajectory trajectory_plan_to_trajectory (const std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > &traj_points) const
 Converts Trajectory Plan to (Mobility) Trajectory. More...
 
carma_v2x_msgs::msg::LocationECEF trajectory_point_to_ecef (const carma_planning_msgs::msg::TrajectoryPlanPoint &traj_point) const
 Converts Trajectory Point to ECEF frame using map projection. More...
 
void add_trajectory_to_response (carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr req, carma_planning_msgs::srv::PlanTrajectory::Response::SharedPtr resp, const std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > &planned_trajectory_points)
 Adds the generated trajectory plan to the service response. More...
 
void georeference_cb (const std_msgs::msg::String::UniquePtr msg)
 Callback for map projection string to define lat/lon -> map conversion. More...
 
void plan_trajectory_callback (std::shared_ptr< rmw_request_id_t >, carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr req, carma_planning_msgs::srv::PlanTrajectory::Response::SharedPtr resp) override
 Extending class provided callback which should return a planned trajectory based on the provided trajectory planning request. More...
 
bool get_availability () override
 Get the availability status of this plugin based on the current operating environment. Method must be overriden by extending classes. More...
 
std::string get_version_id () override
 Returns the version id of this plugin. More...
 
carma_ros2_utils::CallbackReturn on_configure_plugin ()
 This method should be used to load parameters and will be called on the configure state transition. More...
 
 FRIEND_TEST (CooperativeLaneChangePlugin, TestLaneChangefunctions)
 
 FRIEND_TEST (CooperativeLaneChangePlugin, Testcurrentgapcb)
 
 FRIEND_TEST (CooperativeLaneChangePlugin, TestNoPath_roadwayobject)
 
- Public Member Functions inherited from carma_guidance_plugins::TacticalPlugin
 TacticalPlugin (const rclcpp::NodeOptions &)
 TacticalPlugin constructor. More...
 
virtual ~TacticalPlugin ()=default
 Virtual destructor for safe deletion. More...
 
virtual void plan_trajectory_callback (std::shared_ptr< rmw_request_id_t > srv_header, carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr req, carma_planning_msgs::srv::PlanTrajectory::Response::SharedPtr resp)=0
 Extending class provided callback which should return a planned trajectory based on the provided trajectory planning request. More...
 
std::string get_capability () override
 Get the capability string representing this plugins capabilities Method must be overriden by extending classes. Expectation is that abstract plugin type parent classes will provide a default implementation. More...
 
uint8_t get_type () override final
 Returns the type of this plugin according to the carma_planning_msgs::Plugin type enum. Extending classes for the specific type should override this method. More...
 
carma_ros2_utils::CallbackReturn handle_on_configure (const rclcpp_lifecycle::State &) override final
 
carma_ros2_utils::CallbackReturn handle_on_activate (const rclcpp_lifecycle::State &) override final
 
carma_ros2_utils::CallbackReturn handle_on_deactivate (const rclcpp_lifecycle::State &) override final
 
carma_ros2_utils::CallbackReturn handle_on_cleanup (const rclcpp_lifecycle::State &) override final
 
carma_ros2_utils::CallbackReturn handle_on_shutdown (const rclcpp_lifecycle::State &) override final
 
carma_ros2_utils::CallbackReturn handle_on_error (const rclcpp_lifecycle::State &, const std::string &exception_string) override final
 
- Public Member Functions inherited from carma_guidance_plugins::PluginBaseNode
 PluginBaseNode (const rclcpp::NodeOptions &)
 PluginBaseNode constructor. More...
 
virtual ~PluginBaseNode ()=default
 Virtual destructor for safe deletion. More...
 
virtual std::shared_ptr< carma_wm::WMListenerget_world_model_listener () final
 Method to return the default world model listener provided as a convience by this base class If this method or get_world_model() are not called then the world model remains uninitialized and will not create unnecessary subscriptions. More...
 
virtual carma_wm::WorldModelConstPtr get_world_model () final
 Method to return the default world model provided as a convience by this base class If this method or get_world_model_listener() are not called then the world model remains uninitialized and will not create unnecessary subscriptions. More...
 
virtual bool get_activation_status () final
 Returns the activation status of this plugin. The plugins API callbacks will only be triggered when this method returns true. More...
 
virtual uint8_t get_type ()
 Returns the type of this plugin according to the carma_planning_msgs::Plugin type enum. Extending classes for the specific type should override this method. More...
 
std::string get_plugin_name_and_ns () const
 Return the name of this plugin with namespace. NOTE: If only the name of the plugin is required, use get_plugin_name() More...
 
std::string get_plugin_name () const
 Return the name of this plugin. More...
 
virtual bool get_availability ()=0
 Get the availability status of this plugin based on the current operating environment. Method must be overriden by extending classes. More...
 
virtual std::string get_capability ()=0
 Get the capability string representing this plugins capabilities Method must be overriden by extending classes. Expectation is that abstract plugin type parent classes will provide a default implementation. More...
 
virtual std::string get_version_id ()=0
 Returns the version id of this plugin. More...
 
virtual carma_ros2_utils::CallbackReturn on_configure_plugin ()=0
 Method which is triggered when this plugin is moved from the UNCONFIGURED to INACTIVE states. This method should be used to load parameters and is required to be implemented. More...
 
virtual carma_ros2_utils::CallbackReturn on_activate_plugin ()
 Method which is triggered when this plugin is moved from the INACTIVE to ACTIVE states. This method should be used to prepare for future callbacks for plugin's capabilites. More...
 
virtual carma_ros2_utils::CallbackReturn on_deactivate_plugin ()
 Method which is triggered when this plugin is moved from the ACTIVE to INACTIVE states. This method should be used to disable any functionality which should cease execution when plugin is inactive. More...
 
virtual carma_ros2_utils::CallbackReturn on_cleanup_plugin ()
 Method which is triggered when this plugin is moved from the INACTIVE to UNCONFIGURED states. This method should be used to fully reset the plugin such that a future call to on_configure_plugin would leave the plugin in a fresh state as though just launched. More...
 
virtual carma_ros2_utils::CallbackReturn on_shutdown_plugin ()
 Method which is triggered when this plugin is moved from any state to FINALIZED This method should be used to generate any shutdown logs or final cleanup. More...
 
virtual carma_ros2_utils::CallbackReturn on_error_plugin (const std::string &exception_string)
 Method which is triggered when an unhandled exception occurs in this plugin This method should be used to cleanup such that the plugin could be moved to UNCONFIGURED state if possible. More...
 
carma_ros2_utils::CallbackReturn handle_on_configure (const rclcpp_lifecycle::State &) override
 
carma_ros2_utils::CallbackReturn handle_on_activate (const rclcpp_lifecycle::State &) override
 
carma_ros2_utils::CallbackReturn handle_on_deactivate (const rclcpp_lifecycle::State &) override
 
carma_ros2_utils::CallbackReturn handle_on_cleanup (const rclcpp_lifecycle::State &) override
 
carma_ros2_utils::CallbackReturn handle_on_shutdown (const rclcpp_lifecycle::State &) override
 
carma_ros2_utils::CallbackReturn handle_on_error (const rclcpp_lifecycle::State &, const std::string &exception_string) override
 
 FRIEND_TEST (carma_guidance_plugins_test, connections_test)
 

Public Attributes

double current_speed_
 
geometry_msgs::msg::PoseStamped pose_msg_
 
bool is_lanechange_accepted_ = false
 
carma_planning_msgs::msg::VehicleState ending_state_before_buffer_
 

Private Member Functions

void pose_cb (const geometry_msgs::msg::PoseStamped::UniquePtr msg)
 Callback for the pose subscriber, which will store latest pose locally. More...
 
void twist_cb (const geometry_msgs::msg::TwistStamped::UniquePtr msg)
 Callback for the twist subscriber, which will store latest twist locally. More...
 
void bsm_cb (const carma_v2x_msgs::msg::BSM::UniquePtr msg)
 Callback for the BSM subscriber, which will store the latest BSM Core Data broadcasted by the host vehicle. More...
 
std::string bsmIDtoString (carma_v2x_msgs::msg::BSMCoreData bsm_core)
 Method for extracting the BSM ID from a BSM Core Data object and converting it to a string. More...
 

Private Attributes

carma_ros2_utils::SubPtr< geometry_msgs::msg::PoseStamped > pose_sub_
 
carma_ros2_utils::SubPtr< geometry_msgs::msg::TwistStamped > twist_sub_
 
carma_ros2_utils::SubPtr< carma_v2x_msgs::msg::MobilityResponse > incoming_mobility_response_sub_
 
carma_ros2_utils::SubPtr< std_msgs::msg::String > georeference_sub_
 
carma_ros2_utils::SubPtr< carma_v2x_msgs::msg::BSM > bsm_sub_
 
carma_ros2_utils::PubPtr< carma_v2x_msgs::msg::MobilityRequest > outgoing_mobility_request_pub_
 
carma_ros2_utils::PubPtr< carma_planning_msgs::msg::LaneChangeStatus > lanechange_status_pub_
 
Config config_
 
carma_wm::WorldModelConstPtr wm_
 
std::string map_georeference_ {""}
 
std::shared_ptr< lanelet::projection::LocalFrameProjector > map_projector_
 
double traj_freq_ = 10
 
std::string DEFAULT_STRING_ = ""
 
rclcpp::Time request_sent_time_
 
bool request_sent_ = false
 
double maneuver_fraction_completed_ = 0
 
bool clc_called_ = false
 
std::string clc_request_id_ = "default_request_id"
 
carma_v2x_msgs::msg::BSMCoreData bsm_core_
 
std::unordered_map< std::string, LaneChangeManeuverOriginalValuesoriginal_lc_maneuver_values_
 

Detailed Description

The class responsible for generating cooperative lanechange trajectories from received lane change maneuvers.

Definition at line 67 of file cooperative_lanechange_node.hpp.

Constructor & Destructor Documentation

◆ CooperativeLaneChangePlugin()

cooperative_lanechange::CooperativeLaneChangePlugin::CooperativeLaneChangePlugin ( const rclcpp::NodeOptions &  options)
explicit

CooperativeLaneChangePlugin constructor.

Definition at line 23 of file cooperative_lanechange_node.cpp.

25 {
26 basic_autonomy::set_logger(get_logger().get_child("basic_autonomy"));
27 // Create initial config
28 config_ = Config();
29
30 // Declare parameters
31 config_.trajectory_time_length = declare_parameter<double>("trajectory_time_length", config_.trajectory_time_length);
32 config_.control_plugin_name = declare_parameter<std::string>("control_plugin_name", config_.control_plugin_name);
33 config_.minimum_speed = declare_parameter<double>("minimum_speed", config_.minimum_speed);
34 config_.max_accel = declare_parameter<double>("max_accel", config_.max_accel);
35 config_.minimum_lookahead_distance = declare_parameter<double>("minimum_lookahead_distance", config_.minimum_lookahead_distance);
36 config_.maximum_lookahead_distance = declare_parameter<double>("maximum_lookahead_distance", config_.maximum_lookahead_distance);
37 config_.minimum_lookahead_speed = declare_parameter<double>("minimum_lookahead_speed", config_.minimum_lookahead_speed);
38 config_.maximum_lookahead_speed = declare_parameter<double>("maximum_lookahead_speed", config_.maximum_lookahead_speed);
39 config_.lateral_accel_limit = declare_parameter<double>("lateral_accel_limit", config_.lateral_accel_limit);
40 config_.speed_moving_average_window_size = declare_parameter<int>("speed_moving_average_window_size", config_.speed_moving_average_window_size);
41 config_.curvature_moving_average_window_size = declare_parameter<int>("curvature_moving_average_window_size", config_.curvature_moving_average_window_size);
42 config_.curvature_calc_lookahead_count = declare_parameter<int>("curvature_calc_lookahead_count", config_.curvature_calc_lookahead_count);
43 config_.downsample_ratio = declare_parameter<int>("downsample_ratio", config_.downsample_ratio);
44 config_.destination_range = declare_parameter<double>("destination_range", config_.destination_range);
45 config_.lanechange_time_out = declare_parameter<double>("lanechange_time_out", config_.lanechange_time_out);
46 config_.min_timestep = declare_parameter<double>("min_timestep", config_.min_timestep);
47 config_.starting_downtrack_range = declare_parameter<double>("starting_downtrack_range", config_.starting_downtrack_range);
48 config_.starting_fraction = declare_parameter<double>("starting_fraction", config_.starting_fraction);
49 config_.mid_fraction = declare_parameter<double>("mid_fraction", config_.mid_fraction);
50 config_.min_desired_gap = declare_parameter<double>("min_desired_gap", config_.min_desired_gap);
51 config_.desired_time_gap = declare_parameter<double>("desired_time_gap", config_.desired_time_gap);
52 config_.turn_downsample_ratio = declare_parameter<int>("turn_downsample_ratio", config_.turn_downsample_ratio);
53 config_.curve_resample_step_size = declare_parameter<double>("curve_resample_step_size", config_.curve_resample_step_size);
54 config_.back_distance = declare_parameter<double>("back_distance", config_.back_distance);
55 config_.buffer_ending_downtrack = declare_parameter<double>("buffer_ending_downtrack", config_.buffer_ending_downtrack);
56 config_.vehicle_id = declare_parameter<std::string>("vehicle_id", config_.vehicle_id);
57 }
TacticalPlugin base class which can be extended by user provided plugins which wish to implement the ...
void set_logger(rclcpp::Logger logger)
Replace the module-level logger used by all basic_autonomy functions.
Definition: log.cpp:33
rclcpp::Logger get_logger()
Return the module-level logger used by all basic_autonomy functions.
Definition: log.cpp:32

References cooperative_lanechange::Config::back_distance, cooperative_lanechange::Config::buffer_ending_downtrack, config_, cooperative_lanechange::Config::control_plugin_name, cooperative_lanechange::Config::curvature_calc_lookahead_count, cooperative_lanechange::Config::curvature_moving_average_window_size, cooperative_lanechange::Config::curve_resample_step_size, cooperative_lanechange::Config::desired_time_gap, cooperative_lanechange::Config::destination_range, cooperative_lanechange::Config::downsample_ratio, basic_autonomy::get_logger(), cooperative_lanechange::Config::lanechange_time_out, cooperative_lanechange::Config::lateral_accel_limit, cooperative_lanechange::Config::max_accel, cooperative_lanechange::Config::maximum_lookahead_distance, cooperative_lanechange::Config::maximum_lookahead_speed, cooperative_lanechange::Config::mid_fraction, cooperative_lanechange::Config::min_desired_gap, cooperative_lanechange::Config::min_timestep, cooperative_lanechange::Config::minimum_lookahead_distance, cooperative_lanechange::Config::minimum_lookahead_speed, cooperative_lanechange::Config::minimum_speed, basic_autonomy::set_logger(), cooperative_lanechange::Config::speed_moving_average_window_size, cooperative_lanechange::Config::starting_downtrack_range, cooperative_lanechange::Config::starting_fraction, cooperative_lanechange::Config::trajectory_time_length, cooperative_lanechange::Config::turn_downsample_ratio, and cooperative_lanechange::Config::vehicle_id.

Here is the call graph for this function:

Member Function Documentation

◆ add_trajectory_to_response()

void cooperative_lanechange::CooperativeLaneChangePlugin::add_trajectory_to_response ( carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr  req,
carma_planning_msgs::srv::PlanTrajectory::Response::SharedPtr  resp,
const std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > &  planned_trajectory_points 
)

Adds the generated trajectory plan to the service response.

Parameters
reqThe plan trajectory service request
respThe plan trajectory service response
planned_trajectory_pointsThe generated trajectory plan points, which are added to the service response

Definition at line 448 of file cooperative_lanechange_node.cpp.

451 {
452 carma_planning_msgs::msg::TrajectoryPlan trajectory_plan;
453 trajectory_plan.header.frame_id = "map";
454 trajectory_plan.header.stamp = this->now();
455 trajectory_plan.trajectory_id = boost::uuids::to_string(boost::uuids::random_generator()());
456
457 trajectory_plan.trajectory_points = planned_trajectory_points;
458 trajectory_plan.initial_longitudinal_velocity = std::max(req->vehicle_state.longitudinal_vel, config_.minimum_speed);
459 resp->trajectory_plan = trajectory_plan;
460
461 resp->related_maneuvers.push_back(req->maneuver_index_to_plan);
462
463 resp->maneuver_status.push_back(carma_planning_msgs::srv::PlanTrajectory::Response::MANEUVER_IN_PROGRESS);
464 }
auto to_string(const UtmZone &zone) -> std::string
Definition: utm_zone.cpp:21

References config_, cooperative_lanechange::Config::minimum_speed, and carma_cooperative_perception::to_string().

Referenced by plan_trajectory_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bsm_cb()

void cooperative_lanechange::CooperativeLaneChangePlugin::bsm_cb ( const carma_v2x_msgs::msg::BSM::UniquePtr  msg)
private

Callback for the BSM subscriber, which will store the latest BSM Core Data broadcasted by the host vehicle.

Parameters
msgLatest BSM message

Definition at line 259 of file cooperative_lanechange_node.cpp.

260 {
261 bsm_core_ = msg->core_data;
262 }

References bsm_core_.

Referenced by on_configure_plugin().

Here is the caller graph for this function:

◆ bsmIDtoString()

std::string cooperative_lanechange::CooperativeLaneChangePlugin::bsmIDtoString ( carma_v2x_msgs::msg::BSMCoreData  bsm_core)
private

Method for extracting the BSM ID from a BSM Core Data object and converting it to a string.

Parameters
bsm_coreThe BSM Core Data object from which the BSM ID is converted to a string
Returns
The BSM ID (as a string) from the BSM Core Data object

Definition at line 666 of file cooperative_lanechange_node.cpp.

667 {
668 std::string res = "";
669 for (size_t i = 0; i < bsm_core.id.size(); i++){
670 res += std::to_string(bsm_core.id[i]);
671 }
672 return res;
673 }

References process_bag::i, and carma_cooperative_perception::to_string().

Referenced by create_mobility_request().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_mobility_request()

carma_v2x_msgs::msg::MobilityRequest cooperative_lanechange::CooperativeLaneChangePlugin::create_mobility_request ( std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > &  trajectory_plan,
carma_planning_msgs::msg::Maneuver &  maneuver 
)

Creates a mobility request message from planned trajectory and requested maneuver info.

Parameters
trajectory_planA vector of lane change trajectory points
Themobility request message created from trajectory points, for publishing

Definition at line 466 of file cooperative_lanechange_node.cpp.

467 {
468 carma_v2x_msgs::msg::MobilityRequest request_msg;
469 carma_v2x_msgs::msg::MobilityHeader header;
470 header.sender_id = config_.vehicle_id;
471 header.recipient_id = DEFAULT_STRING_;
472 header.sender_bsm_id = bsmIDtoString(bsm_core_);
473 header.plan_id = boost::uuids::to_string(boost::uuids::random_generator()());
474 clc_request_id_ = header.plan_id;
475 header.timestamp = rclcpp::Time(trajectory_plan.front().target_time).nanoseconds() * 1000000;
476 request_msg.m_header = header;
477
478 request_msg.strategy = "carma/cooperative-lane-change";
479 request_msg.plan_type.type = carma_v2x_msgs::msg::PlanType::CHANGE_LANE_LEFT;
480
481 //Urgency- Currently unassigned
482 int urgency;
484 urgency = 10;
485 }
487 urgency = 5;
488 }
489 else{
490 urgency = 1;
491 }
492 RCLCPP_DEBUG_STREAM(get_logger(), "Maneuver fraction completed:"<<maneuver_fraction_completed_);
493 request_msg.urgency = urgency;
494
495 //Strategy params
496 //Encode JSON with Boost Property Tree
497 using boost::property_tree::ptree;
498 ptree pt;
499 double end_speed_floor = std::floor(maneuver.lane_change_maneuver.end_speed);
500 int end_speed_fractional = (maneuver.lane_change_maneuver.end_speed - end_speed_floor) * 10;
501
502 RCLCPP_DEBUG_STREAM(get_logger(), "end_speed_floor: " << end_speed_floor);
503 RCLCPP_DEBUG_STREAM(get_logger(), "end_speed_fractional: " << end_speed_fractional);
504 RCLCPP_DEBUG_STREAM(get_logger(), "start_lanelet_id: " << maneuver.lane_change_maneuver.starting_lane_id);
505 RCLCPP_DEBUG_STREAM(get_logger(), "end_lanelet_id: " << maneuver.lane_change_maneuver.ending_lane_id);
506
507 pt.put("s",(int)end_speed_floor);
508 pt.put("f",end_speed_fractional);
509 pt.put("sl",maneuver.lane_change_maneuver.starting_lane_id);
510 pt.put("el", maneuver.lane_change_maneuver.ending_lane_id);
511
512 std::stringstream body_stream;
513 boost::property_tree::json_parser::write_json(body_stream,pt);
514 request_msg.strategy_params = body_stream.str();
515 RCLCPP_DEBUG_STREAM(get_logger(), "request_msg.strategy_params: " << request_msg.strategy_params);
516
517 //Trajectory
518 carma_v2x_msgs::msg::Trajectory trajectory;
519 if (map_projector_) {
520 trajectory = trajectory_plan_to_trajectory(trajectory_plan);
521 //Location
522 carma_planning_msgs::msg::TrajectoryPlanPoint temp_loc_to_convert;
523 temp_loc_to_convert.x = pose_msg_.pose.position.x;
524 temp_loc_to_convert.y = pose_msg_.pose.position.y;
525 carma_v2x_msgs::msg::LocationECEF location = trajectory_point_to_ecef(temp_loc_to_convert);
526
527 //Using trajectory first point time as location timestamp
528 location.timestamp = rclcpp::Time(trajectory_plan.front().target_time).nanoseconds() * 1000000;
529
530 request_msg.location = location;
531 }
532 else
533 {
534 RCLCPP_ERROR_STREAM(get_logger(), "Map projection not available to be used with request message");
535 }
536
537 request_msg.trajectory = trajectory;
538 request_msg.expiration = rclcpp::Time(trajectory_plan.back().target_time).seconds();
539 RCLCPP_DEBUG_STREAM(get_logger(), "request_msg.expiration: " << request_msg.expiration << " of which string size: " << std::to_string(request_msg.expiration).size());
540
541 return request_msg;
542 }
carma_v2x_msgs::msg::LocationECEF trajectory_point_to_ecef(const carma_planning_msgs::msg::TrajectoryPlanPoint &traj_point) const
Converts Trajectory Point to ECEF frame using map projection.
std::string bsmIDtoString(carma_v2x_msgs::msg::BSMCoreData bsm_core)
Method for extracting the BSM ID from a BSM Core Data object and converting it to a string.
std::shared_ptr< lanelet::projection::LocalFrameProjector > map_projector_
carma_v2x_msgs::msg::Trajectory trajectory_plan_to_trajectory(const std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > &traj_points) const
Converts Trajectory Plan to (Mobility) Trajectory.

References bsm_core_, bsmIDtoString(), clc_request_id_, config_, DEFAULT_STRING_, basic_autonomy::get_logger(), maneuver_fraction_completed_, map_projector_, cooperative_lanechange::Config::mid_fraction, pose_msg_, cooperative_lanechange::Config::starting_fraction, carma_cooperative_perception::to_string(), trajectory_plan_to_trajectory(), trajectory_point_to_ecef(), and cooperative_lanechange::Config::vehicle_id.

Referenced by plan_trajectory_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_current_gap()

double cooperative_lanechange::CooperativeLaneChangePlugin::find_current_gap ( long  veh2_lanelet_id,
double  veh2_downtrack,
carma_planning_msgs::msg::VehicleState &  ego_state 
) const

Calculates distance between subject vehicle and vehicle 2.

Parameters
veh2_lanelet_idCurrent lanelet id of vehicle 2
veh2_downtrackDowntrack of vehicle 2 in its current lanelet
ego_statevehicle state of the ego vehicle
Returns
the distance between subject vehicle and vehicle 2

Definition at line 190 of file cooperative_lanechange_node.cpp.

191 {
192 //find downtrack distance between ego and lag vehicle
193 RCLCPP_DEBUG_STREAM(get_logger(), "entered find_current_gap");
194 double current_gap = 0.0;
195 lanelet::BasicPoint2d ego_pos(ego_state.x_pos_global, ego_state.y_pos_global);
196 //double ego_current_downtrack = wm_->routeTrackPos(ego_pos).downtrack;
197
198 lanelet::LaneletMapConstPtr const_map(wm_->getMap());
199 lanelet::ConstLanelet veh2_lanelet = const_map->laneletLayer.get(veh2_lanelet_id);
200 RCLCPP_DEBUG_STREAM(get_logger(), "veh2_lanelet id " << veh2_lanelet.id());
201
202 auto current_lanelets = lanelet::geometry::findNearest(const_map->laneletLayer, ego_pos, 10);
203 if(current_lanelets.size() == 0)
204 {
205 RCLCPP_WARN_STREAM(get_logger(), "Cannot find any lanelet in map!");
206 return true;
207 }
208 lanelet::ConstLanelet current_lanelet = current_lanelets[0].second;
209 RCLCPP_DEBUG_STREAM(get_logger(), "current llt id " << current_lanelet.id());
210
211 //Create temporary route between the two vehicles
212 lanelet::ConstLanelet start_lanelet = veh2_lanelet;
213 lanelet::ConstLanelet end_lanelet = current_lanelet;
214
215 auto map_graph = wm_->getMapRoutingGraph();
216 RCLCPP_DEBUG_STREAM(get_logger(), "Graph created");
217
218 auto temp_route = map_graph->getRoute(start_lanelet, end_lanelet);
219 RCLCPP_DEBUG_STREAM(get_logger(), "Route created");
220
221 //Throw exception if there is no shortest path from veh2 to subject vehicle
222 lanelet::routing::LaneletPath shortest_path2;
223 if(temp_route)
224 {
225 shortest_path2 = temp_route.get().shortestPath();
226 }
227 else{
228 RCLCPP_ERROR_STREAM(get_logger(), "No path exists from roadway object to subject");
229 throw std::invalid_argument("No path exists from roadway object to subject");
230 }
231
232 RCLCPP_DEBUG_STREAM(get_logger(), "Shorted path created size: " << shortest_path2.size());
233 for (auto llt : shortest_path2)
234 {
235 RCLCPP_DEBUG_STREAM(get_logger(), "llt id route: " << llt.id());
236 }
237
238 //To find downtrack- creating temporary route from veh2 to veh1(ego vehicle)
239 double veh1_current_downtrack = wm_->routeTrackPos(ego_pos).downtrack;
240 RCLCPP_DEBUG_STREAM(get_logger(), "ego_current_downtrack:" << veh1_current_downtrack);
241
242 current_gap = veh1_current_downtrack - veh2_downtrack;
243 RCLCPP_DEBUG_STREAM(get_logger(), "Finding current gap");
244 RCLCPP_DEBUG_STREAM(get_logger(), "Veh1 current downtrack: " << veh1_current_downtrack << " veh2 downtrack: " << veh2_downtrack);
245
246 return current_gap;
247 }

References basic_autonomy::get_logger(), and wm_.

Referenced by plan_trajectory_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FRIEND_TEST() [1/3]

cooperative_lanechange::CooperativeLaneChangePlugin::FRIEND_TEST ( CooperativeLaneChangePlugin  ,
Testcurrentgapcb   
)

◆ FRIEND_TEST() [2/3]

cooperative_lanechange::CooperativeLaneChangePlugin::FRIEND_TEST ( CooperativeLaneChangePlugin  ,
TestLaneChangefunctions   
)

◆ FRIEND_TEST() [3/3]

cooperative_lanechange::CooperativeLaneChangePlugin::FRIEND_TEST ( CooperativeLaneChangePlugin  ,
TestNoPath_roadwayobject   
)

◆ georeference_cb()

void cooperative_lanechange::CooperativeLaneChangePlugin::georeference_cb ( const std_msgs::msg::String::UniquePtr  msg)

Callback for map projection string to define lat/lon -> map conversion.

msg The proj string defining the projection.

Definition at line 657 of file cooperative_lanechange_node.cpp.

658 {
659 if (map_georeference_ != msg->data)
660 {
661 map_georeference_ = msg->data;
662 map_projector_ = std::make_shared<lanelet::projection::LocalFrameProjector>(msg->data.c_str()); // Build projector from proj string
663 }
664 }

References map_georeference_, and map_projector_.

Referenced by on_configure_plugin().

Here is the caller graph for this function:

◆ get_availability()

bool cooperative_lanechange::CooperativeLaneChangePlugin::get_availability ( )
overridevirtual

Get the availability status of this plugin based on the current operating environment. Method must be overriden by extending classes.

Returns
This method should return true if the plugin's current understanding of the world means it would be capable of planning or executing its capability.

Implements carma_guidance_plugins::PluginBaseNode.

Definition at line 675 of file cooperative_lanechange_node.cpp.

675 {
676 return true;
677 }

◆ get_version_id()

std::string cooperative_lanechange::CooperativeLaneChangePlugin::get_version_id ( )
overridevirtual

Returns the version id of this plugin.

Returns
The version id represented as a string

Implements carma_guidance_plugins::PluginBaseNode.

Definition at line 679 of file cooperative_lanechange_node.cpp.

679 {
680 return "v4.0"; // Version ID matches the value set in this package's package.xml
681 }

◆ mobilityresponse_cb()

void cooperative_lanechange::CooperativeLaneChangePlugin::mobilityresponse_cb ( const carma_v2x_msgs::msg::MobilityResponse::UniquePtr  msg)

Callback to subscribed mobility response topic.

Parameters
msgLatest mobility response message

Definition at line 163 of file cooperative_lanechange_node.cpp.

163 {
164 //@SONAR_STOP@
165 if (clc_called_ && clc_request_id_ == msg->m_header.plan_id)
166 {
167 carma_planning_msgs::msg::LaneChangeStatus lc_status_msg;
168 if(msg->is_accepted)
169 {
171 lc_status_msg.status = carma_planning_msgs::msg::LaneChangeStatus::ACCEPTANCE_RECEIVED;
172 lc_status_msg.description = "Received lane merge acceptance";
173 }
174 else
175 {
177 lc_status_msg.status = carma_planning_msgs::msg::LaneChangeStatus::REJECTION_RECEIVED;
178 lc_status_msg.description = "Received lane merge rejection";
179 }
180 lanechange_status_pub_->publish(lc_status_msg);
181 //@SONAR_START@
182 }
183 else
184 {
185 RCLCPP_DEBUG_STREAM(get_logger(), "received mobility response is not related to CLC");
186 }
187
188 }
carma_ros2_utils::PubPtr< carma_planning_msgs::msg::LaneChangeStatus > lanechange_status_pub_

References clc_called_, clc_request_id_, basic_autonomy::get_logger(), is_lanechange_accepted_, and lanechange_status_pub_.

Referenced by on_configure_plugin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_configure_plugin()

carma_ros2_utils::CallbackReturn cooperative_lanechange::CooperativeLaneChangePlugin::on_configure_plugin ( )
virtual

This method should be used to load parameters and will be called on the configure state transition.

Implements carma_guidance_plugins::PluginBaseNode.

Definition at line 100 of file cooperative_lanechange_node.cpp.

101 {
102 RCLCPP_INFO_STREAM(get_logger(), "CooperativeLaneChangePlugin trying to configure");
103
104 // Reset config
105 config_ = Config();
106
107 // Load parameters
108 get_parameter<double>("trajectory_time_length", config_.trajectory_time_length);
109 get_parameter<std::string>("control_plugin_name", config_.control_plugin_name);
110 get_parameter<double>("minimum_speed", config_.minimum_speed);
111 get_parameter<double>("max_accel", config_.max_accel);
112 get_parameter<double>("minimum_lookahead_distance", config_.minimum_lookahead_distance);
113 get_parameter<double>("maximum_lookahead_distance", config_.maximum_lookahead_distance);
114 get_parameter<double>("minimum_lookahead_speed", config_.minimum_lookahead_speed);
115 get_parameter<double>("maximum_lookahead_speed", config_.maximum_lookahead_speed);
116 get_parameter<double>("lateral_accel_limit", config_.lateral_accel_limit);
117 get_parameter<int>("speed_moving_average_window_size", config_.speed_moving_average_window_size);
118 get_parameter<int>("curvature_moving_average_window_size", config_.curvature_moving_average_window_size);
119 get_parameter<int>("curvature_calc_lookahead_count", config_.curvature_calc_lookahead_count);
120 get_parameter<int>("downsample_ratio", config_.downsample_ratio);
121 get_parameter<double>("destination_range", config_.destination_range);
122 get_parameter<double>("lanechange_time_out", config_.lanechange_time_out);
123 get_parameter<double>("min_timestep", config_.min_timestep);
124 get_parameter<double>("starting_downtrack_range", config_.starting_downtrack_range);
125 get_parameter<double>("starting_fraction", config_.starting_fraction);
126 get_parameter<double>("mid_fraction", config_.mid_fraction);
127 get_parameter<double>("min_desired_gap", config_.min_desired_gap);
128 get_parameter<double>("desired_time_gap", config_.desired_time_gap);
129 get_parameter<int>("turn_downsample_ratio", config_.turn_downsample_ratio);
130 get_parameter<double>("curve_resample_step_size", config_.curve_resample_step_size);
131 get_parameter<double>("back_distance", config_.back_distance);
132 get_parameter<double>("buffer_ending_downtrack", config_.buffer_ending_downtrack);
133 get_parameter<std::string>("vehicle_id", config_.vehicle_id);
134
135 // Register runtime parameter update callback
136 add_on_set_parameters_callback(std::bind(&CooperativeLaneChangePlugin::parameter_update_callback, this, std_ph::_1));
137
138 RCLCPP_INFO_STREAM(get_logger(), "Loaded params: " << config_);
139
140 // Setup subscribers
141 pose_sub_ = create_subscription<geometry_msgs::msg::PoseStamped>("current_pose", 1,
142 std::bind(&CooperativeLaneChangePlugin::pose_cb, this, std_ph::_1));
143 twist_sub_ = create_subscription<geometry_msgs::msg::TwistStamped>("current_velocity", 1,
144 std::bind(&CooperativeLaneChangePlugin::twist_cb, this, std_ph::_1));
145 incoming_mobility_response_sub_ = create_subscription<carma_v2x_msgs::msg::MobilityResponse>("incoming_mobility_response", 1,
146 std::bind(&CooperativeLaneChangePlugin::mobilityresponse_cb, this, std_ph::_1));
147 georeference_sub_ = create_subscription<std_msgs::msg::String>("georeference", 1,
148 std::bind(&CooperativeLaneChangePlugin::georeference_cb, this, std_ph::_1));
149 bsm_sub_ = create_subscription<carma_v2x_msgs::msg::BSM>("bsm_outbound", 1,
150 std::bind(&CooperativeLaneChangePlugin::bsm_cb, this, std_ph::_1));
151
152 // Setup publishers
153 outgoing_mobility_request_pub_ = create_publisher<carma_v2x_msgs::msg::MobilityRequest>("outgoing_mobility_request", 5); // Rate from yield plugin
154 lanechange_status_pub_ = create_publisher<carma_planning_msgs::msg::LaneChangeStatus>("cooperative_lane_change_status", 10);
155
156 // Initialize World Model
158
159 // Return success if everything initialized successfully
160 return CallbackReturn::SUCCESS;
161 }
virtual carma_wm::WorldModelConstPtr get_world_model() final
Method to return the default world model provided as a convience by this base class If this method or...
void bsm_cb(const carma_v2x_msgs::msg::BSM::UniquePtr msg)
Callback for the BSM subscriber, which will store the latest BSM Core Data broadcasted by the host ve...
carma_ros2_utils::SubPtr< geometry_msgs::msg::TwistStamped > twist_sub_
void mobilityresponse_cb(const carma_v2x_msgs::msg::MobilityResponse::UniquePtr msg)
Callback to subscribed mobility response topic.
carma_ros2_utils::SubPtr< carma_v2x_msgs::msg::BSM > bsm_sub_
void pose_cb(const geometry_msgs::msg::PoseStamped::UniquePtr msg)
Callback for the pose subscriber, which will store latest pose locally.
carma_ros2_utils::SubPtr< std_msgs::msg::String > georeference_sub_
void twist_cb(const geometry_msgs::msg::TwistStamped::UniquePtr msg)
Callback for the twist subscriber, which will store latest twist locally.
carma_ros2_utils::PubPtr< carma_v2x_msgs::msg::MobilityRequest > outgoing_mobility_request_pub_
void georeference_cb(const std_msgs::msg::String::UniquePtr msg)
Callback for map projection string to define lat/lon -> map conversion.
rcl_interfaces::msg::SetParametersResult parameter_update_callback(const std::vector< rclcpp::Parameter > &parameters)
Callback for dynamic parameter updates.
carma_ros2_utils::SubPtr< geometry_msgs::msg::PoseStamped > pose_sub_
carma_ros2_utils::SubPtr< carma_v2x_msgs::msg::MobilityResponse > incoming_mobility_response_sub_

References cooperative_lanechange::Config::back_distance, bsm_cb(), bsm_sub_, cooperative_lanechange::Config::buffer_ending_downtrack, config_, cooperative_lanechange::Config::control_plugin_name, cooperative_lanechange::Config::curvature_calc_lookahead_count, cooperative_lanechange::Config::curvature_moving_average_window_size, cooperative_lanechange::Config::curve_resample_step_size, cooperative_lanechange::Config::desired_time_gap, cooperative_lanechange::Config::destination_range, cooperative_lanechange::Config::downsample_ratio, georeference_cb(), georeference_sub_, basic_autonomy::get_logger(), carma_guidance_plugins::PluginBaseNode::get_world_model(), incoming_mobility_response_sub_, lanechange_status_pub_, cooperative_lanechange::Config::lanechange_time_out, cooperative_lanechange::Config::lateral_accel_limit, cooperative_lanechange::Config::max_accel, cooperative_lanechange::Config::maximum_lookahead_distance, cooperative_lanechange::Config::maximum_lookahead_speed, cooperative_lanechange::Config::mid_fraction, cooperative_lanechange::Config::min_desired_gap, cooperative_lanechange::Config::min_timestep, cooperative_lanechange::Config::minimum_lookahead_distance, cooperative_lanechange::Config::minimum_lookahead_speed, cooperative_lanechange::Config::minimum_speed, mobilityresponse_cb(), outgoing_mobility_request_pub_, parameter_update_callback(), pose_cb(), pose_sub_, cooperative_lanechange::Config::speed_moving_average_window_size, cooperative_lanechange::Config::starting_downtrack_range, cooperative_lanechange::Config::starting_fraction, cooperative_lanechange::Config::trajectory_time_length, cooperative_lanechange::Config::turn_downsample_ratio, twist_cb(), twist_sub_, cooperative_lanechange::Config::vehicle_id, and wm_.

Here is the call graph for this function:

◆ parameter_update_callback()

rcl_interfaces::msg::SetParametersResult cooperative_lanechange::CooperativeLaneChangePlugin::parameter_update_callback ( const std::vector< rclcpp::Parameter > &  parameters)

Callback for dynamic parameter updates.

Definition at line 59 of file cooperative_lanechange_node.cpp.

60 {
61 auto error = update_params<std::string>(
62 {{"control_plugin_name", config_.control_plugin_name},
63 {"vehicle_id", config_.vehicle_id}}, parameters);
64
65 auto error_2 = update_params<double>(
66 {{"trajectory_time_length", config_.trajectory_time_length},
67 {"minimum_speed", config_.minimum_speed},
68 {"max_accel", config_.max_accel},
69 {"minimum_lookahead_distance", config_.minimum_lookahead_distance},
70 {"maximum_lookahead_distance", config_.maximum_lookahead_distance},
71 {"minimum_lookahead_speed", config_.minimum_lookahead_speed},
72 {"maximum_lookahead_speed", config_.maximum_lookahead_speed},
73 {"lateral_accel_limit", config_.lateral_accel_limit},
74 {"destination_range", config_.destination_range},
75 {"lanechange_time_out", config_.lanechange_time_out},
76 {"min_timestep", config_.min_timestep},
77 {"starting_downtrack_range", config_.starting_downtrack_range},
78 {"starting_fraction", config_.starting_fraction},
79 {"mid_fraction", config_.mid_fraction},
80 {"min_desired_gap", config_.min_desired_gap},
81 {"curve_resample_step_size", config_.curve_resample_step_size},
82 {"back_distance", config_.back_distance},
83 {"buffer_ending_downtrack", config_.buffer_ending_downtrack},
84 {"desired_time_gap", config_.desired_time_gap}}, parameters);
85
86 auto error_3 = update_params<int>(
87 {{"speed_moving_average_window_size", config_.speed_moving_average_window_size},
88 {"curvature_moving_average_window_size", config_.curvature_moving_average_window_size},
89 {"curvature_calc_lookahead_count", config_.curvature_calc_lookahead_count},
90 {"downsample_ratio", config_.downsample_ratio},
91 {"turn_downsample_ratio", config_.turn_downsample_ratio}}, parameters);
92
93 rcl_interfaces::msg::SetParametersResult result;
94
95 result.successful = !error && !error_2 && !error_3;
96
97 return result;
98 }

References cooperative_lanechange::Config::back_distance, cooperative_lanechange::Config::buffer_ending_downtrack, config_, cooperative_lanechange::Config::control_plugin_name, cooperative_lanechange::Config::curvature_calc_lookahead_count, cooperative_lanechange::Config::curvature_moving_average_window_size, cooperative_lanechange::Config::curve_resample_step_size, cooperative_lanechange::Config::desired_time_gap, cooperative_lanechange::Config::destination_range, cooperative_lanechange::Config::downsample_ratio, cooperative_lanechange::Config::lanechange_time_out, cooperative_lanechange::Config::lateral_accel_limit, cooperative_lanechange::Config::max_accel, cooperative_lanechange::Config::maximum_lookahead_distance, cooperative_lanechange::Config::maximum_lookahead_speed, cooperative_lanechange::Config::mid_fraction, cooperative_lanechange::Config::min_desired_gap, cooperative_lanechange::Config::min_timestep, cooperative_lanechange::Config::minimum_lookahead_distance, cooperative_lanechange::Config::minimum_lookahead_speed, cooperative_lanechange::Config::minimum_speed, cooperative_lanechange::Config::speed_moving_average_window_size, cooperative_lanechange::Config::starting_downtrack_range, cooperative_lanechange::Config::starting_fraction, cooperative_lanechange::Config::trajectory_time_length, cooperative_lanechange::Config::turn_downsample_ratio, and cooperative_lanechange::Config::vehicle_id.

Referenced by on_configure_plugin().

Here is the caller graph for this function:

◆ plan_lanechange()

std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > cooperative_lanechange::CooperativeLaneChangePlugin::plan_lanechange ( carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr  req)

Creates a vector of Trajectory Points from maneuver information in trajectory request.

Parameters
reqThe service request
Returns
vector of unobstructed lane change trajectory points

Definition at line 587 of file cooperative_lanechange_node.cpp.

588 {
589 lanelet::BasicPoint2d veh_pos(req->vehicle_state.x_pos_global, req->vehicle_state.y_pos_global);
590 double current_downtrack = wm_->routeTrackPos(veh_pos).downtrack;
591
592 // Only plan the trajectory for the requested LANE_CHANGE maneuver
593 std::vector<carma_planning_msgs::msg::Maneuver> maneuver_plan;
594 if(req->maneuver_plan.maneuvers[req->maneuver_index_to_plan].type != carma_planning_msgs::msg::Maneuver::LANE_CHANGE) {
595 throw std::invalid_argument ("Cooperative Lane Change Plugin doesn't support this maneuver type");
596 }
597 maneuver_plan.push_back(req->maneuver_plan.maneuvers[req->maneuver_index_to_plan]);
598
599 if(current_downtrack >= maneuver_plan.front().lane_change_maneuver.end_dist){
600 request_sent_ = false;
601 }
602
605
607
614
615 RCLCPP_DEBUG_STREAM(get_logger(), "Current downtrack: " << current_downtrack);
616
617 std::string maneuver_id = maneuver_plan.front().lane_change_maneuver.parameters.maneuver_id;
618 double original_start_dist = current_downtrack; // Initialize so original_start_dist cannot be less than the current downtrack
619
620 if (original_lc_maneuver_values_.find(maneuver_id) != original_lc_maneuver_values_.end()) {
621 // Obtain the original start_dist associated with this lane change maneuver
622 original_start_dist = original_lc_maneuver_values_[maneuver_id].original_start_dist;
623 RCLCPP_DEBUG_STREAM(get_logger(), "Maneuver id " << maneuver_id << " original start_dist is " << original_start_dist);
624
625 // Set this maneuver's starting_lane_id to the original starting_lane_id associated with this lane change maneuver
626 maneuver_plan.front().lane_change_maneuver.starting_lane_id = original_lc_maneuver_values_[maneuver_id].original_starting_lane_id;
627 RCLCPP_DEBUG_STREAM(get_logger(), "Updated maneuver id " << maneuver_id << " starting_lane_id to its original value of " << original_lc_maneuver_values_[maneuver_id].original_starting_lane_id);
628
629 // If the vehicle has started this lane change, set the request's vehicle_state.longitudinal_vel to the velocity that the vehicle began this lane change at
630 if(original_lc_maneuver_values_[maneuver_id].has_started) {
631 req->vehicle_state.longitudinal_vel = original_lc_maneuver_values_[maneuver_id].original_longitudinal_vel_ms;
632 RCLCPP_DEBUG_STREAM(get_logger(), "Updating vehicle_state.longitudinal_vel to the initial lane change value of " << original_lc_maneuver_values_[maneuver_id].original_longitudinal_vel_ms);
633 }
634 }
635 else {
636 RCLCPP_WARN_STREAM(get_logger(), "No original values for lane change maneuver were found!");
637 }
638
639 double starting_downtrack = std::min(current_downtrack, original_start_dist);
640
641 auto points_and_target_speeds = basic_autonomy::waypoint_generation::create_geometry_profile(maneuver_plan, starting_downtrack, wm_, ending_state_before_buffer_, req->vehicle_state, wpg_general_config, wpg_detail_config);
642
643 // Calculate maneuver fraction completed (current_downtrack/(ending_downtrack-starting_downtrack)
644 auto maneuver_end_dist = maneuver_plan.back().lane_change_maneuver.end_dist;
645 auto maneuver_start_dist = maneuver_plan.front().lane_change_maneuver.start_dist;
646 maneuver_fraction_completed_ = (maneuver_start_dist - current_downtrack)/(maneuver_end_dist - maneuver_start_dist);
647
648 RCLCPP_DEBUG_STREAM(get_logger(), "Maneuvers to points size: " << points_and_target_speeds.size());
649 auto downsampled_points = carma_ros2_utils::containers::downsample_vector(points_and_target_speeds, config_.downsample_ratio);
650
651 std::vector<carma_planning_msgs::msg::TrajectoryPlanPoint> trajectory_points = basic_autonomy::waypoint_generation::compose_lanechange_trajectory_from_path(downsampled_points, req->vehicle_state, req->header.stamp,
652 wm_, ending_state_before_buffer_, wpg_detail_config);
653 RCLCPP_DEBUG_STREAM(get_logger(), "Compose Trajectory size: " << trajectory_points.size());
654 return trajectory_points;
655 }
carma_planning_msgs::msg::VehicleState ending_state_before_buffer_
std::unordered_map< std::string, LaneChangeManeuverOriginalValues > original_lc_maneuver_values_
GeneralTrajConfig compose_general_trajectory_config(const std::string &trajectory_type, int default_downsample_ratio, int turn_downsample_ratio)
std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > compose_lanechange_trajectory_from_path(const std::vector< PointSpeedPair > &points, const carma_planning_msgs::msg::VehicleState &state, const rclcpp::Time &state_time, const carma_wm::WorldModelConstPtr &wm, const carma_planning_msgs::msg::VehicleState &ending_state_before_buffer, const DetailedTrajConfig &detailed_config)
Method converts a list of lanelet centerline points and current vehicle state into a usable list of t...
DetailedTrajConfig compose_detailed_trajectory_config(double trajectory_time_length, double curve_resample_step_size, double minimum_speed, double max_accel, double lateral_accel_limit, int speed_moving_average_window_size, int curvature_moving_average_window_size, double back_distance, double buffer_ending_downtrack, std::string desired_controller_plugin="default")
std::vector< PointSpeedPair > create_geometry_profile(const std::vector< carma_planning_msgs::msg::Maneuver > &maneuvers, double max_starting_downtrack, const carma_wm::WorldModelConstPtr &wm, carma_planning_msgs::msg::VehicleState &ending_state_before_buffer, const carma_planning_msgs::msg::VehicleState &state, const GeneralTrajConfig &general_config, const DetailedTrajConfig &detailed_config)
Creates geometry profile to return a point speed pair struct for LANE FOLLOW and LANE CHANGE maneuver...

References cooperative_lanechange::Config::back_distance, cooperative_lanechange::Config::buffer_ending_downtrack, basic_autonomy::waypoint_generation::compose_detailed_trajectory_config(), basic_autonomy::waypoint_generation::compose_general_trajectory_config(), basic_autonomy::waypoint_generation::compose_lanechange_trajectory_from_path(), config_, basic_autonomy::waypoint_generation::create_geometry_profile(), cooperative_lanechange::Config::curvature_moving_average_window_size, cooperative_lanechange::Config::curve_resample_step_size, cooperative_lanechange::Config::downsample_ratio, ending_state_before_buffer_, basic_autonomy::get_logger(), cooperative_lanechange::Config::lateral_accel_limit, maneuver_fraction_completed_, cooperative_lanechange::Config::max_accel, cooperative_lanechange::Config::minimum_speed, original_lc_maneuver_values_, request_sent_, cooperative_lanechange::Config::speed_moving_average_window_size, cooperative_lanechange::Config::trajectory_time_length, cooperative_lanechange::Config::turn_downsample_ratio, and wm_.

Referenced by plan_trajectory_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ plan_trajectory_callback()

void cooperative_lanechange::CooperativeLaneChangePlugin::plan_trajectory_callback ( std::shared_ptr< rmw_request_id_t >  srv_header,
carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr  req,
carma_planning_msgs::srv::PlanTrajectory::Response::SharedPtr  resp 
)
overridevirtual

Extending class provided callback which should return a planned trajectory based on the provided trajectory planning request.

Parameters
srv_headerRCL header for services calls. Can usually be ignored by implementers.
reqThe service request containing the maneuvers to plan trajectories for and current vehicle state
respThe response containing the planned trajectory

Implements carma_guidance_plugins::TacticalPlugin.

Definition at line 264 of file cooperative_lanechange_node.cpp.

268 {
269 std::chrono::system_clock::time_point start_time = std::chrono::system_clock::now();
270
271 // Set boolean flag if this is the first time this service has been called
272 if (!clc_called_)
273 {
274 clc_called_ = true;
275 }
276
277 // Only plan the trajectory for the requested LANE_CHANGE maneuver
278 std::vector<carma_planning_msgs::msg::Maneuver> maneuver_plan;
279 if(req->maneuver_plan.maneuvers[req->maneuver_index_to_plan].type != carma_planning_msgs::msg::Maneuver::LANE_CHANGE)
280 {
281 throw std::invalid_argument ("Cooperative Lane Change Plugin doesn't support this maneuver type");
282 }
283 maneuver_plan.push_back(req->maneuver_plan.maneuvers[req->maneuver_index_to_plan]);
284
285 // Currently only checking for first lane change maneuver message
286 long target_lanelet_id = stol(maneuver_plan[0].lane_change_maneuver.ending_lane_id);
287 double target_downtrack = maneuver_plan[0].lane_change_maneuver.end_dist;
288
289 // Get subject vehicle info
290 lanelet::BasicPoint2d veh_pos(req->vehicle_state.x_pos_global, req->vehicle_state.y_pos_global);
291 double current_downtrack = wm_->routeTrackPos(veh_pos).downtrack;
292
293 RCLCPP_DEBUG_STREAM(get_logger(), "target_lanelet_id: " << target_lanelet_id);
294 RCLCPP_DEBUG_STREAM(get_logger(), "target_downtrack: " << target_downtrack);
295 RCLCPP_DEBUG_STREAM(get_logger(), "current_downtrack: " << current_downtrack);
296 RCLCPP_DEBUG_STREAM(get_logger(), "Starting CLC downtrack: " << maneuver_plan[0].lane_change_maneuver.start_dist);
297
298 if(current_downtrack < maneuver_plan[0].lane_change_maneuver.start_dist - config_.starting_downtrack_range){
299 RCLCPP_WARN_STREAM(get_logger(),
300 "Lane change trajectory will not be planned. current_downtrack is more than "
301 << config_.starting_downtrack_range << " meters before starting CLC downtrack");
302
303 std::chrono::system_clock::time_point end_time = std::chrono::system_clock::now(); // Planning complete
304
305 auto duration = end_time - start_time;
306 RCLCPP_DEBUG_STREAM(
307 rclcpp::get_logger("cooperative_lanechange"),
308 "CLC ExecutionTime: " << std::chrono::duration<double>(duration).count());
309 return;
310 }
311 auto current_lanelets = lanelet::geometry::findNearest(wm_->getMap()->laneletLayer, veh_pos, 10);
312 long current_lanelet_id = current_lanelets[0].second.id();
313 if(current_lanelet_id == target_lanelet_id && current_downtrack >= target_downtrack - config_.destination_range){
314 carma_planning_msgs::msg::LaneChangeStatus lc_status_msg;
315 lc_status_msg.status = carma_planning_msgs::msg::LaneChangeStatus::PLANNING_SUCCESS;
316 //No description as per UI documentation
317 lanechange_status_pub_->publish(lc_status_msg);
318 }
319
320 long veh2_lanelet_id = 0;
321 double veh2_downtrack = 0.0, veh2_speed = 0.0;
322 bool foundRoadwayObject = false;
323 bool negotiate = true;
324 std::vector<carma_perception_msgs::msg::RoadwayObstacle> rwol = wm_->getRoadwayObjects();
325 //Assuming only one connected vehicle in list
326 for(int i = 0; i < rwol.size(); i++){
327 if(rwol[i].connected_vehicle_type.type == carma_perception_msgs::msg::ConnectedVehicleType::NOT_CONNECTED){
328 veh2_lanelet_id = rwol[0].lanelet_id;
329 veh2_downtrack = rwol[0].down_track; //Returns downtrack
330 veh2_speed = rwol[0].object.velocity.twist.linear.x;
331 foundRoadwayObject = true;
332 break;
333 }
334 }
335 if(foundRoadwayObject){
336 RCLCPP_DEBUG_STREAM(get_logger(), "Found Roadway object");
337 //get current_gap
338 RCLCPP_DEBUG_STREAM(get_logger(), "veh2_lanelet_id: " << veh2_lanelet_id << ", veh2_downtrack: " << veh2_downtrack);
339
340 double current_gap = find_current_gap(veh2_lanelet_id, veh2_downtrack, req->vehicle_state);
341 RCLCPP_DEBUG_STREAM(get_logger(), "Current gap: " << current_gap);
342
343 //get desired gap - desired time gap (default 3s)* relative velocity
344 double relative_velocity = current_speed_ - veh2_speed;
345 RCLCPP_DEBUG_STREAM(get_logger(), "Relative velocity: " << relative_velocity);
346 double desired_gap = config_.desired_time_gap * relative_velocity;
347 RCLCPP_DEBUG_STREAM(get_logger(), "Desired gap: " << desired_gap);
348
349 if(desired_gap < config_.min_desired_gap){
350 desired_gap = config_.min_desired_gap;
351 }
352 // TODO - this condition needs to be re-enabled after testing
353 // if(current_gap > desired_gap){
354 // negotiate = false; //No need for negotiation
355 // }
356
357 }
358 else{
359 RCLCPP_DEBUG_STREAM(get_logger(), "No roadway object");
360 negotiate = false;
361 }
362
363 //plan lanechange without filling in response
364 RCLCPP_DEBUG_STREAM(get_logger(), "Planning lane change trajectory");
365
366 std::string maneuver_id = maneuver_plan[0].lane_change_maneuver.parameters.maneuver_id;
367 if (original_lc_maneuver_values_.find(maneuver_id) == original_lc_maneuver_values_.end()) {
368 // If this lane change maneuver ID is being received for this first time, store its original start_dist and starting_lane_id locally
369 RCLCPP_DEBUG_STREAM(get_logger(), "Received maneuver id " << maneuver_id << " for the first time");
370 RCLCPP_DEBUG_STREAM(get_logger(), "Original start dist is " << maneuver_plan[0].lane_change_maneuver.start_dist);
371 RCLCPP_DEBUG_STREAM(get_logger(), "Original starting_lane_id is " << maneuver_plan[0].lane_change_maneuver.starting_lane_id);
372
373 // Create LaneChangeManeuverOriginalValues object for this lane change maneuver and add it to original_lc_maneuver_values_
374 LaneChangeManeuverOriginalValues original_lc_values;
375 original_lc_values.maneuver_id = maneuver_id;
376 original_lc_values.original_starting_lane_id = maneuver_plan[0].lane_change_maneuver.starting_lane_id;
377 original_lc_values.original_start_dist = maneuver_plan[0].lane_change_maneuver.start_dist;
378
379 original_lc_maneuver_values_[maneuver_id] = original_lc_values;
380 }
381 else {
382 // If the vehicle has just started this lane change, store its initial velocity locally; this velocity will be maintained throughout the lane change
383 if (current_downtrack >= (original_lc_maneuver_values_[maneuver_id]).original_start_dist && !(original_lc_maneuver_values_[maneuver_id]).has_started) {
384 original_lc_maneuver_values_[maneuver_id].has_started = true;
385 original_lc_maneuver_values_[maneuver_id].original_longitudinal_vel_ms = std::max(req->vehicle_state.longitudinal_vel, config_.minimum_speed);
386
387 RCLCPP_DEBUG_STREAM(get_logger(), "Lane change maneuver " << maneuver_id << " has started, maintaining speed (in m/s): " <<
388 original_lc_maneuver_values_[maneuver_id].original_longitudinal_vel_ms << " throughout lane change");
389 }
390 }
391
392 std::vector<carma_planning_msgs::msg::TrajectoryPlanPoint> planned_trajectory_points = plan_lanechange(req);
393
394 if(negotiate){
395 RCLCPP_DEBUG_STREAM(get_logger(), "Negotiating");
396 //send mobility request
397 //Planning for first lane change maneuver
398 carma_v2x_msgs::msg::MobilityRequest request = create_mobility_request(planned_trajectory_points, maneuver_plan[0]);
399 outgoing_mobility_request_pub_->publish(request);
400 if(!request_sent_){
401 request_sent_time_ = this->now();
402 request_sent_ = true;
403 }
404 carma_planning_msgs::msg::LaneChangeStatus lc_status_msg;
405 lc_status_msg.status = carma_planning_msgs::msg::LaneChangeStatus::PLAN_SENT;
406 lc_status_msg.description = "Requested lane merge";
407 lanechange_status_pub_->publish(lc_status_msg);
408 }
409
410 //if ack mobility response, send lanechange response
411 if(!negotiate || is_lanechange_accepted_){
412 RCLCPP_DEBUG_STREAM(get_logger(), "negotiate:" << negotiate);
413 RCLCPP_DEBUG_STREAM(get_logger(), "is_lanechange_accepted:" << is_lanechange_accepted_);
414
415 RCLCPP_DEBUG_STREAM(get_logger(), "Adding to response");
416 add_trajectory_to_response(req,resp,planned_trajectory_points);
417
418 }
419 else{
420 if(!negotiate && !request_sent_){
421 request_sent_time_ = this->now();
422 request_sent_ = true;
423 }
424 rclcpp::Time planning_end_time = this->now();
425 rclcpp::Duration passed_time = planning_end_time - request_sent_time_;
426 if(passed_time.seconds() >= config_.lanechange_time_out){
427 carma_planning_msgs::msg::LaneChangeStatus lc_status_msg;
428 lc_status_msg.status = carma_planning_msgs::msg::LaneChangeStatus::TIMED_OUT;
429 lc_status_msg.description = "Request timed out for lane merge";
430 lanechange_status_pub_->publish(lc_status_msg);
431 request_sent_ = false; //Reset variable
432 }
433 }
434
435 // Set the planning plugin field name
436 for (auto& p : resp->trajectory_plan.trajectory_points) {
437 p.planner_plugin_name = get_plugin_name();
438 }
439
440 std::chrono::system_clock::time_point end_time = std::chrono::system_clock::now(); // Planning complete
441
442 auto duration = end_time - start_time;
443 RCLCPP_DEBUG_STREAM(
444 rclcpp::get_logger("cooperative_lanechange"),
445 "CLC ExecutionTime: " << std::chrono::duration<double>(duration).count());
446 }
std::string get_plugin_name() const
Return the name of this plugin.
carma_v2x_msgs::msg::MobilityRequest create_mobility_request(std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > &trajectory_plan, carma_planning_msgs::msg::Maneuver &maneuver)
Creates a mobility request message from planned trajectory and requested maneuver info.
void add_trajectory_to_response(carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr req, carma_planning_msgs::srv::PlanTrajectory::Response::SharedPtr resp, const std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > &planned_trajectory_points)
Adds the generated trajectory plan to the service response.
std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > plan_lanechange(carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr req)
Creates a vector of Trajectory Points from maneuver information in trajectory request.
double find_current_gap(long veh2_lanelet_id, double veh2_downtrack, carma_planning_msgs::msg::VehicleState &ego_state) const
Calculates distance between subject vehicle and vehicle 2.

References add_trajectory_to_response(), clc_called_, config_, create_mobility_request(), current_speed_, cooperative_lanechange::Config::desired_time_gap, cooperative_lanechange::Config::destination_range, find_current_gap(), basic_autonomy::get_logger(), carma_guidance_plugins::PluginBaseNode::get_plugin_name(), process_bag::i, is_lanechange_accepted_, lanechange_status_pub_, cooperative_lanechange::Config::lanechange_time_out, cooperative_lanechange::LaneChangeManeuverOriginalValues::maneuver_id, cooperative_lanechange::Config::min_desired_gap, cooperative_lanechange::Config::minimum_speed, original_lc_maneuver_values_, cooperative_lanechange::LaneChangeManeuverOriginalValues::original_start_dist, cooperative_lanechange::LaneChangeManeuverOriginalValues::original_starting_lane_id, outgoing_mobility_request_pub_, plan_lanechange(), request_sent_, request_sent_time_, cooperative_lanechange::Config::starting_downtrack_range, and wm_.

Here is the call graph for this function:

◆ pose_cb()

void cooperative_lanechange::CooperativeLaneChangePlugin::pose_cb ( const geometry_msgs::msg::PoseStamped::UniquePtr  msg)
private

Callback for the pose subscriber, which will store latest pose locally.

Parameters
msgLatest pose message

Definition at line 249 of file cooperative_lanechange_node.cpp.

250 {
251 pose_msg_ = *msg;
252 }

References pose_msg_.

Referenced by on_configure_plugin().

Here is the caller graph for this function:

◆ trajectory_plan_to_trajectory()

carma_v2x_msgs::msg::Trajectory cooperative_lanechange::CooperativeLaneChangePlugin::trajectory_plan_to_trajectory ( const std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > &  traj_points) const

Converts Trajectory Plan to (Mobility) Trajectory.

Parameters
traj_pointsvector of Trajectory Plan points to be converted to Trajectory type message
Returns
The Trajectory type message in world frame

Definition at line 544 of file cooperative_lanechange_node.cpp.

545 {
546 carma_v2x_msgs::msg::Trajectory traj;
547 carma_v2x_msgs::msg::LocationECEF ecef_location = trajectory_point_to_ecef(traj_points[0]);
548
549 if (traj_points.size() < 2){
550 RCLCPP_WARN_STREAM(get_logger(), "Received Trajectory Plan is too small");
551 traj.offsets = {};
552 }
553 else{
554 carma_v2x_msgs::msg::LocationECEF prev_point = ecef_location;
555 for (size_t i = 1; i < traj_points.size(); i++){
556
557 carma_v2x_msgs::msg::LocationOffsetECEF offset;
558 carma_v2x_msgs::msg::LocationECEF new_point = trajectory_point_to_ecef(traj_points[i]); // m to cm to fit the msg standard
559 offset.offset_x = (int16_t)(new_point.ecef_x - prev_point.ecef_x);
560 offset.offset_y = (int16_t)(new_point.ecef_y - prev_point.ecef_y);
561 offset.offset_z = (int16_t)(new_point.ecef_z - prev_point.ecef_z);
562 prev_point = new_point;
563 traj.offsets.push_back(offset);
564 }
565 }
566
567 traj.location = ecef_location;
568
569 return traj;
570 }

References basic_autonomy::get_logger(), process_bag::i, and trajectory_point_to_ecef().

Referenced by create_mobility_request().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ trajectory_point_to_ecef()

carma_v2x_msgs::msg::LocationECEF cooperative_lanechange::CooperativeLaneChangePlugin::trajectory_point_to_ecef ( const carma_planning_msgs::msg::TrajectoryPlanPoint &  traj_point) const

Converts Trajectory Point to ECEF frame using map projection.

Parameters
traj_pointsA Trajectory Plan point to be converted to Trajectory type message
Exceptions
std::invalid_argumentIf the map_projector_ member variable has not been set
Returns
The trajectory point message transformed to ecef frame

Definition at line 572 of file cooperative_lanechange_node.cpp.

573 {
574 if (!map_projector_) {
575 throw std::invalid_argument("No map projector available for ecef conversion");
576 }
577 carma_v2x_msgs::msg::LocationECEF location;
578
579 lanelet::BasicPoint3d ecef_point = map_projector_->projectECEF({traj_point.x, traj_point.y, 0.0}, 1);
580 location.ecef_x = ecef_point.x() * 100.0; // Convert cm to m
581 location.ecef_y = ecef_point.y() * 100.0;
582 location.ecef_z = ecef_point.z() * 100.0;
583
584 return location;
585 }

References map_projector_.

Referenced by create_mobility_request(), and trajectory_plan_to_trajectory().

Here is the caller graph for this function:

◆ twist_cb()

void cooperative_lanechange::CooperativeLaneChangePlugin::twist_cb ( const geometry_msgs::msg::TwistStamped::UniquePtr  msg)
private

Callback for the twist subscriber, which will store latest twist locally.

Parameters
msgLatest twist message

Definition at line 254 of file cooperative_lanechange_node.cpp.

255 {
256 current_speed_ = msg->twist.linear.x;
257 }

References current_speed_.

Referenced by on_configure_plugin().

Here is the caller graph for this function:

Member Data Documentation

◆ bsm_core_

carma_v2x_msgs::msg::BSMCoreData cooperative_lanechange::CooperativeLaneChangePlugin::bsm_core_
private

Definition at line 114 of file cooperative_lanechange_node.hpp.

Referenced by bsm_cb(), and create_mobility_request().

◆ bsm_sub_

carma_ros2_utils::SubPtr<carma_v2x_msgs::msg::BSM> cooperative_lanechange::CooperativeLaneChangePlugin::bsm_sub_
private

Definition at line 76 of file cooperative_lanechange_node.hpp.

Referenced by on_configure_plugin().

◆ clc_called_

bool cooperative_lanechange::CooperativeLaneChangePlugin::clc_called_ = false
private

◆ clc_request_id_

std::string cooperative_lanechange::CooperativeLaneChangePlugin::clc_request_id_ = "default_request_id"
private

◆ config_

◆ current_speed_

double cooperative_lanechange::CooperativeLaneChangePlugin::current_speed_

Definition at line 147 of file cooperative_lanechange_node.hpp.

Referenced by plan_trajectory_callback(), and twist_cb().

◆ DEFAULT_STRING_

std::string cooperative_lanechange::CooperativeLaneChangePlugin::DEFAULT_STRING_ = ""
private

Definition at line 96 of file cooperative_lanechange_node.hpp.

Referenced by create_mobility_request().

◆ ending_state_before_buffer_

carma_planning_msgs::msg::VehicleState cooperative_lanechange::CooperativeLaneChangePlugin::ending_state_before_buffer_

Definition at line 155 of file cooperative_lanechange_node.hpp.

Referenced by plan_lanechange().

◆ georeference_sub_

carma_ros2_utils::SubPtr<std_msgs::msg::String> cooperative_lanechange::CooperativeLaneChangePlugin::georeference_sub_
private

Definition at line 75 of file cooperative_lanechange_node.hpp.

Referenced by on_configure_plugin().

◆ incoming_mobility_response_sub_

carma_ros2_utils::SubPtr<carma_v2x_msgs::msg::MobilityResponse> cooperative_lanechange::CooperativeLaneChangePlugin::incoming_mobility_response_sub_
private

Definition at line 74 of file cooperative_lanechange_node.hpp.

Referenced by on_configure_plugin().

◆ is_lanechange_accepted_

bool cooperative_lanechange::CooperativeLaneChangePlugin::is_lanechange_accepted_ = false

◆ lanechange_status_pub_

carma_ros2_utils::PubPtr<carma_planning_msgs::msg::LaneChangeStatus> cooperative_lanechange::CooperativeLaneChangePlugin::lanechange_status_pub_
private

◆ maneuver_fraction_completed_

double cooperative_lanechange::CooperativeLaneChangePlugin::maneuver_fraction_completed_ = 0
private

Definition at line 105 of file cooperative_lanechange_node.hpp.

Referenced by create_mobility_request(), and plan_lanechange().

◆ map_georeference_

std::string cooperative_lanechange::CooperativeLaneChangePlugin::map_georeference_ {""}
private

Definition at line 89 of file cooperative_lanechange_node.hpp.

Referenced by georeference_cb().

◆ map_projector_

std::shared_ptr<lanelet::projection::LocalFrameProjector> cooperative_lanechange::CooperativeLaneChangePlugin::map_projector_
private

◆ original_lc_maneuver_values_

std::unordered_map<std::string, LaneChangeManeuverOriginalValues> cooperative_lanechange::CooperativeLaneChangePlugin::original_lc_maneuver_values_
private

Definition at line 117 of file cooperative_lanechange_node.hpp.

Referenced by plan_lanechange(), and plan_trajectory_callback().

◆ outgoing_mobility_request_pub_

carma_ros2_utils::PubPtr<carma_v2x_msgs::msg::MobilityRequest> cooperative_lanechange::CooperativeLaneChangePlugin::outgoing_mobility_request_pub_
private

◆ pose_msg_

geometry_msgs::msg::PoseStamped cooperative_lanechange::CooperativeLaneChangePlugin::pose_msg_

Definition at line 150 of file cooperative_lanechange_node.hpp.

Referenced by create_mobility_request(), and pose_cb().

◆ pose_sub_

carma_ros2_utils::SubPtr<geometry_msgs::msg::PoseStamped> cooperative_lanechange::CooperativeLaneChangePlugin::pose_sub_
private

Definition at line 72 of file cooperative_lanechange_node.hpp.

Referenced by on_configure_plugin().

◆ request_sent_

bool cooperative_lanechange::CooperativeLaneChangePlugin::request_sent_ = false
private

Definition at line 102 of file cooperative_lanechange_node.hpp.

Referenced by plan_lanechange(), and plan_trajectory_callback().

◆ request_sent_time_

rclcpp::Time cooperative_lanechange::CooperativeLaneChangePlugin::request_sent_time_
private

Definition at line 99 of file cooperative_lanechange_node.hpp.

Referenced by plan_trajectory_callback().

◆ traj_freq_

double cooperative_lanechange::CooperativeLaneChangePlugin::traj_freq_ = 10
private

Definition at line 93 of file cooperative_lanechange_node.hpp.

◆ twist_sub_

carma_ros2_utils::SubPtr<geometry_msgs::msg::TwistStamped> cooperative_lanechange::CooperativeLaneChangePlugin::twist_sub_
private

Definition at line 73 of file cooperative_lanechange_node.hpp.

Referenced by on_configure_plugin().

◆ wm_

carma_wm::WorldModelConstPtr cooperative_lanechange::CooperativeLaneChangePlugin::wm_
private

The documentation for this class was generated from the following files: