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.
|
#include <sci_strategic_plugin.hpp>
Classes | |
struct | VehicleState |
Struct representing a vehicle state for the purposes of planning. More... | |
Public Member Functions | |
SCIStrategicPlugin (const rclcpp::NodeOptions &) | |
Default constructor for RouteFollowingPlugin class. More... | |
void | publishMobilityOperation () |
Method to publish mobility operation msgs at a fixed rate of 10hz if approaching intersection. 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 > ¶meters) |
Callback for dynamic parameter updates. More... | |
void | mobilityOperationCb (carma_v2x_msgs::msg::MobilityOperation::UniquePtr msg) |
callback function for mobility operation More... | |
void | currentPoseCb (geometry_msgs::msg::PoseStamped::UniquePtr msg) |
callback function for current pose More... | |
carma_planning_msgs::msg::Maneuver | composeLaneFollowingManeuverMessage (int case_num, 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 |
carma_planning_msgs::msg::Maneuver | composeIntersectionTransitMessage (double start_dist, double end_dist, double start_speed, double target_speed, rclcpp::Time start_time, rclcpp::Time end_time, TurnDirection turn_direction, const lanelet::Id &starting_lane_id, const lanelet::Id &ending_lane_id) 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... | |
int | determine_speed_profile_case (double stop_dist, double current_speed, double schedule_stop_time, double speed_limit) |
Determine the speed profile case fpr approaching an intersection. More... | |
double | calc_speed_before_decel (double stop_time, double stop_dist, double current_speed) const |
calculate the speed, right before the car starts to decelerate for stopping More... | |
void | parseStrategyParams (const std::string &strategy_params) |
parse strategy parameters More... | |
double | calcEstimatedStopTime (double stop_dist, double current_speed) const |
calculate the time vehicle will stop with optimal decelarion More... | |
void | caseOneSpeedProfile (double speed_before_decel, double current_speed, double stop_time, std::vector< double > *float_metadata_list) const |
Determine the desired speed profile parameters for Case 1. More... | |
void | caseTwoSpeedProfile (double stop_dist, double speed_before_decel, double current_speed, double stop_time, double speed_limit, std::vector< double > *float_metadata_list) const |
Determine the desired speed profile parameters for Case 2. More... | |
double | caseThreeSpeedProfile (double stop_dist, double current_speed, double stop_time) const |
Determine the desired speed profile parameters for Case 3. More... | |
carma_v2x_msgs::msg::MobilityOperation | generateMobilityOperation () |
Generates Mobility Operation messages. More... | |
void | BSMCb (carma_v2x_msgs::msg::BSM::UniquePtr msg) |
BSM callback function. More... | |
void | guidance_state_cb (const carma_planning_msgs::msg::GuidanceState::UniquePtr msg) |
Callback for the Guidance State. More... | |
TurnDirection | getTurnDirectionAtIntersection (std::vector< lanelet::ConstLanelet > lanelets_list) |
Determine the turn direction at intersection. 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::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) | |
Public Attributes | |
unsigned long long | street_msg_timestamp_ = 0 |
unsigned long long | scheduled_stop_time_ = 0 |
unsigned long long | scheduled_enter_time_ = 0 |
unsigned long long | scheduled_depart_time_ = 0 |
uint32_t | scheduled_departure_position_ = std::numeric_limits<uint32_t>::max() |
bool | is_allowed_int_ = false |
TurnDirection | intersection_turn_direction_ = TurnDirection::Straight |
bool | vehicle_engaged_ = false |
double | speed_limit_ = 100.0 |
double | current_downtrack_ = 0.0 |
bool | approaching_stop_controlled_interction_ = false |
std::string | bsm_id_ = "default_bsm_id" |
uint8_t | bsm_msg_count_ = 0 |
uint16_t | bsm_sec_mark_ = 0 |
Private Member Functions | |
carma_wm::WorldModelConstPtr | get_wm () |
void | set_wm (carma_wm::WorldModelConstPtr new_wm) |
FRIEND_TEST (SCIStrategicPluginTest, findSpeedLimit) | |
FRIEND_TEST (SCIStrategicPluginTest, moboperationcbtest) | |
FRIEND_TEST (SCIStrategicPluginTest, parseStrategyParamstest) | |
FRIEND_TEST (SCIStrategicPluginTest, calcEstimatedStopTimetest) | |
FRIEND_TEST (SCIStrategicPluginTest, calc_speed_before_deceltest) | |
FRIEND_TEST (SCIStrategicPluginTest, determine_speed_profile_casetest) | |
FRIEND_TEST (SCIStrategicPluginTest, caseOneSpeedProfiletest) | |
FRIEND_TEST (SCIStrategicPluginTest, caseTwoSpeedProfiletest) | |
FRIEND_TEST (SCIStrategicPluginTest, caseThreeSpeedProfiletest) | |
FRIEND_TEST (SCIStrategicPluginTest, testIntersectionturndirection) | |
FRIEND_TEST (SCIStrategicPluginTest, DISABLED_maneuvercbtest) | |
FRIEND_TEST (SCIStrategicPluginTest, maneuvercbtest) | |
Private Attributes | |
carma_ros2_utils::SubPtr< carma_v2x_msgs::msg::MobilityOperation > | mob_operation_sub_ |
carma_ros2_utils::SubPtr< geometry_msgs::msg::PoseStamped > | current_pose_sub_ |
carma_ros2_utils::SubPtr< carma_v2x_msgs::msg::BSM > | bsm_sub_ |
carma_ros2_utils::PubPtr< carma_v2x_msgs::msg::MobilityOperation > | mobility_operation_pub_ |
carma_ros2_utils::SubPtr< carma_planning_msgs::msg::GuidanceState > | guidance_state_sub_ |
bool | guidance_engaged_ = false |
rclcpp::TimerBase::SharedPtr | mob_op_pub_timer_ |
carma_wm::WorldModelConstPtr | wm_ |
World Model pointer. More... | |
SCIStrategicPluginConfig | config_ |
Config containing configurable algorithm parameters. More... | |
boost::optional< double > | intersection_speed_ |
Cache variables for storing the current intersection state between state machine transitions. More... | |
boost::optional< double > | intersection_end_downtrack_ |
std::string | stop_controlled_intersection_strategy_ = "Carma/stop_controlled_intersection" |
std::string | previous_strategy_params_ = "" |
Definition at line 48 of file sci_strategic_plugin.hpp.
|
explicit |
Default constructor for RouteFollowingPlugin class.
Definition at line 70 of file sci_strategic_plugin.cpp.
References config_, sci_strategic_plugin::SCIStrategicPluginConfig::delta_t, sci_strategic_plugin::SCIStrategicPluginConfig::intersection_exit_zone_length, sci_strategic_plugin::SCIStrategicPluginConfig::intersection_transit_plugin_name, sci_strategic_plugin::SCIStrategicPluginConfig::lane_following_plugin_name, sci_strategic_plugin::SCIStrategicPluginConfig::min_gap, sci_strategic_plugin::SCIStrategicPluginConfig::reaction_time, sci_strategic_plugin::SCIStrategicPluginConfig::stop_line_buffer, sci_strategic_plugin::SCIStrategicPluginConfig::strategic_plugin_name, sci_strategic_plugin::SCIStrategicPluginConfig::veh_length, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_accel_limit, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_accel_limit_multiplier, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_decel_limit, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_decel_limit_multiplier, and sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_id.
void sci_strategic_plugin::SCIStrategicPlugin::BSMCb | ( | carma_v2x_msgs::msg::BSM::UniquePtr | msg | ) |
BSM callback function.
Definition at line 218 of file sci_strategic_plugin.cpp.
References bsm_id_, bsm_msg_count_, and bsm_sec_mark_.
Referenced by on_configure_plugin().
double sci_strategic_plugin::SCIStrategicPlugin::calc_speed_before_decel | ( | double | stop_time, |
double | stop_dist, | ||
double | current_speed | ||
) | const |
calculate the speed, right before the car starts to decelerate for stopping
stop_time | time the vehicle must stop |
stop_dist | distance to stop line |
current_speed | current speed of vehicle |
Definition at line 315 of file sci_strategic_plugin.cpp.
References config_, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_accel_limit, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_accel_limit_multiplier, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_decel_limit, and sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_decel_limit_multiplier.
Referenced by composeLaneFollowingManeuverMessage(), and determine_speed_profile_case().
double sci_strategic_plugin::SCIStrategicPlugin::calcEstimatedStopTime | ( | double | stop_dist, |
double | current_speed | ||
) | const |
calculate the time vehicle will stop with optimal decelarion
stop_dist | distance to stop line |
current_speed | current speed of vehicle |
Definition at line 307 of file sci_strategic_plugin.cpp.
Referenced by determine_speed_profile_case().
void sci_strategic_plugin::SCIStrategicPlugin::caseOneSpeedProfile | ( | double | speed_before_decel, |
double | current_speed, | ||
double | stop_time, | ||
std::vector< double > * | float_metadata_list | ||
) | const |
Determine the desired speed profile parameters for Case 1.
speed_before_decel | vehicle speed before it starts to decelerate |
current_speed | current speed of vehicle |
stop_time | time duration to stop in s |
float_metadata_list | metadata vector for storing speed profile parameters |
Definition at line 652 of file sci_strategic_plugin.cpp.
References config_, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_accel_limit, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_accel_limit_multiplier, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_decel_limit, and sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_decel_limit_multiplier.
Referenced by composeLaneFollowingManeuverMessage().
double sci_strategic_plugin::SCIStrategicPlugin::caseThreeSpeedProfile | ( | double | stop_dist, |
double | current_speed, | ||
double | stop_time | ||
) | const |
Determine the desired speed profile parameters for Case 3.
stop_dist | distance to stop line |
current_speed | current speed of vehicle |
stop_time | time duration to stop in s |
Definition at line 724 of file sci_strategic_plugin.cpp.
References config_, and sci_strategic_plugin::SCIStrategicPluginConfig::delta_t.
Referenced by plan_maneuvers_callback().
void sci_strategic_plugin::SCIStrategicPlugin::caseTwoSpeedProfile | ( | double | stop_dist, |
double | speed_before_decel, | ||
double | current_speed, | ||
double | stop_time, | ||
double | speed_limit, | ||
std::vector< double > * | float_metadata_list | ||
) | const |
Determine the desired speed profile parameters for Case 2.
stop_dist | distance to stop line |
speed_before_decel | vehicle speed before it starts to decelerate |
current_speed | current speed of vehicle |
stop_time | time duration to stop in s |
float_metadata_list | metadata vector for storing speed profile parameters |
Definition at line 680 of file sci_strategic_plugin.cpp.
References config_, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_accel_limit, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_accel_limit_multiplier, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_decel_limit, and sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_decel_limit_multiplier.
Referenced by composeLaneFollowingManeuverMessage().
carma_planning_msgs::msg::Maneuver sci_strategic_plugin::SCIStrategicPlugin::composeIntersectionTransitMessage | ( | double | start_dist, |
double | end_dist, | ||
double | start_speed, | ||
double | target_speed, | ||
rclcpp::Time | start_time, | ||
rclcpp::Time | end_time, | ||
TurnDirection | turn_direction, | ||
const lanelet::Id & | starting_lane_id, | ||
const lanelet::Id & | ending_lane_id | ||
) | const |
Definition at line 858 of file sci_strategic_plugin.cpp.
References config_, sci_strategic_plugin::SCIStrategicPluginConfig::intersection_transit_plugin_name, sci_strategic_plugin::Left, sci_strategic_plugin::Right, sci_strategic_plugin::SCIStrategicPluginConfig::strategic_plugin_name, and carma_cooperative_perception::to_string().
Referenced by plan_maneuvers_callback().
carma_planning_msgs::msg::Maneuver sci_strategic_plugin::SCIStrategicPlugin::composeLaneFollowingManeuverMessage | ( | int | case_num, |
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.
start_dist | Start downtrack distance of the current maneuver |
end_dist | End downtrack distance of the current maneuver |
start_speed | Start speed of the current maneuver |
target_speed | Target speed pf the current maneuver, usually it is the lanelet speed limit |
start_time | The starting time of the maneuver |
end_time | The ending time of the maneuver |
lane_ids | List of lanelet IDs that the current maneuver traverses. Message expects these to be contiguous and end to end |
Definition at line 731 of file sci_strategic_plugin.cpp.
References calc_speed_before_decel(), caseOneSpeedProfile(), caseTwoSpeedProfile(), config_, sci_strategic_plugin::SCIStrategicPluginConfig::lane_following_plugin_name, speed_limit_, stop_controlled_intersection_strategy_, sci_strategic_plugin::SCIStrategicPluginConfig::strategic_plugin_name, and carma_cooperative_perception::to_string().
Referenced by plan_maneuvers_callback().
carma_planning_msgs::msg::Maneuver sci_strategic_plugin::SCIStrategicPlugin::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 829 of file sci_strategic_plugin.cpp.
References config_, sci_strategic_plugin::SCIStrategicPluginConfig::stop_and_wait_plugin_name, sci_strategic_plugin::SCIStrategicPluginConfig::stop_line_buffer, sci_strategic_plugin::SCIStrategicPluginConfig::strategic_plugin_name, and carma_cooperative_perception::to_string().
Referenced by plan_maneuvers_callback().
void sci_strategic_plugin::SCIStrategicPlugin::currentPoseCb | ( | geometry_msgs::msg::PoseStamped::UniquePtr | msg | ) |
callback function for current pose
msg | input pose stamed msg |
Definition at line 231 of file sci_strategic_plugin.cpp.
References current_downtrack_, vehicle_engaged_, and wm_.
Referenced by on_configure_plugin().
int sci_strategic_plugin::SCIStrategicPlugin::determine_speed_profile_case | ( | double | stop_dist, |
double | current_speed, | ||
double | schedule_stop_time, | ||
double | speed_limit | ||
) |
Determine the speed profile case fpr approaching an intersection.
stop_dist | distance to stop line |
current_speed | current speed of vehicle |
schedule_stop_time | scheduled stop time |
speed_limit | speed limit |
Definition at line 280 of file sci_strategic_plugin.cpp.
References calc_speed_before_decel(), and calcEstimatedStopTime().
Referenced by plan_maneuvers_callback().
SCIStrategicPlugin::VehicleState sci_strategic_plugin::SCIStrategicPlugin::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.
req | The maneuver planning request to extract the vehicle state from |
Definition at line 170 of file sci_strategic_plugin.cpp.
References sci_strategic_plugin::SCIStrategicPlugin::VehicleState::downtrack, GET_MANEUVER_PROPERTY, getLaneletsBetweenWithException(), sci_strategic_plugin::anonymous_namespace{sci_strategic_plugin.cpp}::getManeuverEndSpeed(), sci_strategic_plugin::SCIStrategicPlugin::VehicleState::lane_id, sci_strategic_plugin::SCIStrategicPlugin::VehicleState::speed, sci_strategic_plugin::SCIStrategicPlugin::VehicleState::stamp, and carma_cooperative_perception::to_string().
Referenced by plan_maneuvers_callback().
double sci_strategic_plugin::SCIStrategicPlugin::findSpeedLimit | ( | const lanelet::ConstLanelet & | llt | ) | const |
Given a Lanelet, find it's associated Speed Limit.
llt | Constant Lanelet object |
std::invalid_argument | if the speed limit could not be retrieved |
Definition at line 781 of file sci_strategic_plugin.cpp.
References wm_.
Referenced by plan_maneuvers_callback().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
carma_v2x_msgs::msg::MobilityOperation sci_strategic_plugin::SCIStrategicPlugin::generateMobilityOperation | ( | ) |
Generates Mobility Operation messages.
Definition at line 794 of file sci_strategic_plugin.cpp.
References bsm_id_, bsm_msg_count_, bsm_sec_mark_, config_, intersection_turn_direction_, is_allowed_int_, sci_strategic_plugin::Left, sci_strategic_plugin::SCIStrategicPluginConfig::min_gap, sci_strategic_plugin::SCIStrategicPluginConfig::reaction_time, sci_strategic_plugin::Right, scheduled_departure_position_, stop_controlled_intersection_strategy_, carma_cooperative_perception::to_string(), sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_accel_limit, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_accel_limit_multiplier, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_decel_limit, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_decel_limit_multiplier, and sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_id.
Referenced by publishMobilityOperation().
|
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 941 of file sci_strategic_plugin.cpp.
|
virtual |
Returns the version id of this plugin.
Implements carma_guidance_plugins::PluginBaseNode.
Definition at line 946 of file sci_strategic_plugin.cpp.
|
inlineprivate |
std::vector< lanelet::ConstLanelet > sci_strategic_plugin::SCIStrategicPlugin::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 331 of file sci_strategic_plugin.cpp.
References carma_cooperative_perception::to_string(), and wm_.
Referenced by extractInitialState(), and plan_maneuvers_callback().
TurnDirection sci_strategic_plugin::SCIStrategicPlugin::getTurnDirectionAtIntersection | ( | std::vector< lanelet::ConstLanelet > | lanelets_list | ) |
Determine the turn direction at intersection.
lanelets_list | List of lanelets crossed around the intersection area |
Definition at line 622 of file sci_strategic_plugin.cpp.
References sci_strategic_plugin::Left, sci_strategic_plugin::Right, and sci_strategic_plugin::Straight.
Referenced by plan_maneuvers_callback().
void sci_strategic_plugin::SCIStrategicPlugin::guidance_state_cb | ( | const carma_planning_msgs::msg::GuidanceState::UniquePtr | msg | ) |
Callback for the Guidance State.
msg | Latest GuidanceState message |
Definition at line 226 of file sci_strategic_plugin.cpp.
References lightbar_manager::ENGAGED, and guidance_engaged_.
Referenced by on_configure_plugin().
void sci_strategic_plugin::SCIStrategicPlugin::mobilityOperationCb | ( | carma_v2x_msgs::msg::MobilityOperation::UniquePtr | msg | ) |
callback function for mobility operation
msg | input mobility operation msg |
Definition at line 199 of file sci_strategic_plugin.cpp.
References approaching_stop_controlled_interction_, config_, parseStrategyParams(), previous_strategy_params_, stop_controlled_intersection_strategy_, street_msg_timestamp_, and sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_id.
Referenced by on_configure_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.
Reimplemented from carma_guidance_plugins::PluginBaseNode.
Definition at line 161 of file sci_strategic_plugin.cpp.
References mob_op_pub_timer_, and publishMobilityOperation().
|
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.
Implements carma_guidance_plugins::PluginBaseNode.
Definition at line 91 of file sci_strategic_plugin.cpp.
References bsm_sub_, BSMCb(), config_, current_pose_sub_, currentPoseCb(), sci_strategic_plugin::SCIStrategicPluginConfig::delta_t, carma_guidance_plugins::PluginBaseNode::get_world_model(), guidance_state_cb(), guidance_state_sub_, sci_strategic_plugin::SCIStrategicPluginConfig::intersection_exit_zone_length, sci_strategic_plugin::SCIStrategicPluginConfig::intersection_transit_plugin_name, sci_strategic_plugin::SCIStrategicPluginConfig::lane_following_plugin_name, sci_strategic_plugin::SCIStrategicPluginConfig::min_gap, mob_operation_sub_, mobility_operation_pub_, mobilityOperationCb(), parameter_update_callback(), sci_strategic_plugin::SCIStrategicPluginConfig::reaction_time, sci_strategic_plugin::SCIStrategicPluginConfig::stop_line_buffer, sci_strategic_plugin::SCIStrategicPluginConfig::strategic_plugin_name, sci_strategic_plugin::SCIStrategicPluginConfig::veh_length, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_accel_limit, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_accel_limit_multiplier, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_decel_limit, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_decel_limit_multiplier, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_id, and wm_.
rcl_interfaces::msg::SetParametersResult sci_strategic_plugin::SCIStrategicPlugin::parameter_update_callback | ( | const std::vector< rclcpp::Parameter > & | parameters | ) |
Callback for dynamic parameter updates.
Definition at line 142 of file sci_strategic_plugin.cpp.
References config_, sci_strategic_plugin::SCIStrategicPluginConfig::delta_t, sci_strategic_plugin::SCIStrategicPluginConfig::intersection_exit_zone_length, sci_strategic_plugin::SCIStrategicPluginConfig::min_gap, sci_strategic_plugin::SCIStrategicPluginConfig::reaction_time, sci_strategic_plugin::SCIStrategicPluginConfig::stop_line_buffer, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_accel_limit_multiplier, and sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_decel_limit_multiplier.
Referenced by on_configure_plugin().
void sci_strategic_plugin::SCIStrategicPlugin::parseStrategyParams | ( | const std::string & | strategy_params | ) |
parse strategy parameters
strategy_params | input string of strategy params from mob op msg |
Definition at line 244 of file sci_strategic_plugin.cpp.
References is_allowed_int_, scheduled_depart_time_, scheduled_departure_position_, scheduled_enter_time_, scheduled_stop_time_, and process_traj_logs::split.
Referenced by mobilityOperationCb().
|
virtual |
Service callback for arbitrator maneuver planning.
req | Plan maneuver request |
resp | Plan maneuver response with a list of maneuver plan |
Implements carma_guidance_plugins::StrategicPlugin.
Definition at line 351 of file sci_strategic_plugin.cpp.
References approaching_stop_controlled_interction_, caseThreeSpeedProfile(), composeIntersectionTransitMessage(), composeLaneFollowingManeuverMessage(), composeStopAndWaitManeuverMessage(), config_, current_downtrack_, determine_speed_profile_case(), sci_strategic_plugin::SCIStrategicPlugin::VehicleState::downtrack, extractInitialState(), findSpeedLimit(), getLaneletsBetweenWithException(), getTurnDirectionAtIntersection(), sci_strategic_plugin::SCIStrategicPluginConfig::intersection_exit_zone_length, intersection_turn_direction_, is_allowed_int_, sci_strategic_plugin::SCIStrategicPlugin::VehicleState::lane_id, sci_strategic_plugin::SCIStrategicPluginConfig::min_maneuver_planning_period, scheduled_depart_time_, scheduled_enter_time_, scheduled_stop_time_, sci_strategic_plugin::SCIStrategicPlugin::VehicleState::speed, speed_limit_, sci_strategic_plugin::SCIStrategicPlugin::VehicleState::stamp, sci_strategic_plugin::SCIStrategicPluginConfig::stop_line_buffer, sci_strategic_plugin::Straight, street_msg_timestamp_, sci_strategic_plugin::SCIStrategicPluginConfig::veh_length, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_decel_limit, sci_strategic_plugin::SCIStrategicPluginConfig::vehicle_decel_limit_multiplier, vehicle_engaged_, and wm_.
void sci_strategic_plugin::SCIStrategicPlugin::publishMobilityOperation | ( | ) |
Method to publish mobility operation msgs at a fixed rate of 10hz if approaching intersection.
Definition at line 819 of file sci_strategic_plugin.cpp.
References approaching_stop_controlled_interction_, generateMobilityOperation(), guidance_engaged_, and mobility_operation_pub_.
Referenced by on_activate_plugin().
|
inlineprivate |
bool sci_strategic_plugin::SCIStrategicPlugin::approaching_stop_controlled_interction_ = false |
Definition at line 313 of file sci_strategic_plugin.hpp.
Referenced by mobilityOperationCb(), plan_maneuvers_callback(), and publishMobilityOperation().
std::string sci_strategic_plugin::SCIStrategicPlugin::bsm_id_ = "default_bsm_id" |
Definition at line 315 of file sci_strategic_plugin.hpp.
Referenced by BSMCb(), and generateMobilityOperation().
uint8_t sci_strategic_plugin::SCIStrategicPlugin::bsm_msg_count_ = 0 |
Definition at line 316 of file sci_strategic_plugin.hpp.
Referenced by BSMCb(), and generateMobilityOperation().
uint16_t sci_strategic_plugin::SCIStrategicPlugin::bsm_sec_mark_ = 0 |
Definition at line 317 of file sci_strategic_plugin.hpp.
Referenced by BSMCb(), and generateMobilityOperation().
|
private |
Definition at line 323 of file sci_strategic_plugin.hpp.
Referenced by on_configure_plugin().
|
private |
Config containing configurable algorithm parameters.
Definition at line 336 of file sci_strategic_plugin.hpp.
Referenced by SCIStrategicPlugin(), calc_speed_before_decel(), caseOneSpeedProfile(), caseThreeSpeedProfile(), caseTwoSpeedProfile(), composeIntersectionTransitMessage(), composeLaneFollowingManeuverMessage(), composeStopAndWaitManeuverMessage(), generateMobilityOperation(), mobilityOperationCb(), on_configure_plugin(), parameter_update_callback(), and plan_maneuvers_callback().
double sci_strategic_plugin::SCIStrategicPlugin::current_downtrack_ = 0.0 |
Definition at line 311 of file sci_strategic_plugin.hpp.
Referenced by currentPoseCb(), and plan_maneuvers_callback().
|
private |
Definition at line 322 of file sci_strategic_plugin.hpp.
Referenced by on_configure_plugin().
|
private |
Definition at line 327 of file sci_strategic_plugin.hpp.
Referenced by guidance_state_cb(), and publishMobilityOperation().
|
private |
Definition at line 325 of file sci_strategic_plugin.hpp.
Referenced by on_configure_plugin().
|
private |
Definition at line 340 of file sci_strategic_plugin.hpp.
|
private |
Cache variables for storing the current intersection state between state machine transitions.
Definition at line 339 of file sci_strategic_plugin.hpp.
TurnDirection sci_strategic_plugin::SCIStrategicPlugin::intersection_turn_direction_ = TurnDirection::Straight |
Definition at line 304 of file sci_strategic_plugin.hpp.
Referenced by generateMobilityOperation(), and plan_maneuvers_callback().
bool sci_strategic_plugin::SCIStrategicPlugin::is_allowed_int_ = false |
Definition at line 302 of file sci_strategic_plugin.hpp.
Referenced by generateMobilityOperation(), parseStrategyParams(), and plan_maneuvers_callback().
|
private |
Definition at line 330 of file sci_strategic_plugin.hpp.
Referenced by on_activate_plugin().
|
private |
Definition at line 321 of file sci_strategic_plugin.hpp.
Referenced by on_configure_plugin().
|
private |
Definition at line 324 of file sci_strategic_plugin.hpp.
Referenced by on_configure_plugin(), and publishMobilityOperation().
|
private |
Definition at line 344 of file sci_strategic_plugin.hpp.
Referenced by mobilityOperationCb().
unsigned long long sci_strategic_plugin::SCIStrategicPlugin::scheduled_depart_time_ = 0 |
Definition at line 298 of file sci_strategic_plugin.hpp.
Referenced by parseStrategyParams(), and plan_maneuvers_callback().
uint32_t sci_strategic_plugin::SCIStrategicPlugin::scheduled_departure_position_ = std::numeric_limits<uint32_t>::max() |
Definition at line 300 of file sci_strategic_plugin.hpp.
Referenced by generateMobilityOperation(), and parseStrategyParams().
unsigned long long sci_strategic_plugin::SCIStrategicPlugin::scheduled_enter_time_ = 0 |
Definition at line 296 of file sci_strategic_plugin.hpp.
Referenced by parseStrategyParams(), and plan_maneuvers_callback().
unsigned long long sci_strategic_plugin::SCIStrategicPlugin::scheduled_stop_time_ = 0 |
Definition at line 294 of file sci_strategic_plugin.hpp.
Referenced by parseStrategyParams(), and plan_maneuvers_callback().
double sci_strategic_plugin::SCIStrategicPlugin::speed_limit_ = 100.0 |
Definition at line 308 of file sci_strategic_plugin.hpp.
Referenced by composeLaneFollowingManeuverMessage(), and plan_maneuvers_callback().
|
private |
Definition at line 343 of file sci_strategic_plugin.hpp.
Referenced by composeLaneFollowingManeuverMessage(), generateMobilityOperation(), and mobilityOperationCb().
unsigned long long sci_strategic_plugin::SCIStrategicPlugin::street_msg_timestamp_ = 0 |
Definition at line 292 of file sci_strategic_plugin.hpp.
Referenced by mobilityOperationCb(), and plan_maneuvers_callback().
bool sci_strategic_plugin::SCIStrategicPlugin::vehicle_engaged_ = false |
Definition at line 305 of file sci_strategic_plugin.hpp.
Referenced by currentPoseCb(), and plan_maneuvers_callback().
|
private |
World Model pointer.
Definition at line 333 of file sci_strategic_plugin.hpp.
Referenced by currentPoseCb(), findSpeedLimit(), get_wm(), getLaneletsBetweenWithException(), on_configure_plugin(), plan_maneuvers_callback(), and set_wm().