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.
stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin Class Reference

#include <stop_and_dwell_strategic_plugin.hpp>

Inheritance diagram for stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin:
Inheritance graph
Collaboration diagram for stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin:
Collaboration graph

Public Member Functions

 StopAndDwellStrategicPlugin (const rclcpp::NodeOptions &)
 Default constructor for RouteFollowingPlugin class. More...
 
void plan_maneuvers_callback (std::shared_ptr< rmw_request_id_t > srv_header, carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr req, carma_planning_msgs::srv::PlanManeuvers::Response::SharedPtr resp)
 Service callback for arbitrator maneuver planning. More...
 
rcl_interfaces::msg::SetParametersResult parameter_update_callback (const std::vector< rclcpp::Parameter > &parameters)
 Callback for dynamic parameter updates. More...
 
void currentPoseCb (geometry_msgs::msg::PoseStamped::UniquePtr msg)
 callback function for current pose More...
 
carma_planning_msgs::msg::Maneuver composeLaneFollowingManeuverMessage (double start_dist, double end_dist, double start_speed, double target_speed, rclcpp::Time start_time, double time_to_stop, std::vector< lanelet::Id > lane_ids)
 Compose a lane keeping maneuver message based on input params. More...
 
carma_planning_msgs::msg::Maneuver composeStopAndWaitManeuverMessage (double current_dist, double end_dist, double start_speed, const lanelet::Id &starting_lane_id, const lanelet::Id &ending_lane_id, double stopping_accel, rclcpp::Time start_time, rclcpp::Time end_time) const
 
VehicleState extractInitialState (const carma_planning_msgs::srv::PlanManeuvers::Request &req) const
 Helper method to extract the initial vehicle state from the planning request method based on if the prior_plan was set or not. More...
 
std::vector< lanelet::ConstLanelet > getLaneletsBetweenWithException (double start_downtrack, double end_downtrack, bool shortest_path_only=false, bool bounds_inclusive=true) const
 Helper method which calls carma_wm::WorldModel::getLaneletsBetween(start_downtrack, end_downtrack, shortest_path_only, bounds_inclusive) and throws and exception if the returned list of lanelets is empty. See the referenced method for additional details on parameters. More...
 
double findSpeedLimit (const lanelet::ConstLanelet &llt) const
 Given a Lanelet, find it's associated Speed Limit. More...
 
void guidance_state_cb (const carma_planning_msgs::msg::GuidanceState::UniquePtr msg)
 Callback for the Guidance State. More...
 
VehicleState extractInitialState (carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr req) const
 Helper method to extract the initial vehicle state from the planning request method based on if the prior_plan was set or not. More...
 
carma_ros2_utils::CallbackReturn on_configure_plugin ()
 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...
 
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...
 
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...
 
- Public Member Functions inherited from carma_guidance_plugins::StrategicPlugin
 StrategicPlugin (const rclcpp::NodeOptions &)
 StrategicPlugin constructor. More...
 
virtual ~StrategicPlugin ()=default
 Virtual destructor for safe deletion. More...
 
virtual void plan_maneuvers_callback (std::shared_ptr< rmw_request_id_t > srv_header, carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr req, carma_planning_msgs::srv::PlanManeuvers::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

bool vehicle_engaged_ = false
 
double speed_limit_ = 100.0
 
double current_downtrack_ = 0.0
 
double bus_stop_downtrack_ = 0.0
 
bool first_stop_ = true
 
rclcpp::Time time_to_move_
 
std::string logger_name_ ="stop_and_dwell_strategic_plugin"
 
double max_comfort_accel_ = 2.0
 
double max_comfort_decel_ = -2.0
 
double max_comfort_decel_norm_ = -1 * max_comfort_decel_
 
bool approaching_stop_controlled_interction_ = false
 

Private Member Functions

carma_wm::WorldModelConstPtr get_wm ()
 
void set_wm (carma_wm::WorldModelConstPtr new_wm)
 
 FRIEND_TEST (StopAndDwellStrategicPluginTest, findSpeedLimit)
 
 FRIEND_TEST (StopAndDwellStrategicPluginTest, maneuvercbtest)
 

Private Attributes

carma_ros2_utils::SubPtr< geometry_msgs::msg::PoseStamped > current_pose_sub_
 
carma_ros2_utils::SubPtr< carma_planning_msgs::msg::GuidanceState > guidance_state_sub_
 
bool guidance_engaged_ = false
 
carma_wm::WorldModelConstPtr wm_
 World Model pointer. More...
 
StopAndDwellStrategicPluginConfig config_
 Config containing configurable algorithm parameters. More...
 

Detailed Description

Definition at line 51 of file stop_and_dwell_strategic_plugin.hpp.

Constructor & Destructor Documentation

◆ StopAndDwellStrategicPlugin()

stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::StopAndDwellStrategicPlugin ( const rclcpp::NodeOptions &  options)
explicit

Default constructor for RouteFollowingPlugin class.

Definition at line 58 of file stop_and_dwell_strategic_plugin.cpp.

59 : carma_guidance_plugins::StrategicPlugin(options), config_(StopAndDwellStrategicPluginConfig())
60{
61 // Declare parameters
62 config_.vehicle_decel_limit_multiplier = declare_parameter<double>("vehicle_decel_limit_multiplier", config_.vehicle_decel_limit_multiplier);
63 config_.vehicle_accel_limit_multiplier = declare_parameter<double>("vehicle_accel_limit_multiplier", config_.vehicle_accel_limit_multiplier);
64 config_.stop_line_buffer = declare_parameter<double>("stop_line_buffer", config_.stop_line_buffer);
65 config_.bus_line_exit_zone_length = declare_parameter<double>("bus_line_exit_zone_length", config_.bus_line_exit_zone_length);
66 config_.strategic_plugin_name = declare_parameter<std::string>("strategic_plugin_name", config_.strategic_plugin_name);
67 config_.lane_following_plugin_name = declare_parameter<std::string>("lane_following_plugin_name", config_.lane_following_plugin_name);
68 config_.vehicle_id = declare_parameter<std::string>("vehicle_id", config_.vehicle_id);
69 config_.veh_length = declare_parameter<double>("vehicle_length", config_.veh_length);
70 config_.vehicle_decel_limit = declare_parameter<double>("vehicle_deceleration_limit", config_.vehicle_decel_limit);
71 config_.vehicle_accel_limit = declare_parameter<double>("vehicle_acceleration_limit", config_.vehicle_accel_limit);
72 config_.activation_distance = declare_parameter<double>("activation_distance", config_.activation_distance);
73 config_.dwell_time = declare_parameter<double>("dwell_time", config_.dwell_time);
74 config_.deceleration_fraction = declare_parameter<double>("deceleration_fraction", config_.deceleration_fraction);
75 config_.desired_distance_to_stop_buffer = declare_parameter<double>("desired_distance_to_stop_buffer", config_.desired_distance_to_stop_buffer);
76
80};
StrategicPlugin base class which can be extended by user provided plugins which wish to implement the...
StopAndDwellStrategicPluginConfig config_
Config containing configurable algorithm parameters.
std::string strategic_plugin_name
The name to use for this plugin during comminications with the arbitrator.
double vehicle_decel_limit
The maximum allowable vehicle deceleration limit in m/s.
double deceleration_fraction
Double: Safety multiplier (must be less than 1.0) of planned allowable vehicle deceleration to use wh...
double vehicle_decel_limit_multiplier
A multiplier to apply to the maximum allowable vehicle deceleration limit so we plan under our capabi...
double desired_distance_to_stop_buffer
Double: Desired distance to stop buffer in meters.
double vehicle_accel_limit
The maximum allowable vehicle acceleration limit in m/s.
std::string lane_following_plugin_name
The name of the tactical plugin to use for Lane Following trajectory planning.
double stop_line_buffer
A buffer infront of the stopping location which will still be considered a valid stop.
double vehicle_accel_limit_multiplier
A multiplier to apply to the maximum allowable vehicle acceleration limit so we plan under our capabi...

References stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::activation_distance, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::bus_line_exit_zone_length, config_, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::deceleration_fraction, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::desired_distance_to_stop_buffer, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::dwell_time, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::lane_following_plugin_name, max_comfort_accel_, max_comfort_decel_, max_comfort_decel_norm_, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::stop_line_buffer, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::strategic_plugin_name, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::veh_length, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::vehicle_accel_limit, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::vehicle_accel_limit_multiplier, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::vehicle_decel_limit, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::vehicle_decel_limit_multiplier, and stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::vehicle_id.

Member Function Documentation

◆ composeLaneFollowingManeuverMessage()

carma_planning_msgs::msg::Maneuver stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::composeLaneFollowingManeuverMessage ( double  start_dist,
double  end_dist,
double  start_speed,
double  target_speed,
rclcpp::Time  start_time,
double  time_to_stop,
std::vector< lanelet::Id >  lane_ids 
)

Compose a lane keeping maneuver message based on input params.

Parameters
start_distStart downtrack distance of the current maneuver
end_distEnd downtrack distance of the current maneuver
start_speedStart speed of the current maneuver
target_speedTarget speed pf the current maneuver, usually it is the lanelet speed limit
start_timeThe starting time of the maneuver
end_timeThe ending time of the maneuver
lane_idsList of lanelet IDs that the current maneuver traverses. Message expects these to be contiguous and end to end
Returns
A lane keeping maneuver message which is ready to be published

Definition at line 346 of file stop_and_dwell_strategic_plugin.cpp.

350{
351 carma_planning_msgs::msg::Maneuver maneuver_msg;
352 carma_planning_msgs::msg::Maneuver empty_msg;
353 maneuver_msg.type = carma_planning_msgs::msg::Maneuver::LANE_FOLLOWING;
354 maneuver_msg.lane_following_maneuver.parameters.planning_strategic_plugin = config_.strategic_plugin_name;
355 maneuver_msg.lane_following_maneuver.parameters.presence_vector =
356 carma_planning_msgs::msg::ManeuverParameters::HAS_TACTICAL_PLUGIN;
357 maneuver_msg.lane_following_maneuver.parameters.negotiation_type = carma_planning_msgs::msg::ManeuverParameters::NO_NEGOTIATION;
358 maneuver_msg.lane_following_maneuver.parameters.planning_tactical_plugin = config_.lane_following_plugin_name;
359 maneuver_msg.lane_following_maneuver.start_dist = start_dist;
360 maneuver_msg.lane_following_maneuver.end_dist = end_dist;
361 maneuver_msg.lane_following_maneuver.start_speed = start_speed;
362 maneuver_msg.lane_following_maneuver.end_speed = target_speed;
363 maneuver_msg.lane_following_maneuver.start_time = start_time;
364 maneuver_msg.lane_following_maneuver.end_time = start_time + rclcpp::Duration(time_to_stop*1e9);
365 maneuver_msg.lane_following_maneuver.lane_ids =
366 lanelet::utils::transform(lane_ids, [](auto id) { return std::to_string(id); });
367
368 RCLCPP_INFO_STREAM(rclcpp::get_logger("stop_and_dwell_strategic_plugin"), "Creating lane follow start dist: " << start_dist << " end dist: " << end_dist);
369return maneuver_msg;
370}
auto to_string(const UtmZone &zone) -> std::string
Definition: utm_zone.cpp:21

References config_, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::lane_following_plugin_name, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::strategic_plugin_name, and carma_cooperative_perception::to_string().

Referenced by plan_maneuvers_callback().

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

◆ composeStopAndWaitManeuverMessage()

carma_planning_msgs::msg::Maneuver stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::composeStopAndWaitManeuverMessage ( double  current_dist,
double  end_dist,
double  start_speed,
const lanelet::Id &  starting_lane_id,
const lanelet::Id &  ending_lane_id,
double  stopping_accel,
rclcpp::Time  start_time,
rclcpp::Time  end_time 
) const

Definition at line 386 of file stop_and_dwell_strategic_plugin.cpp.

391{
392 carma_planning_msgs::msg::Maneuver maneuver_msg;
393 maneuver_msg.type = carma_planning_msgs::msg::Maneuver::STOP_AND_WAIT;
394 maneuver_msg.stop_and_wait_maneuver.parameters.planning_strategic_plugin = config_.strategic_plugin_name;
395 maneuver_msg.stop_and_wait_maneuver.parameters.presence_vector =
396 carma_planning_msgs::msg::ManeuverParameters::HAS_TACTICAL_PLUGIN | carma_planning_msgs::msg::ManeuverParameters::HAS_FLOAT_META_DATA;
397 maneuver_msg.stop_and_wait_maneuver.parameters.negotiation_type = carma_planning_msgs::msg::ManeuverParameters::NO_NEGOTIATION;
398 maneuver_msg.stop_and_wait_maneuver.parameters.planning_tactical_plugin = config_.stop_and_wait_plugin_name;
399 maneuver_msg.stop_and_wait_maneuver.start_speed = start_speed;
400 maneuver_msg.stop_and_wait_maneuver.start_dist = current_dist;
401 maneuver_msg.stop_and_wait_maneuver.end_dist = end_dist;
402 maneuver_msg.stop_and_wait_maneuver.start_time = start_time;
403 maneuver_msg.stop_and_wait_maneuver.end_time = end_time;
404 maneuver_msg.stop_and_wait_maneuver.starting_lane_id = std::to_string(starting_lane_id);
405 maneuver_msg.stop_and_wait_maneuver.ending_lane_id = std::to_string(ending_lane_id);
406 // Set the meta data for the stop location buffer
407 maneuver_msg.stop_and_wait_maneuver.parameters.float_valued_meta_data.push_back(config_.stop_line_buffer);
408 maneuver_msg.stop_and_wait_maneuver.parameters.float_valued_meta_data.push_back(stopping_accel);
409
410 RCLCPP_INFO_STREAM(rclcpp::get_logger("stop_and_dwell_strategic_plugin"), "Creating stop and wait start dist: " << current_dist << " end dist: " << end_dist);
411
412 return maneuver_msg;
413}
std::string stop_and_wait_plugin_name
The name of the plugin to use for stop and wait trajectory planning.

References config_, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::stop_and_wait_plugin_name, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::stop_line_buffer, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::strategic_plugin_name, and carma_cooperative_perception::to_string().

Referenced by plan_maneuvers_callback().

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

◆ currentPoseCb()

void stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::currentPoseCb ( geometry_msgs::msg::PoseStamped::UniquePtr  msg)

callback function for current pose

Parameters
msginput pose stamed msg

Definition at line 181 of file stop_and_dwell_strategic_plugin.cpp.

182{
183 geometry_msgs::msg::PoseStamped pose_msg = geometry_msgs::msg::PoseStamped(*msg.get());
185 {
186 lanelet::BasicPoint2d current_loc(pose_msg.pose.position.x, pose_msg.pose.position.y);
187 current_downtrack_ = wm_->routeTrackPos(current_loc).downtrack;
188 RCLCPP_DEBUG_STREAM(rclcpp::get_logger("stop_and_dwell_strategic_plugin"), "Downtrack from current pose: " << current_downtrack_);
189 }
190
191}

References current_downtrack_, vehicle_engaged_, and wm_.

Referenced by on_configure_plugin().

Here is the caller graph for this function:

◆ extractInitialState() [1/2]

VehicleState stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::extractInitialState ( carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr  req) const

Helper method to extract the initial vehicle state from the planning request method based on if the prior_plan was set or not.

Parameters
reqThe maneuver planning request to extract the vehicle state from
Returns
The extracted VehicleState

Definition at line 211 of file stop_and_dwell_strategic_plugin.cpp.

212{
213 VehicleState state;
214 if (!req->prior_plan.maneuvers.empty())
215 {
216 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(logger_name_), "Provided with initial plan...");
217 state.stamp = GET_MANEUVER_PROPERTY(req->prior_plan.maneuvers.back(), end_time);
218 state.downtrack = GET_MANEUVER_PROPERTY(req->prior_plan.maneuvers.back(), end_dist);
219 state.speed = getManeuverEndSpeed(req->prior_plan.maneuvers.back());
220 state.lane_id = getLaneletsBetweenWithException(state.downtrack, state.downtrack, true).front().id();
221 }
222 else
223 {
224 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(logger_name_), "No initial plan provided...");
225
226 state.stamp = rclcpp::Time(req->header.stamp, RCL_SYSTEM_TIME);
227 state.downtrack = req->veh_downtrack;
228 state.speed = req->veh_logitudinal_velocity;
229 state.lane_id = stoi(req->veh_lane_id);
230 }
231 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(logger_name_), "extractInitialState >>>> state.stamp: " << std::to_string(state.stamp.seconds()));
232 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(logger_name_), "extractInitialState >>>> state.downtrack : " << state.downtrack );
233 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(logger_name_), "extractInitialState >>>> state.speed: " << state.speed);
234 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(logger_name_), "extractInitialState >>>> state.lane_id: " << state.lane_id);
235
236 return state;
237}
std::vector< lanelet::ConstLanelet > getLaneletsBetweenWithException(double start_downtrack, double end_downtrack, bool shortest_path_only=false, bool bounds_inclusive=true) const
Helper method which calls carma_wm::WorldModel::getLaneletsBetween(start_downtrack,...
double getManeuverEndSpeed(const carma_planning_msgs::msg::Maneuver &mvr)
Anonymous function to extract maneuver end speed which can not be optained with GET_MANEUVER_PROPERY ...
#define GET_MANEUVER_PROPERTY(mvr, property)

References stop_and_dwell_strategic_plugin::VehicleState::downtrack, GET_MANEUVER_PROPERTY, getLaneletsBetweenWithException(), stop_and_dwell_strategic_plugin::anonymous_namespace{stop_and_dwell_strategic_plugin.cpp}::getManeuverEndSpeed(), stop_and_dwell_strategic_plugin::VehicleState::lane_id, logger_name_, stop_and_dwell_strategic_plugin::VehicleState::speed, stop_and_dwell_strategic_plugin::VehicleState::stamp, and carma_cooperative_perception::to_string().

Here is the call graph for this function:

◆ extractInitialState() [2/2]

VehicleState stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::extractInitialState ( const carma_planning_msgs::srv::PlanManeuvers::Request &  req) const

Helper method to extract the initial vehicle state from the planning request method based on if the prior_plan was set or not.

Parameters
reqThe maneuver planning request to extract the vehicle state from
Returns
The extracted VehicleState

Definition at line 147 of file stop_and_dwell_strategic_plugin.cpp.

148{
149 VehicleState state;
150 if (!req.prior_plan.maneuvers.empty())
151 {
152 RCLCPP_DEBUG_STREAM(rclcpp::get_logger("stop_and_dwell_strategic_plugin"), "Provided with initial plan...");
153 state.stamp = GET_MANEUVER_PROPERTY(req.prior_plan.maneuvers.back(), end_time);
154 state.speed = getManeuverEndSpeed(req.prior_plan.maneuvers.back());
155 state.downtrack = GET_MANEUVER_PROPERTY(req.prior_plan.maneuvers.back(), end_dist);
156 state.lane_id = getLaneletsBetweenWithException(state.downtrack, state.downtrack, true).front().id();
157 }
158 else
159 {
160 RCLCPP_DEBUG_STREAM(rclcpp::get_logger("stop_and_dwell_strategic_plugin"), "No initial plan provided...");
161
162 state.stamp = req.header.stamp;
163 state.downtrack = req.veh_downtrack;
164 state.speed = req.veh_logitudinal_velocity;
165 state.lane_id = stoi(req.veh_lane_id);
166 }
167
168 RCLCPP_DEBUG_STREAM(rclcpp::get_logger("stop_and_dwell_strategic_plugin"), "state.stamp: " << std::to_string(state.stamp.seconds()));
169 RCLCPP_DEBUG_STREAM(rclcpp::get_logger("stop_and_dwell_strategic_plugin"), "state.downtrack : " << state.downtrack );
170 RCLCPP_DEBUG_STREAM(rclcpp::get_logger("stop_and_dwell_strategic_plugin"), "state.speed: " << state.speed);
171 RCLCPP_DEBUG_STREAM(rclcpp::get_logger("stop_and_dwell_strategic_plugin"), "state.lane_id: " << state.lane_id);
172
173 return state;
174}

References stop_and_dwell_strategic_plugin::VehicleState::downtrack, GET_MANEUVER_PROPERTY, getLaneletsBetweenWithException(), stop_and_dwell_strategic_plugin::anonymous_namespace{stop_and_dwell_strategic_plugin.cpp}::getManeuverEndSpeed(), stop_and_dwell_strategic_plugin::VehicleState::lane_id, stop_and_dwell_strategic_plugin::VehicleState::speed, stop_and_dwell_strategic_plugin::VehicleState::stamp, and carma_cooperative_perception::to_string().

Referenced by plan_maneuvers_callback().

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

◆ findSpeedLimit()

double stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::findSpeedLimit ( const lanelet::ConstLanelet &  llt) const

Given a Lanelet, find it's associated Speed Limit.

Parameters
lltConstant Lanelet object
Exceptions
std::invalid_argumentif the speed limit could not be retrieved
Returns
value of speed limit in mps

Definition at line 373 of file stop_and_dwell_strategic_plugin.cpp.

374{
375 lanelet::Optional<carma_wm::TrafficRulesConstPtr> traffic_rules = wm_->getTrafficRules();
376 if (traffic_rules)
377 {
378 return (*traffic_rules)->speedLimit(llt).speedLimit.value();
379 }
380 else
381 {
382 throw std::invalid_argument("Valid traffic rules object could not be built");
383 }
384}

References wm_.

Referenced by plan_maneuvers_callback().

Here is the caller graph for this function:

◆ FRIEND_TEST() [1/2]

stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::FRIEND_TEST ( StopAndDwellStrategicPluginTest  ,
findSpeedLimit   
)
private

◆ FRIEND_TEST() [2/2]

stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::FRIEND_TEST ( StopAndDwellStrategicPluginTest  ,
maneuvercbtest   
)
private

◆ get_availability()

bool stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::get_availability ( )
virtual

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 415 of file stop_and_dwell_strategic_plugin.cpp.

416{
417 return true;
418}

◆ get_version_id()

std::string stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::get_version_id ( )
virtual

Returns the version id of this plugin.

Returns
The version id represented as a string

Implements carma_guidance_plugins::PluginBaseNode.

Definition at line 420 of file stop_and_dwell_strategic_plugin.cpp.

421{
422 return "v1.0";
423}

◆ get_wm()

carma_wm::WorldModelConstPtr stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::get_wm ( )
inlineprivate

Definition at line 196 of file stop_and_dwell_strategic_plugin.hpp.

196{ return wm_; }

References wm_.

◆ getLaneletsBetweenWithException()

std::vector< lanelet::ConstLanelet > stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::getLaneletsBetweenWithException ( double  start_downtrack,
double  end_downtrack,
bool  shortest_path_only = false,
bool  bounds_inclusive = true 
) const

Helper method which calls carma_wm::WorldModel::getLaneletsBetween(start_downtrack, end_downtrack, shortest_path_only, bounds_inclusive) and throws and exception if the returned list of lanelets is empty. See the referenced method for additional details on parameters.

Definition at line 193 of file stop_and_dwell_strategic_plugin.cpp.

197{
198 std::vector<lanelet::ConstLanelet> crossed_lanelets =
199 wm_->getLaneletsBetween(start_downtrack, end_downtrack, shortest_path_only, bounds_inclusive);
200
201 if (crossed_lanelets.empty())
202 {
203 throw std::invalid_argument("getLaneletsBetweenWithException called but inputs do not cross any lanelets going "
204 "from: " +
205 std::to_string(start_downtrack) + " to: " + std::to_string(end_downtrack));
206 }
207
208 return crossed_lanelets;
209}

References carma_cooperative_perception::to_string(), and wm_.

Referenced by extractInitialState(), and plan_maneuvers_callback().

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

◆ guidance_state_cb()

void stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::guidance_state_cb ( const carma_planning_msgs::msg::GuidanceState::UniquePtr  msg)

Callback for the Guidance State.

Parameters
msgLatest GuidanceState message

Definition at line 176 of file stop_and_dwell_strategic_plugin.cpp.

References lightbar_manager::ENGAGED, and guidance_engaged_.

Referenced by on_configure_plugin().

Here is the caller graph for this function:

◆ on_activate_plugin()

carma_ros2_utils::CallbackReturn stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::on_activate_plugin ( )
virtual

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.

Returns
SUCCESS, FAILURE, or ERROR. Transition to ACTIVE will only complete on SUCCESS.

Reimplemented from carma_guidance_plugins::PluginBaseNode.

Definition at line 142 of file stop_and_dwell_strategic_plugin.cpp.

143{
144 return CallbackReturn::SUCCESS;
145}

◆ on_configure_plugin()

carma_ros2_utils::CallbackReturn stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::on_configure_plugin ( )
virtual

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.

Returns
SUCCESS, FAILURE, or ERROR. Transition to INACTIVE will only complete on SUCCESS.

Implements carma_guidance_plugins::PluginBaseNode.

Definition at line 82 of file stop_and_dwell_strategic_plugin.cpp.

83{
84 // reset config
85 config_ = StopAndDwellStrategicPluginConfig();
86 // Declare parameters
87 get_parameter<double>("vehicle_decel_limit_multiplier", config_.vehicle_decel_limit_multiplier);
88 get_parameter<double>("vehicle_accel_limit_multiplier", config_.vehicle_accel_limit_multiplier);
89 get_parameter<double>("stop_line_buffer", config_.stop_line_buffer);
90 get_parameter<double>("bus_line_exit_zone_length", config_.bus_line_exit_zone_length);
91 get_parameter<std::string>("strategic_plugin_name", config_.strategic_plugin_name);
92 get_parameter<std::string>("lane_following_plugin_name", config_.lane_following_plugin_name);
93 get_parameter<std::string>("vehicle_id", config_.vehicle_id);
94 get_parameter<double>("vehicle_length", config_.veh_length);
95 get_parameter<double>("vehicle_deceleration_limit", config_.vehicle_decel_limit);
96 get_parameter<double>("vehicle_acceleration_limit", config_.vehicle_accel_limit);
97 get_parameter<double>("activation_distance", config_.activation_distance);
98 get_parameter<double>("dwell_time", config_.dwell_time);
99 get_parameter<double>("deceleration_fraction", config_.deceleration_fraction);
100 get_parameter<double>("desired_distance_to_stop_buffer", config_.desired_distance_to_stop_buffer);
101
105
106 // Register runtime parameter update callback
107 add_on_set_parameters_callback(std::bind(&StopAndDwellStrategicPlugin::parameter_update_callback, this, std_ph::_1));
108
109 RCLCPP_INFO_STREAM(rclcpp::get_logger("stop_and_dwell_strategic_plugin"),"Done loading parameters: " << config_);
110
111 // Current Pose Subscriber
112 current_pose_sub_ = create_subscription<geometry_msgs::msg::PoseStamped>("current_pose", 1,
113 std::bind(&StopAndDwellStrategicPlugin::currentPoseCb,this,std_ph::_1));
114
115 // Guidance State subscriber
116 guidance_state_sub_ = create_subscription<carma_planning_msgs::msg::GuidanceState>("guidance_state", 5,
117 std::bind(&StopAndDwellStrategicPlugin::guidance_state_cb, this, std::placeholders::_1));
118
119 // set world model point form wm listener
121
122 // Return success if everthing initialized successfully
123 return CallbackReturn::SUCCESS;
124}
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 guidance_state_cb(const carma_planning_msgs::msg::GuidanceState::UniquePtr msg)
Callback for the Guidance State.
rcl_interfaces::msg::SetParametersResult parameter_update_callback(const std::vector< rclcpp::Parameter > &parameters)
Callback for dynamic parameter updates.
carma_ros2_utils::SubPtr< carma_planning_msgs::msg::GuidanceState > guidance_state_sub_
void currentPoseCb(geometry_msgs::msg::PoseStamped::UniquePtr msg)
callback function for current pose
carma_ros2_utils::SubPtr< geometry_msgs::msg::PoseStamped > current_pose_sub_

References stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::activation_distance, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::bus_line_exit_zone_length, config_, current_pose_sub_, currentPoseCb(), stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::deceleration_fraction, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::desired_distance_to_stop_buffer, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::dwell_time, carma_guidance_plugins::PluginBaseNode::get_world_model(), guidance_state_cb(), guidance_state_sub_, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::lane_following_plugin_name, max_comfort_accel_, max_comfort_decel_, max_comfort_decel_norm_, parameter_update_callback(), stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::stop_line_buffer, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::strategic_plugin_name, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::veh_length, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::vehicle_accel_limit, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::vehicle_accel_limit_multiplier, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::vehicle_decel_limit, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::vehicle_decel_limit_multiplier, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::vehicle_id, and wm_.

Here is the call graph for this function:

◆ parameter_update_callback()

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

Callback for dynamic parameter updates.

Definition at line 126 of file stop_and_dwell_strategic_plugin.cpp.

127{
128 auto error_double = update_params<double>({
129 {"vehicle_decel_limit_multiplier", config_.vehicle_decel_limit_multiplier},
130 {"vehicle_accel_limit_multiplier", config_.vehicle_accel_limit_multiplier},
131 {"stop_line_buffer", config_.stop_line_buffer},
132 {"bus_line_exit_zone_length", config_.bus_line_exit_zone_length}
133 }, parameters); // vehicle_acceleration_limit not updated as it's global param
134
135 rcl_interfaces::msg::SetParametersResult result;
136
137 result.successful = !error_double;
138
139 return result;
140}

References stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::bus_line_exit_zone_length, config_, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::stop_line_buffer, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::vehicle_accel_limit_multiplier, and stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::vehicle_decel_limit_multiplier.

Referenced by on_configure_plugin().

Here is the caller graph for this function:

◆ plan_maneuvers_callback()

void stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::plan_maneuvers_callback ( std::shared_ptr< rmw_request_id_t >  srv_header,
carma_planning_msgs::srv::PlanManeuvers::Request::SharedPtr  req,
carma_planning_msgs::srv::PlanManeuvers::Response::SharedPtr  resp 
)
virtual

Service callback for arbitrator maneuver planning.

Parameters
reqPlan maneuver request
respPlan maneuver response with a list of maneuver plan
Returns
If service call successed

Implements carma_guidance_plugins::StrategicPlugin.

Definition at line 239 of file stop_and_dwell_strategic_plugin.cpp.

243{
244 std::chrono::system_clock::time_point execution_start_time = std::chrono::system_clock::now(); // Start timing the execution time for planning so it can be logged
245
246 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(logger_name_), "<<<<<<<<<<<<<<<<< STARTING STOP_AND_DWELL_STRATEGIC_PLUIGN!!!!!!!!! >>>>>>>>>>>>>>>>");
247
248 if (!wm_->getRoute())
249 {
250 RCLCPP_ERROR_STREAM(rclcpp::get_logger(logger_name_), "Could not plan maneuvers as route was not available");
251 return;
252 }
253
254 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(logger_name_), "Finding car information");
255
256 // Extract vehicle data from request
257 VehicleState current_state = extractInitialState(req);
258
259 auto bus_stop_list = wm_->getBusStopsAlongRoute({ req->veh_x, req->veh_y });
260
261 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(logger_name_), "Found bus stops of size: " << bus_stop_list .size());
262
263 if(bus_stop_list.empty())
264 {
265 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(logger_name_), "Bus stops list is empty");
266 return;
267 }
268
269 lanelet::BusStopRulePtr nearest_bus_stop = bus_stop_list.front();
270
271 double bus_stop_downtrack_ = wm_->routeTrackPos(nearest_bus_stop->stopAndWaitLine().front().front().basicPoint2d()).downtrack;
272 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(logger_name_), "bus_stop_downtrack_ : " << bus_stop_downtrack_ );
273 double distance_remaining_to_bus_stop = bus_stop_downtrack_ - current_state.downtrack;
274 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(logger_name_), "distance_remaining_to_bus_stop: " << distance_remaining_to_bus_stop <<
275 ", current_state.downtrack: " << current_state.downtrack);
276
277 if (distance_remaining_to_bus_stop < -config_.bus_line_exit_zone_length)
278 {
279 resp->new_plan.maneuvers = {};
280 RCLCPP_WARN_STREAM(rclcpp::get_logger(logger_name_), "Already passed bus stop, sending empty maneuvers");
281 return;
282 }
283
284 constexpr double HALF_MPH_IN_MPS = 0.22352;
285
286 if (current_state.speed < HALF_MPH_IN_MPS && fabs(bus_stop_downtrack_ - current_state.downtrack ) < config_.stop_line_buffer)
287 {
288 if(first_stop_)
289 {
290 time_to_move_ = now() + rclcpp::Duration(config_.dwell_time * 1e9);
291 first_stop_ = false;
292 }
293
294 if(time_to_move_ <= now())
295 {
296 std::vector<lanelet::ConstLanelet> crossed_lanelets = getLaneletsBetweenWithException(current_state.downtrack, bus_stop_downtrack_, true, true);
297 auto starting_lane_id = crossed_lanelets.front().id();
298 auto ending_lane_id = crossed_lanelets.back().id();
299 resp->new_plan.maneuvers.push_back(composeStopAndWaitManeuverMessage(current_state.downtrack ,bus_stop_downtrack_,current_state.speed,starting_lane_id,ending_lane_id,max_comfort_decel_norm_ ,now(),now() + rclcpp::Duration(config_.min_maneuver_planning_period * 1e9) ));
300 }
301 else
302 {
303 double maneuver_end_distance = bus_stop_downtrack_ + config_.bus_line_exit_zone_length;
304 std::vector<lanelet::ConstLanelet> crossed_lanelets = getLaneletsBetweenWithException(current_state.downtrack, maneuver_end_distance, true, true);
305 std::vector<lanelet::Id> lane_ids = lanelet::utils::transform(crossed_lanelets, [](const auto& ll) { return ll.id(); });
306 speed_limit_ = findSpeedLimit(crossed_lanelets.front());
307 resp->new_plan.maneuvers.push_back(composeLaneFollowingManeuverMessage(current_state.downtrack ,maneuver_end_distance,current_state.speed,speed_limit_,now(),config_.min_maneuver_planning_period,lane_ids));
308 }
309 }
310 else if ( current_state.downtrack>= ( bus_stop_downtrack_ - config_.activation_distance ))
311 {
312 double desired_distance_to_stop = pow(current_state.speed, 2)/(2 * max_comfort_decel_norm_ * config_.deceleration_fraction) + config_.desired_distance_to_stop_buffer;
313
314 if(current_state.downtrack >= ( bus_stop_downtrack_ - desired_distance_to_stop))
315 {
316 std::vector<lanelet::ConstLanelet> crossed_lanelets = getLaneletsBetweenWithException(current_state.downtrack, bus_stop_downtrack_, true, true);
317 auto starting_lane_id = crossed_lanelets.front().id();
318 auto ending_lane_id = crossed_lanelets.back().id();
319 rclcpp::Time start_time = now();
320 rclcpp::Time end_time = now() + rclcpp::Duration(config_.min_maneuver_planning_period * 1e9) ;
321 //Stop at desired distance before bus stop
322 resp->new_plan.maneuvers.push_back(composeStopAndWaitManeuverMessage(current_state.downtrack ,bus_stop_downtrack_,current_state.speed,starting_lane_id,ending_lane_id,max_comfort_decel_norm_ ,start_time,end_time));
323 }
324 else
325 {
326 double time_to_stop = (distance_remaining_to_bus_stop - desired_distance_to_stop)/speed_limit_;
327 rclcpp::Time timestamp_to_stop = now() + rclcpp::Duration(time_to_stop * 1e9);
328 std::vector<lanelet::ConstLanelet> crossed_lanelets = getLaneletsBetweenWithException(current_state.downtrack, (bus_stop_downtrack_ - desired_distance_to_stop) , true, true);
329 std::vector<lanelet::ConstLanelet> crossed_lanelets_stop = getLaneletsBetweenWithException((bus_stop_downtrack_ - desired_distance_to_stop), bus_stop_downtrack_, true, true);
330 std::vector<lanelet::Id> lane_ids = lanelet::utils::transform(crossed_lanelets, [](const auto& ll) { return ll.id(); });
331
332 auto starting_lane_id = crossed_lanelets_stop.front().id();
333 auto ending_lane_id = crossed_lanelets_stop.back().id();
334
335 resp->new_plan.maneuvers.push_back(composeLaneFollowingManeuverMessage(current_state.downtrack ,(bus_stop_downtrack_ - desired_distance_to_stop),current_state.speed,speed_limit_,now(), time_to_stop,lane_ids));
336 resp->new_plan.maneuvers.push_back(composeStopAndWaitManeuverMessage((bus_stop_downtrack_ - desired_distance_to_stop),bus_stop_downtrack_,speed_limit_,starting_lane_id,ending_lane_id,max_comfort_decel_norm_ ,timestamp_to_stop ,(timestamp_to_stop + rclcpp::Duration(config_.min_maneuver_planning_period * 1e9))));
337 }
338 }
339 std::chrono::system_clock::time_point execution_end_time = std::chrono::system_clock::now(); // Planning complete
340
341 auto execution_duration = execution_end_time - execution_start_time;
342 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(logger_name_), "ExecutionTime stop_and_dwell_strategic_plugin: " << std::chrono::duration<double>(execution_duration).count());
343 return;
344}
carma_planning_msgs::msg::Maneuver composeStopAndWaitManeuverMessage(double current_dist, double end_dist, double start_speed, const lanelet::Id &starting_lane_id, const lanelet::Id &ending_lane_id, double stopping_accel, rclcpp::Time start_time, rclcpp::Time end_time) const
double findSpeedLimit(const lanelet::ConstLanelet &llt) const
Given a Lanelet, find it's associated Speed Limit.
VehicleState extractInitialState(const carma_planning_msgs::srv::PlanManeuvers::Request &req) const
Helper method to extract the initial vehicle state from the planning request method based on if the p...
carma_planning_msgs::msg::Maneuver composeLaneFollowingManeuverMessage(double start_dist, double end_dist, double start_speed, double target_speed, rclcpp::Time start_time, double time_to_stop, std::vector< lanelet::Id > lane_ids)
Compose a lane keeping maneuver message based on input params.
double min_maneuver_planning_period
The minimum period in seconds which a maneuver plan must cover if the plugin wishes to control the wh...

References stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::activation_distance, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::bus_line_exit_zone_length, bus_stop_downtrack_, composeLaneFollowingManeuverMessage(), composeStopAndWaitManeuverMessage(), config_, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::deceleration_fraction, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::desired_distance_to_stop_buffer, stop_and_dwell_strategic_plugin::VehicleState::downtrack, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::dwell_time, extractInitialState(), findSpeedLimit(), first_stop_, getLaneletsBetweenWithException(), logger_name_, max_comfort_decel_norm_, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::min_maneuver_planning_period, stop_and_dwell_strategic_plugin::VehicleState::speed, speed_limit_, stop_and_dwell_strategic_plugin::StopAndDwellStrategicPluginConfig::stop_line_buffer, time_to_move_, and wm_.

Here is the call graph for this function:

◆ set_wm()

void stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::set_wm ( carma_wm::WorldModelConstPtr  new_wm)
inlineprivate

Definition at line 197 of file stop_and_dwell_strategic_plugin.hpp.

197{ wm_ = new_wm; }

References wm_.

Member Data Documentation

◆ approaching_stop_controlled_interction_

bool stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::approaching_stop_controlled_interction_ = false

Definition at line 180 of file stop_and_dwell_strategic_plugin.hpp.

◆ bus_stop_downtrack_

double stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::bus_stop_downtrack_ = 0.0

Definition at line 171 of file stop_and_dwell_strategic_plugin.hpp.

Referenced by plan_maneuvers_callback().

◆ config_

StopAndDwellStrategicPluginConfig stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::config_
private

◆ current_downtrack_

double stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::current_downtrack_ = 0.0

Definition at line 169 of file stop_and_dwell_strategic_plugin.hpp.

Referenced by currentPoseCb().

◆ current_pose_sub_

carma_ros2_utils::SubPtr<geometry_msgs::msg::PoseStamped> stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::current_pose_sub_
private

Definition at line 184 of file stop_and_dwell_strategic_plugin.hpp.

Referenced by on_configure_plugin().

◆ first_stop_

bool stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::first_stop_ = true

Definition at line 172 of file stop_and_dwell_strategic_plugin.hpp.

Referenced by plan_maneuvers_callback().

◆ guidance_engaged_

bool stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::guidance_engaged_ = false
private

Definition at line 187 of file stop_and_dwell_strategic_plugin.hpp.

Referenced by guidance_state_cb().

◆ guidance_state_sub_

carma_ros2_utils::SubPtr<carma_planning_msgs::msg::GuidanceState> stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::guidance_state_sub_
private

Definition at line 185 of file stop_and_dwell_strategic_plugin.hpp.

Referenced by on_configure_plugin().

◆ logger_name_

std::string stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::logger_name_ ="stop_and_dwell_strategic_plugin"

◆ max_comfort_accel_

double stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::max_comfort_accel_ = 2.0

◆ max_comfort_decel_

double stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::max_comfort_decel_ = -2.0

◆ max_comfort_decel_norm_

double stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::max_comfort_decel_norm_ = -1 * max_comfort_decel_

◆ speed_limit_

double stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::speed_limit_ = 100.0

Definition at line 166 of file stop_and_dwell_strategic_plugin.hpp.

Referenced by plan_maneuvers_callback().

◆ time_to_move_

rclcpp::Time stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::time_to_move_

Definition at line 173 of file stop_and_dwell_strategic_plugin.hpp.

Referenced by plan_maneuvers_callback().

◆ vehicle_engaged_

bool stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::vehicle_engaged_ = false

Definition at line 163 of file stop_and_dwell_strategic_plugin.hpp.

Referenced by currentPoseCb().

◆ wm_

carma_wm::WorldModelConstPtr stop_and_dwell_strategic_plugin::StopAndDwellStrategicPlugin::wm_
private

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