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 Stop Controlled Intersection Tactical Plugin. More...
#include <stop_controlled_intersection_plugin.hpp>
Public Member Functions | |
StopControlledIntersectionTacticalPlugin (const rclcpp::NodeOptions &options) | |
std::vector< PointSpeedPair > | maneuvers_to_points (const std::vector< carma_planning_msgs::msg::Maneuver > &maneuvers, const carma_wm::WorldModelConstPtr &wm, const carma_planning_msgs::msg::VehicleState &state) |
Converts a set of requested stop controlled intersection maneuvers to point speed limit pairs. More... | |
std::vector< PointSpeedPair > | create_case_one_speed_profile (const carma_wm::WorldModelConstPtr &wm, const carma_planning_msgs::msg::Maneuver &maneuver, std::vector< lanelet::BasicPoint2d > &route_geometry_points, double starting_speed, const carma_planning_msgs::msg::VehicleState &states) |
Creates a speed profile according to case one of the stop controlled intersection, where the vehicle accelerates and then decelerates to a stop. More... | |
std::vector< PointSpeedPair > | create_case_two_speed_profile (const carma_wm::WorldModelConstPtr &wm, const carma_planning_msgs::msg::Maneuver &maneuver, std::vector< lanelet::BasicPoint2d > &route_geometry_points, double starting_speed) |
Creates a speed profile according to case two of the stop controlled intersection, where the vehicle first accelerates then cruises and finally decelerates to a stop. More... | |
std::vector< PointSpeedPair > | create_case_three_speed_profile (const carma_wm::WorldModelConstPtr &wm, const carma_planning_msgs::msg::Maneuver &maneuver, std::vector< lanelet::BasicPoint2d > &route_geometry_points, double starting_speed) |
Creates a speed profile according to case three of the stop controlled intersection, where the vehicle continuously decelerates to a stop. More... | |
std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > | compose_trajectory_from_centerline (const std::vector< PointSpeedPair > &points, const carma_planning_msgs::msg::VehicleState &state, const rclcpp::Time &state_time) |
Method converts a list of lanelet centerline points and current vehicle state into a usable list of trajectory points for trajectory planning. More... | |
carma_ros2_utils::CallbackReturn | on_configure_plugin () override |
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... | |
bool | get_availability () |
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 () |
Returns the version id of this plugin. More... | |
rcl_interfaces::msg::SetParametersResult | parameter_update_callback (const std::vector< rclcpp::Parameter > ¶meters) |
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... | |
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::WMListener > | get_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) | |
Private Member Functions | |
FRIEND_TEST (StopControlledIntersectionTacticalPlugin, TestSCIPlanning_case_one) | |
FRIEND_TEST (StopControlledIntersectionTacticalPlugin, TestSCIPlanning_case_two) | |
FRIEND_TEST (StopControlledIntersectionTacticalPlugin, TestSCIPlanning_case_three) | |
Private Attributes | |
carma_wm::WorldModelConstPtr | wm_ |
StopControlledIntersectionTacticalPluginConfig | config_ |
std::string | stop_controlled_intersection_strategy_ = "Carma/stop_controlled_intersection" |
double | epsilon_ = 0.001 |
Class containing primary business logic for the Stop Controlled Intersection Tactical Plugin.
Definition at line 63 of file stop_controlled_intersection_plugin.hpp.
|
explicit |
Definition at line 51 of file stop_controlled_intersection_tactical_plugin.cpp.
References stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::back_distance, stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::centerline_sampling_spacing, config_, stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::curvature_moving_average_window_size, stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::curve_resample_step_size, stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::lateral_accel_limit, stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::speed_moving_average_window_size, and stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::trajectory_time_length.
std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPlugin::compose_trajectory_from_centerline | ( | const std::vector< PointSpeedPair > & | points, |
const carma_planning_msgs::msg::VehicleState & | state, | ||
const rclcpp::Time & | state_time | ||
) |
Method converts a list of lanelet centerline points and current vehicle state into a usable list of trajectory points for trajectory planning.
points | The set of points that define the current lane the vehicle is in and are defined based on the request planning maneuvers. These points must be in the same lane as the vehicle and must extend in front of it though it is fine if they also extend behind it. |
state | The current state of the vehicle |
state_time | The abosolute time which the provided vehicle state corresponds to |
Definition at line 477 of file stop_controlled_intersection_tactical_plugin.cpp.
References basic_autonomy::waypoint_generation::apply_speed_limits(), basic_autonomy::waypoint_generation::attach_past_points(), stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::back_distance, process_traj_logs::c, carma_wm::geometry::compute_arc_lengths(), basic_autonomy::waypoint_generation::compute_curvature_at(), basic_autonomy::waypoint_generation::compute_fit(), carma_wm::geometry::compute_tangent_orientations(), config_, basic_autonomy::waypoint_generation::constrain_to_time_boundary(), stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::curvature_moving_average_window_size, stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::curve_resample_step_size, epsilon_, basic_autonomy::waypoint_generation::get_nearest_index_by_downtrack(), basic_autonomy::waypoint_generation::get_nearest_point_index(), stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::lateral_accel_limit, basic_autonomy::smoothing::moving_average_filter(), stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::speed_moving_average_window_size, basic_autonomy::waypoint_generation::split_point_speed_pairs(), basic_autonomy::waypoint_generation::trajectory_from_points_times_orientations(), stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::trajectory_time_length, and wm_.
Referenced by plan_trajectory_callback().
std::vector< PointSpeedPair > stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPlugin::create_case_one_speed_profile | ( | const carma_wm::WorldModelConstPtr & | wm, |
const carma_planning_msgs::msg::Maneuver & | maneuver, | ||
std::vector< lanelet::BasicPoint2d > & | route_geometry_points, | ||
double | starting_speed, | ||
const carma_planning_msgs::msg::VehicleState & | states | ||
) |
Creates a speed profile according to case one of the stop controlled intersection, where the vehicle accelerates and then decelerates to a stop.
wm | Pointer to intialized world model for semantic map access |
maneuvers | The maneuver to being planned for. Maneuver meta-dara parameters are used to create the trajectory profile. |
route_geometry_points | The geometry points along the route which are associated with a speed in this method. |
starting_speed | The current speed of the vehicle at the time of the trajectory planning request |
Definition at line 232 of file stop_controlled_intersection_tactical_plugin.cpp.
References epsilon_, process_bag::first_point, GET_MANEUVER_PROPERTY, process_bag::i, basic_autonomy::waypoint_generation::PointSpeedPair::point, and basic_autonomy::waypoint_generation::PointSpeedPair::speed.
Referenced by maneuvers_to_points().
std::vector< PointSpeedPair > stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPlugin::create_case_three_speed_profile | ( | const carma_wm::WorldModelConstPtr & | wm, |
const carma_planning_msgs::msg::Maneuver & | maneuver, | ||
std::vector< lanelet::BasicPoint2d > & | route_geometry_points, | ||
double | starting_speed | ||
) |
Creates a speed profile according to case three of the stop controlled intersection, where the vehicle continuously decelerates to a stop.
wm | Pointer to intialized world model for semantic map access |
maneuvers | The maneuver to being planned for. Maneuver meta-dara parameters are used to create the trajectory profile. |
route_geometry_points | The geometry points along the route which are associated with a speed in this method. |
starting_speed | The current speed of the vehicle at the time of the trajectory planning request |
Definition at line 420 of file stop_controlled_intersection_tactical_plugin.cpp.
References epsilon_, process_bag::first_point, GET_MANEUVER_PROPERTY, process_bag::i, basic_autonomy::waypoint_generation::PointSpeedPair::point, and basic_autonomy::waypoint_generation::PointSpeedPair::speed.
Referenced by maneuvers_to_points().
std::vector< PointSpeedPair > stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPlugin::create_case_two_speed_profile | ( | const carma_wm::WorldModelConstPtr & | wm, |
const carma_planning_msgs::msg::Maneuver & | maneuver, | ||
std::vector< lanelet::BasicPoint2d > & | route_geometry_points, | ||
double | starting_speed | ||
) |
Creates a speed profile according to case two of the stop controlled intersection, where the vehicle first accelerates then cruises and finally decelerates to a stop.
wm | Pointer to intialized world model for semantic map access |
maneuvers | The maneuver to being planned for. Maneuver meta-dara parameters are used to create the trajectory profile. |
route_geometry_points | The geometry points along the route which are associated with a speed in this method. |
starting_speed | The current speed of the vehicle at the time of the trajectory planning request |
Definition at line 319 of file stop_controlled_intersection_tactical_plugin.cpp.
References epsilon_, process_bag::first_point, GET_MANEUVER_PROPERTY, basic_autonomy::waypoint_generation::PointSpeedPair::point, and basic_autonomy::waypoint_generation::PointSpeedPair::speed.
Referenced by maneuvers_to_points().
|
private |
|
private |
|
private |
|
virtual |
Get the availability status of this plugin based on the current operating environment. Method must be overriden by extending classes.
Implements carma_guidance_plugins::PluginBaseNode.
Definition at line 602 of file stop_controlled_intersection_tactical_plugin.cpp.
|
virtual |
Returns the version id of this plugin.
Implements carma_guidance_plugins::PluginBaseNode.
Definition at line 607 of file stop_controlled_intersection_tactical_plugin.cpp.
std::vector< PointSpeedPair > stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPlugin::maneuvers_to_points | ( | const std::vector< carma_planning_msgs::msg::Maneuver > & | maneuvers, |
const carma_wm::WorldModelConstPtr & | wm, | ||
const carma_planning_msgs::msg::VehicleState & | state | ||
) |
Converts a set of requested stop controlled intersection maneuvers to point speed limit pairs.
maneuvers | The list of maneuvers to convert |
wm | Pointer to intialized world model for semantic map access |
state | The current state of the vehicle |
Definition at line 170 of file stop_controlled_intersection_tactical_plugin.cpp.
References stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::centerline_sampling_spacing, config_, create_case_one_speed_profile(), create_case_three_speed_profile(), create_case_two_speed_profile(), GET_MANEUVER_PROPERTY, and wm_.
Referenced by plan_trajectory_callback().
|
overridevirtual |
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.
Implements carma_guidance_plugins::PluginBaseNode.
Definition at line 86 of file stop_controlled_intersection_tactical_plugin.cpp.
References stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::back_distance, stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::centerline_sampling_spacing, config_, stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::curvature_moving_average_window_size, stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::curve_resample_step_size, carma_guidance_plugins::PluginBaseNode::get_world_model(), stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::lateral_accel_limit, parameter_update_callback(), stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::speed_moving_average_window_size, stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::trajectory_time_length, and wm_.
rcl_interfaces::msg::SetParametersResult stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPlugin::parameter_update_callback | ( | const std::vector< rclcpp::Parameter > & | parameters | ) |
Definition at line 64 of file stop_controlled_intersection_tactical_plugin.cpp.
References stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::back_distance, stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::centerline_sampling_spacing, config_, stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::curvature_moving_average_window_size, stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::curve_resample_step_size, stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::lateral_accel_limit, stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::speed_moving_average_window_size, and stop_controlled_intersection_tactical_plugin::StopControlledIntersectionTacticalPluginConfig::trajectory_time_length.
Referenced by on_configure_plugin().
|
overridevirtual |
Extending class provided callback which should return a planned trajectory based on the provided trajectory planning request.
srv_header | RCL header for services calls. Can usually be ignored by implementers. |
req | The service request containing the maneuvers to plan trajectories for and current vehicle state |
resp | The response containing the planned trajectory |
Implements carma_guidance_plugins::TacticalPlugin.
Definition at line 111 of file stop_controlled_intersection_tactical_plugin.cpp.
References compose_trajectory_from_centerline(), GET_MANEUVER_PROPERTY, carma_guidance_plugins::PluginBaseNode::get_plugin_name(), process_bag::i, maneuvers_to_points(), stop_controlled_intersection_strategy_, carma_cooperative_perception::to_string(), and wm_.
|
private |
Definition at line 158 of file stop_controlled_intersection_plugin.hpp.
Referenced by StopControlledIntersectionTacticalPlugin(), compose_trajectory_from_centerline(), maneuvers_to_points(), on_configure_plugin(), and parameter_update_callback().
|
private |
Definition at line 162 of file stop_controlled_intersection_plugin.hpp.
Referenced by compose_trajectory_from_centerline(), create_case_one_speed_profile(), create_case_three_speed_profile(), and create_case_two_speed_profile().
|
private |
Definition at line 160 of file stop_controlled_intersection_plugin.hpp.
Referenced by plan_trajectory_callback().
|
private |
Definition at line 157 of file stop_controlled_intersection_plugin.hpp.
Referenced by compose_trajectory_from_centerline(), maneuvers_to_points(), on_configure_plugin(), and plan_trajectory_callback().