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.
route_following_plugin::anonymous_namespace{route_following_plugin.cpp} Namespace Reference

Functions

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 calls due to it missing in stop and wait plugin. More...
 
void setManeuverLaneletIds (carma_planning_msgs::msg::Maneuver &mvr, lanelet::Id start_id, lanelet::Id end_id)
 Anonymous function to set the lanelet ids for all maneuver types except lane following. More...
 

Function Documentation

◆ getManeuverEndSpeed()

double route_following_plugin::anonymous_namespace{route_following_plugin.cpp}::getManeuverEndSpeed ( const carma_planning_msgs::msg::Maneuver &  mvr)

Anonymous function to extract maneuver end speed which can not be optained with GET_MANEUVER_PROPERY calls due to it missing in stop and wait plugin.

Definition at line 36 of file route_following_plugin.cpp.

36 {
37 switch(mvr.type) {
38 case carma_planning_msgs::msg::Maneuver::LANE_FOLLOWING:
39 return mvr.lane_following_maneuver.end_speed;
40 case carma_planning_msgs::msg::Maneuver::LANE_CHANGE:
41 return mvr.lane_change_maneuver.end_speed;
42 case carma_planning_msgs::msg::Maneuver::INTERSECTION_TRANSIT_STRAIGHT:
43 return mvr.intersection_transit_straight_maneuver.end_speed;
44 case carma_planning_msgs::msg::Maneuver::INTERSECTION_TRANSIT_LEFT_TURN:
45 return mvr.intersection_transit_left_turn_maneuver.end_speed;
46 case carma_planning_msgs::msg::Maneuver::INTERSECTION_TRANSIT_RIGHT_TURN:
47 return mvr.intersection_transit_right_turn_maneuver.end_speed;
48 case carma_planning_msgs::msg::Maneuver::STOP_AND_WAIT:
49 return 0;
50 default:
51 return 0;
52 }
53}

Referenced by route_following_plugin::RouteFollowingPlugin::getManeuverDuration(), route_following_plugin::RouteFollowingPlugin::maneuverWithBufferStartsAfterDowntrack(), and route_following_plugin::RouteFollowingPlugin::routeCb().

Here is the caller graph for this function:

◆ setManeuverLaneletIds()

void route_following_plugin::anonymous_namespace{route_following_plugin.cpp}::setManeuverLaneletIds ( carma_planning_msgs::msg::Maneuver &  mvr,
lanelet::Id  start_id,
lanelet::Id  end_id 
)

Anonymous function to set the lanelet ids for all maneuver types except lane following.

Definition at line 58 of file route_following_plugin.cpp.

58 {
59
60 switch(mvr.type) {
61 case carma_planning_msgs::msg::Maneuver::LANE_CHANGE:
62 mvr.lane_change_maneuver.starting_lane_id = std::to_string(start_id);
63 mvr.lane_change_maneuver.ending_lane_id = std::to_string(end_id);
64 break;
65 case carma_planning_msgs::msg::Maneuver::INTERSECTION_TRANSIT_STRAIGHT:
66 mvr.intersection_transit_straight_maneuver.starting_lane_id = std::to_string(start_id);
67 mvr.intersection_transit_straight_maneuver.ending_lane_id = std::to_string(end_id);
68 break;
69 case carma_planning_msgs::msg::Maneuver::INTERSECTION_TRANSIT_LEFT_TURN:
70 mvr.intersection_transit_left_turn_maneuver.starting_lane_id = std::to_string(start_id);
71 mvr.intersection_transit_left_turn_maneuver.ending_lane_id = std::to_string(end_id);
72 break;
73 case carma_planning_msgs::msg::Maneuver::INTERSECTION_TRANSIT_RIGHT_TURN:
74 mvr.intersection_transit_right_turn_maneuver.starting_lane_id = std::to_string(start_id);
75 mvr.intersection_transit_right_turn_maneuver.ending_lane_id = std::to_string(end_id);
76 break;
77 case carma_planning_msgs::msg::Maneuver::STOP_AND_WAIT:
78 mvr.stop_and_wait_maneuver.starting_lane_id = std::to_string(start_id);
79 mvr.stop_and_wait_maneuver.ending_lane_id = std::to_string(end_id);
80 break;
81 default:
82 throw std::invalid_argument("Maneuver type does not have start,end lane ids");
83 }
84}
auto to_string(const UtmZone &zone) -> std::string
Definition: utm_zone.cpp:21

References carma_cooperative_perception::to_string().

Referenced by route_following_plugin::RouteFollowingPlugin::addStopAndWaitAtRouteEnd().

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