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.
|
Class containing primary business logic for the In-Lane Cruising Plugin. More...
#include <yield_plugin.hpp>
Public Member Functions | |
YieldPlugin (std::shared_ptr< carma_ros2_utils::CarmaLifecycleNode > nh, carma_wm::WorldModelConstPtr wm, YieldPluginConfig config, MobilityResponseCB mobility_response_publisher, LaneChangeStatusCB lc_status_publisher) | |
Constructor. More... | |
void | plan_trajectory_callback (carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr req, carma_planning_msgs::srv::PlanTrajectory::Response::SharedPtr resp) |
Service callback for trajectory planning. More... | |
carma_planning_msgs::msg::TrajectoryPlan | update_traj_for_object (const carma_planning_msgs::msg::TrajectoryPlan &original_tp, const std::vector< carma_perception_msgs::msg::ExternalObject > &external_objects, double initial_velocity) |
trajectory is modified to safely avoid obstacles on the road More... | |
double | polynomial_calc (std::vector< double > coeff, double x) const |
calculate quintic polynomial equation for a given x More... | |
double | polynomial_calc_d (std::vector< double > coeff, double x) const |
calculate derivative of quintic polynomial equation for a given x More... | |
double | max_trajectory_speed (const std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > &trajectory_points, double timestamp_in_sec_to_search_until) const |
calculates the maximum speed in a set of tajectory points More... | |
std::vector< double > | get_relative_downtracks (const carma_planning_msgs::msg::TrajectoryPlan &trajectory_plan) const |
calculates distance between trajectory points in a plan More... | |
void | mobilityrequest_cb (const carma_v2x_msgs::msg::MobilityRequest::UniquePtr msg) |
callback for mobility request More... | |
void | bsm_cb (const carma_v2x_msgs::msg::BSM::UniquePtr msg) |
callback for bsm message More... | |
std::vector< lanelet::BasicPoint2d > | convert_eceftrajectory_to_mappoints (const carma_v2x_msgs::msg::Trajectory &ecef_trajectory) const |
convert a carma trajectory from ecef frame to map frame ecef trajectory consists of the point and a set of offsets with reference to the point More... | |
lanelet::BasicPoint2d | ecef_to_map_point (const carma_v2x_msgs::msg::LocationECEF &ecef_point) const |
convert a point in ecef frame (in cm) into map frame (in meters) More... | |
carma_v2x_msgs::msg::MobilityResponse | compose_mobility_response (const std::string &resp_recipient_id, const std::string &req_plan_id, bool response) const |
compose a mobility response message More... | |
carma_planning_msgs::msg::TrajectoryPlan | generate_JMT_trajectory (const carma_planning_msgs::msg::TrajectoryPlan &original_tp, double initial_pos, double goal_pos, double initial_velocity, double goal_velocity, double planning_time, double original_max_speed) |
generate a Jerk Minimizing Trajectory(JMT) with the provided start and end conditions More... | |
carma_planning_msgs::msg::TrajectoryPlan | update_traj_for_cooperative_behavior (const carma_planning_msgs::msg::TrajectoryPlan &original_tp, double current_speed) |
update trajectory for yielding to an incoming cooperative behavior More... | |
std::vector< std::pair< int, lanelet::BasicPoint2d > > | detect_trajectories_intersection (std::vector< lanelet::BasicPoint2d > self_trajectory, std::vector< lanelet::BasicPoint2d > incoming_trajectory) const |
detect intersection point(s) of two trajectories More... | |
void | set_incoming_request_info (std::vector< lanelet::BasicPoint2d > req_trajectory, double req_speed, double req_planning_time, double req_timestamp) |
set values for member variables related to cooperative behavior More... | |
void | lookup_ecef_to_map_transform () |
Looks up the transform between map and earth frames, and sets the member variable. More... | |
double | check_traj_for_digital_min_gap (const carma_planning_msgs::msg::TrajectoryPlan &original_tp) const |
checks trajectory for minimum gap associated with it More... | |
void | set_georeference_string (const std::string &georeference) |
Setter for map projection string to define lat/lon -> map conversion. More... | |
void | set_external_objects (const std::vector< carma_perception_msgs::msg::ExternalObject > &object_list) |
Setter for external objects with predictions in the environment. More... | |
std::optional< GetCollisionResult > | get_collision (const carma_planning_msgs::msg::TrajectoryPlan &trajectory1, const std::vector< carma_perception_msgs::msg::PredictedState > &trajectory2, double collision_radius, double trajectory1_max_speed) |
Return naive collision time and locations based on collision radius given two trajectories with one being obstacle's predicted steps. More... | |
std::optional< rclcpp::Time > | get_collision_time (const carma_planning_msgs::msg::TrajectoryPlan &original_tp, const carma_perception_msgs::msg::ExternalObject &curr_obstacle, double original_tp_max_speed) |
Return collision time given two trajectories with one being external object with predicted steps. More... | |
bool | is_object_behind_vehicle (uint32_t object_id, const rclcpp::Time &collision_time, double vehicle_point, double object_downtrack) |
Check if object location is behind the vehicle using estimates of the vehicle's length and route downtracks. More... | |
std::optional< std::pair< carma_perception_msgs::msg::ExternalObject, double > > | get_earliest_collision_object_and_time (const carma_planning_msgs::msg::TrajectoryPlan &original_tp, const std::vector< carma_perception_msgs::msg::ExternalObject > &external_objects) |
Return the earliest collision object and time of collision pair from the given trajectory and list of external objects with predicted states. Function first filters obstacles based on whether if their any of predicted state will be on the route. Only then, the logic compares trajectory and predicted states. More... | |
std::unordered_map< uint32_t, rclcpp::Time > | get_collision_times_concurrently (const carma_planning_msgs::msg::TrajectoryPlan &original_tp, const std::vector< carma_perception_msgs::msg::ExternalObject > &external_objects, double original_tp_max_speed) |
Given the list of objects with predicted states, get all collision times concurrently using multi-threading. More... | |
double | get_predicted_velocity_at_time (const geometry_msgs::msg::Twist &object_velocity_in_map_frame, const carma_planning_msgs::msg::TrajectoryPlan &original_tp, double timestamp_in_sec_to_predict) |
Given the object velocity in map frame with x,y components, this function returns the projected velocity along the trajectory at given time. More... | |
Private Member Functions | |
std::string | bsmIDtoString (carma_v2x_msgs::msg::BSMCoreData bsm_core) |
Private Attributes | |
carma_wm::WorldModelConstPtr | wm_ |
YieldPluginConfig | config_ |
MobilityResponseCB | mobility_response_publisher_ |
LaneChangeStatusCB | lc_status_publisher_ |
std::shared_ptr< carma_ros2_utils::CarmaLifecycleNode > | nh_ |
std::set< lanelet::Id > | route_llt_ids_ |
lanelet::Id | previous_llt_id_ |
std::vector< carma_perception_msgs::msg::ExternalObject > | external_objects_ |
std::unordered_map< uint32_t, int > | consecutive_clearance_count_for_obstacles_ |
bool | cooperative_request_acceptable_ = false |
std::vector< lanelet::BasicPoint2d > | req_trajectory_points_ |
double | req_target_speed_ = 0 |
double | req_timestamp_ = 0 |
double | req_target_plan_time_ = 0 |
int | timesteps_since_last_req_ = 0 |
int | clc_urgency_ = 0 |
double | ecef_traj_timestep_ = 0.1 |
geometry_msgs::msg::Vector3 | host_vehicle_size |
double | current_speed_ |
std::string | host_bsm_id_ |
std::string | georeference_ {""} |
std::shared_ptr< lanelet::projection::LocalFrameProjector > | map_projector_ |
Class containing primary business logic for the In-Lane Cruising Plugin.
Definition at line 77 of file yield_plugin.hpp.
yield_plugin::YieldPlugin::YieldPlugin | ( | std::shared_ptr< carma_ros2_utils::CarmaLifecycleNode > | nh, |
carma_wm::WorldModelConstPtr | wm, | ||
YieldPluginConfig | config, | ||
MobilityResponseCB | mobility_response_publisher, | ||
LaneChangeStatusCB | lc_status_publisher | ||
) |
Constructor.
wm | Pointer to intialized instance of the carma world model for accessing semantic map data |
config | The configuration to be used for this object |
mobility_response_publisher | Callback which will publish the mobility response |
lc_status_publisher | Callback which will publish the cooperative lane change status |
Definition at line 45 of file yield_plugin.cpp.
void yield_plugin::YieldPlugin::bsm_cb | ( | const carma_v2x_msgs::msg::BSM::UniquePtr | msg | ) |
callback for bsm message
msg | mobility bsm message |
Definition at line 246 of file yield_plugin.cpp.
References bsmIDtoString(), and host_bsm_id_.
Referenced by yield_plugin::YieldPluginNode::on_configure_plugin().
|
inlineprivate |
Definition at line 342 of file yield_plugin.hpp.
References process_bag::i, and carma_cooperative_perception::to_string().
Referenced by bsm_cb().
double yield_plugin::YieldPlugin::check_traj_for_digital_min_gap | ( | const carma_planning_msgs::msg::TrajectoryPlan & | original_tp | ) | const |
checks trajectory for minimum gap associated with it
original_tp | original trajectory plan |
Definition at line 1036 of file yield_plugin.cpp.
References process_bag::i, nh_, and wm_.
Referenced by update_traj_for_cooperative_behavior(), and update_traj_for_object().
carma_v2x_msgs::msg::MobilityResponse yield_plugin::YieldPlugin::compose_mobility_response | ( | const std::string & | resp_recipient_id, |
const std::string & | req_plan_id, | ||
bool | response | ||
) | const |
compose a mobility response message
resp_recipient_id | vehicle id of the recipient of the message |
req_plan_id | plan id from the requested message |
response | accept/reject to the response based on conditions |
Definition at line 133 of file yield_plugin.cpp.
References YieldPluginConfig::always_accept_mobility_request, config_, host_bsm_id_, nh_, and YieldPluginConfig::vehicle_id.
Referenced by mobilityrequest_cb().
std::vector< lanelet::BasicPoint2d > yield_plugin::YieldPlugin::convert_eceftrajectory_to_mappoints | ( | const carma_v2x_msgs::msg::Trajectory & | ecef_trajectory | ) | const |
convert a carma trajectory from ecef frame to map frame ecef trajectory consists of the point and a set of offsets with reference to the point
ecef_trajectory | carma trajectory (ecef frame) |
Definition at line 94 of file yield_plugin.cpp.
References ecef_to_map_point(), process_bag::first_point, and process_bag::i.
Referenced by mobilityrequest_cb().
std::vector< std::pair< int, lanelet::BasicPoint2d > > yield_plugin::YieldPlugin::detect_trajectories_intersection | ( | std::vector< lanelet::BasicPoint2d > | self_trajectory, |
std::vector< lanelet::BasicPoint2d > | incoming_trajectory | ||
) | const |
detect intersection point(s) of two trajectories
trajectory1 | vector of 2d trajectory points |
trajectory2 | vector of 2d trajectory points |
Definition at line 73 of file yield_plugin.cpp.
References config_, process_bag::i, and YieldPluginConfig::intervehicle_collision_distance_in_m.
Referenced by update_traj_for_cooperative_behavior().
lanelet::BasicPoint2d yield_plugin::YieldPlugin::ecef_to_map_point | ( | const carma_v2x_msgs::msg::LocationECEF & | ecef_point | ) | const |
convert a point in ecef frame (in cm) into map frame (in meters)
ecef_point | carma point ecef frame in cm |
map_in_earth | translate frame |
Definition at line 119 of file yield_plugin.cpp.
References map_projector_.
Referenced by convert_eceftrajectory_to_mappoints().
carma_planning_msgs::msg::TrajectoryPlan yield_plugin::YieldPlugin::generate_JMT_trajectory | ( | const carma_planning_msgs::msg::TrajectoryPlan & | original_tp, |
double | initial_pos, | ||
double | goal_pos, | ||
double | initial_velocity, | ||
double | goal_velocity, | ||
double | planning_time, | ||
double | original_max_speed | ||
) |
generate a Jerk Minimizing Trajectory(JMT) with the provided start and end conditions
original_tp | original trajectory plan |
intial_pos | start position |
goal_pos | final position |
initial_velocity | start velocity |
goal_velocity | end velocity |
planning_time | time duration of the planning |
original | original_max_speed from original_tp up until the goal_pos portion NOTE: the function would generate trajectory duration arbitrarily high if stopping motion is needed. This is to keep the original trajectory's shape in terms of location so that the vehicle steers toward the direction of travel even when stopping. |
Definition at line 402 of file yield_plugin.cpp.
References config_, EPSILON, get_relative_downtracks(), yield_plugin::get_smallest_time_step_of_traj(), process_bag::i, YieldPluginConfig::max_stop_speed_in_ms, basic_autonomy::smoothing::moving_average_filter(), nh_, polynomial_calc(), polynomial_calc_d(), YieldPluginConfig::speed_moving_average_window_size, and carma_cooperative_perception::to_string().
Referenced by update_traj_for_cooperative_behavior(), and update_traj_for_object().
std::optional< GetCollisionResult > yield_plugin::YieldPlugin::get_collision | ( | const carma_planning_msgs::msg::TrajectoryPlan & | trajectory1, |
const std::vector< carma_perception_msgs::msg::PredictedState > & | trajectory2, | ||
double | collision_radius, | ||
double | trajectory1_max_speed | ||
) |
Return naive collision time and locations based on collision radius given two trajectories with one being obstacle's predicted steps.
trajectory1 | trajectory of the ego vehicle |
trajectory2 | trajectory of predicted steps |
collision_radius | a distance to check between two trajectory points at a same timestamp that is considered a collision |
trajectory1_max_speed | max speed of the trajectory1 to efficiently traverse through possible collision combination of the two trajectories NOTE: Currently Traj2 is assumed to be a simple cv model to save computational performance NOTE: Collisions are based on only collision radius at the same predicted time even if ego vehicle maybe past the obstacle. To filter these cases, see is_object_behind_vehicle() |
Definition at line 550 of file yield_plugin.cpp.
References YieldPluginConfig::collision_check_radius_in_m, yield_plugin::GetCollisionResult::collision_time, config_, yield_plugin::get_trajectory_duration(), process_bag::i, YieldPluginConfig::intervehicle_collision_distance_in_m, nh_, YieldPluginConfig::obstacle_zero_speed_threshold_in_ms, yield_plugin::GetCollisionResult::point1, yield_plugin::GetCollisionResult::point2, route_llt_ids_, carma_cooperative_perception::to_string(), and wm_.
Referenced by get_collision_time().
std::optional< rclcpp::Time > yield_plugin::YieldPlugin::get_collision_time | ( | const carma_planning_msgs::msg::TrajectoryPlan & | original_tp, |
const carma_perception_msgs::msg::ExternalObject & | curr_obstacle, | ||
double | original_tp_max_speed | ||
) |
Return collision time given two trajectories with one being external object with predicted steps.
trajectory1 | trajectory of the ego vehicle |
trajectory2 | trajectory of the obstacle |
original_tp_max_speed | max speed of the original_tp to efficiently traverse through possible collision combination of the two trajectories NOTE: Currently curr_obstacle is assumed to be using a simple cv model to save computational performance |
Definition at line 723 of file yield_plugin.cpp.
References config_, consecutive_clearance_count_for_obstacles_, get_collision(), yield_plugin::get_trajectory_start_time(), YieldPluginConfig::intervehicle_collision_distance_in_m, is_object_behind_vehicle(), nh_, carma_cooperative_perception::to_string(), and wm_.
Referenced by get_collision_times_concurrently().
std::unordered_map< uint32_t, rclcpp::Time > yield_plugin::YieldPlugin::get_collision_times_concurrently | ( | const carma_planning_msgs::msg::TrajectoryPlan & | original_tp, |
const std::vector< carma_perception_msgs::msg::ExternalObject > & | external_objects, | ||
double | original_tp_max_speed | ||
) |
Given the list of objects with predicted states, get all collision times concurrently using multi-threading.
original_tp | trajectory of the ego vehicle |
external_objects | list of external objects with predicted states |
original_tp_max_speed | max speed of the original_tp to efficiently traverse through possible collision combination of the two trajectories |
Definition at line 783 of file yield_plugin.cpp.
References get_collision_time().
Referenced by get_earliest_collision_object_and_time().
std::optional< std::pair< carma_perception_msgs::msg::ExternalObject, double > > yield_plugin::YieldPlugin::get_earliest_collision_object_and_time | ( | const carma_planning_msgs::msg::TrajectoryPlan & | original_tp, |
const std::vector< carma_perception_msgs::msg::ExternalObject > & | external_objects | ||
) |
Return the earliest collision object and time of collision pair from the given trajectory and list of external objects with predicted states. Function first filters obstacles based on whether if their any of predicted state will be on the route. Only then, the logic compares trajectory and predicted states.
original_tp | trajectory of the ego vehicle |
external_objects | list of external objects with predicted states |
Definition at line 807 of file yield_plugin.cpp.
References get_collision_times_concurrently(), yield_plugin::get_trajectory_end_time(), max_trajectory_speed(), nh_, route_llt_ids_, and wm_.
Referenced by update_traj_for_object().
double yield_plugin::YieldPlugin::get_predicted_velocity_at_time | ( | const geometry_msgs::msg::Twist & | object_velocity_in_map_frame, |
const carma_planning_msgs::msg::TrajectoryPlan & | original_tp, | ||
double | timestamp_in_sec_to_predict | ||
) |
Given the object velocity in map frame with x,y components, this function returns the projected velocity along the trajectory at given time.
object_velocity_in_map_frame | trajectory of the ego vehicle |
original_tp | trajectory of the ego vehicle |
timestamp_in_sec_to_predict | timestamp in seconds along the trajectory to return the projected velocity NOTE: returns the last point's speed if the specified time is past the trajectory's planning time |
Definition at line 845 of file yield_plugin.cpp.
References yield_plugin::get_trajectory_end_time(), process_bag::i, nh_, and carma_cooperative_perception::to_string().
Referenced by update_traj_for_object().
std::vector< double > yield_plugin::YieldPlugin::get_relative_downtracks | ( | const carma_planning_msgs::msg::TrajectoryPlan & | trajectory_plan | ) | const |
calculates distance between trajectory points in a plan
trajectory_plan | input trajectory plan |
Definition at line 976 of file yield_plugin.cpp.
References process_bag::i.
Referenced by generate_JMT_trajectory().
bool yield_plugin::YieldPlugin::is_object_behind_vehicle | ( | uint32_t | object_id, |
const rclcpp::Time & | collision_time, | ||
double | vehicle_point, | ||
double | object_downtrack | ||
) |
Check if object location is behind the vehicle using estimates of the vehicle's length and route downtracks.
object_id | object id to use for the consecutive_clearance_count_for_obstacles_ |
collision_time | predicted time of collision |
vehicle_downtrack | at the time of collision |
object_downtrack | at the time of collision NOTE: Uses internal counter low pass filter to confirm the object is behind only if it counted continuously above config_.consecutive_clearance_count_for_obstacles_threshold |
Definition at line 697 of file yield_plugin.cpp.
References config_, consecutive_clearance_count_for_obstacles_, YieldPluginConfig::consecutive_clearance_count_for_obstacles_threshold, nh_, carma_cooperative_perception::to_string(), and YieldPluginConfig::vehicle_length.
Referenced by get_collision_time().
void yield_plugin::YieldPlugin::lookup_ecef_to_map_transform | ( | ) |
Looks up the transform between map and earth frames, and sets the member variable.
double yield_plugin::YieldPlugin::max_trajectory_speed | ( | const std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > & | trajectory_points, |
double | timestamp_in_sec_to_search_until | ||
) | const |
calculates the maximum speed in a set of tajectory points
trajectory_points | trajectory points |
Definition at line 1013 of file yield_plugin.cpp.
References process_bag::i.
Referenced by get_earliest_collision_object_and_time(), update_traj_for_cooperative_behavior(), and update_traj_for_object().
void yield_plugin::YieldPlugin::mobilityrequest_cb | ( | const carma_v2x_msgs::msg::MobilityRequest::UniquePtr | msg | ) |
callback for mobility request
msg | mobility request message |
Definition at line 153 of file yield_plugin.cpp.
References clc_urgency_, compose_mobility_response(), config_, convert_eceftrajectory_to_mappoints(), cooperative_request_acceptable_, lc_status_publisher_, map_projector_, YieldPluginConfig::min_obj_avoidance_plan_time_in_s, mobility_response_publisher_, nh_, set_incoming_request_info(), timesteps_since_last_req_, and YieldPluginConfig::vehicle_id.
Referenced by yield_plugin::YieldPluginNode::on_configure_plugin().
void yield_plugin::YieldPlugin::plan_trajectory_callback | ( | carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr | req, |
carma_planning_msgs::srv::PlanTrajectory::Response::SharedPtr | resp | ||
) |
Service callback for trajectory planning.
srv_header | header |
req | The service request |
resp | The service response |
Definition at line 252 of file yield_plugin.cpp.
References YieldPluginConfig::acceptable_passed_timesteps, YieldPluginConfig::acceptable_urgency, clc_urgency_, config_, YieldPluginConfig::enable_cooperative_behavior, EPSILON, external_objects_, yield_plugin::get_trajectory_end_time(), nh_, timesteps_since_last_req_, carma_cooperative_perception::to_string(), update_traj_for_cooperative_behavior(), and update_traj_for_object().
double yield_plugin::YieldPlugin::polynomial_calc | ( | std::vector< double > | coeff, |
double | x | ||
) | const |
calculate quintic polynomial equation for a given x
coeff | vector including polynomial coefficiencrs |
x | input variable to the polynomial |
Definition at line 991 of file yield_plugin.cpp.
References process_bag::i, and process_traj_logs::x.
Referenced by generate_JMT_trajectory().
double yield_plugin::YieldPlugin::polynomial_calc_d | ( | std::vector< double > | coeff, |
double | x | ||
) | const |
calculate derivative of quintic polynomial equation for a given x
coeff | vector including polynomial coefficiencrs |
x | input variable to the polynomial |
Definition at line 1002 of file yield_plugin.cpp.
References process_bag::i, and process_traj_logs::x.
Referenced by generate_JMT_trajectory().
void yield_plugin::YieldPlugin::set_external_objects | ( | const std::vector< carma_perception_msgs::msg::ExternalObject > & | object_list | ) |
Setter for external objects with predictions in the environment.
object_list | The object list. |
Definition at line 1070 of file yield_plugin.cpp.
References external_objects_.
void yield_plugin::YieldPlugin::set_georeference_string | ( | const std::string & | georeference | ) |
Setter for map projection string to define lat/lon -> map conversion.
georeference | The proj string defining the projection. |
Definition at line 1061 of file yield_plugin.cpp.
References georeference_, and map_projector_.
void yield_plugin::YieldPlugin::set_incoming_request_info | ( | std::vector< lanelet::BasicPoint2d > | req_trajectory, |
double | req_speed, | ||
double | req_planning_time, | ||
double | req_timestamp | ||
) |
set values for member variables related to cooperative behavior
req_trajectory | requested trajectory |
req_speed | speed of requested cooperative behavior |
req_planning_time | planning time for the requested cooperative behavior |
req_timestamp | the mobility request time stamp |
Definition at line 237 of file yield_plugin.cpp.
References nh_, req_target_plan_time_, req_target_speed_, req_timestamp_, and req_trajectory_points_.
Referenced by mobilityrequest_cb().
carma_planning_msgs::msg::TrajectoryPlan yield_plugin::YieldPlugin::update_traj_for_cooperative_behavior | ( | const carma_planning_msgs::msg::TrajectoryPlan & | original_tp, |
double | current_speed | ||
) |
update trajectory for yielding to an incoming cooperative behavior
original_tp | original trajectory plan |
current_speed | current speed of the vehicle |
Definition at line 317 of file yield_plugin.cpp.
References check_traj_for_digital_min_gap(), config_, cooperative_request_acceptable_, detect_trajectories_intersection(), ecef_traj_timestep_, generate_JMT_trajectory(), yield_plugin::get_trajectory_end_time(), process_bag::i, max_trajectory_speed(), YieldPluginConfig::minimum_safety_gap_in_meters, nh_, req_target_plan_time_, req_target_speed_, req_timestamp_, req_trajectory_points_, YieldPluginConfig::safety_collision_time_gap_in_s, and YieldPluginConfig::yield_max_deceleration_in_ms2.
Referenced by plan_trajectory_callback().
carma_planning_msgs::msg::TrajectoryPlan yield_plugin::YieldPlugin::update_traj_for_object | ( | const carma_planning_msgs::msg::TrajectoryPlan & | original_tp, |
const std::vector< carma_perception_msgs::msg::ExternalObject > & | external_objects, | ||
double | initial_velocity | ||
) |
trajectory is modified to safely avoid obstacles on the road
original_tp | original trajectory plan without object avoidance |
current_speed_ | current speed of the vehicle |
return modified trajectory plan
Definition at line 888 of file yield_plugin.cpp.
References YieldPluginConfig::acceleration_adjustment_factor, check_traj_for_digital_min_gap(), config_, YieldPluginConfig::enable_adjustable_gap, generate_JMT_trajectory(), get_earliest_collision_object_and_time(), get_predicted_velocity_at_time(), max_trajectory_speed(), YieldPluginConfig::min_obj_avoidance_plan_time_in_s, YieldPluginConfig::minimum_safety_gap_in_meters, nh_, YieldPluginConfig::obstacle_zero_speed_threshold_in_ms, YieldPluginConfig::vehicle_length, wm_, and YieldPluginConfig::yield_max_deceleration_in_ms2.
Referenced by plan_trajectory_callback().
|
private |
Definition at line 329 of file yield_plugin.hpp.
Referenced by mobilityrequest_cb(), and plan_trajectory_callback().
|
private |
Definition at line 312 of file yield_plugin.hpp.
Referenced by compose_mobility_response(), detect_trajectories_intersection(), generate_JMT_trajectory(), get_collision(), get_collision_time(), is_object_behind_vehicle(), mobilityrequest_cb(), plan_trajectory_callback(), update_traj_for_cooperative_behavior(), and update_traj_for_object().
|
private |
Definition at line 319 of file yield_plugin.hpp.
Referenced by get_collision_time(), and is_object_behind_vehicle().
|
private |
Definition at line 321 of file yield_plugin.hpp.
Referenced by mobilityrequest_cb(), and update_traj_for_cooperative_behavior().
|
private |
Definition at line 335 of file yield_plugin.hpp.
|
private |
Definition at line 332 of file yield_plugin.hpp.
Referenced by update_traj_for_cooperative_behavior().
|
private |
Definition at line 318 of file yield_plugin.hpp.
Referenced by plan_trajectory_callback(), and set_external_objects().
|
private |
Definition at line 339 of file yield_plugin.hpp.
Referenced by set_georeference_string().
|
private |
Definition at line 337 of file yield_plugin.hpp.
Referenced by bsm_cb(), and compose_mobility_response().
|
private |
Definition at line 334 of file yield_plugin.hpp.
|
private |
Definition at line 314 of file yield_plugin.hpp.
Referenced by mobilityrequest_cb().
|
private |
Definition at line 340 of file yield_plugin.hpp.
Referenced by ecef_to_map_point(), mobilityrequest_cb(), and set_georeference_string().
|
private |
Definition at line 313 of file yield_plugin.hpp.
Referenced by mobilityrequest_cb().
|
private |
Definition at line 315 of file yield_plugin.hpp.
Referenced by check_traj_for_digital_min_gap(), compose_mobility_response(), generate_JMT_trajectory(), get_collision(), get_collision_time(), get_earliest_collision_object_and_time(), get_predicted_velocity_at_time(), is_object_behind_vehicle(), mobilityrequest_cb(), plan_trajectory_callback(), set_incoming_request_info(), update_traj_for_cooperative_behavior(), and update_traj_for_object().
|
private |
Definition at line 317 of file yield_plugin.hpp.
|
private |
Definition at line 327 of file yield_plugin.hpp.
Referenced by set_incoming_request_info(), and update_traj_for_cooperative_behavior().
|
private |
Definition at line 325 of file yield_plugin.hpp.
Referenced by set_incoming_request_info(), and update_traj_for_cooperative_behavior().
|
private |
Definition at line 326 of file yield_plugin.hpp.
Referenced by set_incoming_request_info(), and update_traj_for_cooperative_behavior().
|
private |
Definition at line 324 of file yield_plugin.hpp.
Referenced by set_incoming_request_info(), and update_traj_for_cooperative_behavior().
|
private |
Definition at line 316 of file yield_plugin.hpp.
Referenced by get_collision(), and get_earliest_collision_object_and_time().
|
private |
Definition at line 328 of file yield_plugin.hpp.
Referenced by mobilityrequest_cb(), and plan_trajectory_callback().
|
private |
Definition at line 311 of file yield_plugin.hpp.
Referenced by check_traj_for_digital_min_gap(), get_collision(), get_collision_time(), get_earliest_collision_object_and_time(), and update_traj_for_object().