|
lanelet2_route_planning v2.0.0
|
Classes | |
| struct | ExtractRegulatoryElementsResult |
| Return type of extractRegulatoryElements. More... | |
| struct | IntersectionOfLinesResult |
| Return type of intersectionOfLines. More... | |
| struct | is_vector |
| struct | is_vector< std::vector< T, A > > |
| class | Lanelet2RoutePlanning |
| Lanelet2 route planning node. More... | |
| struct | LocalRouteWindow |
| A local route window and its offset in the complete route. More... | |
| struct | PointSequence |
| Helper type for a sequence of three points. More... | |
| struct | ProjectedLaneletPoints |
| Projected lanelet points. More... | |
| struct | ProjectPointToLineStringAlongAxisResult |
| Return type of projectPointToLineStringAlongAxis. More... | |
| struct | ResampleCenterlinesAlongPathResult |
| Return type of resampleCenterlinesAlongPath. More... | |
| struct | TopicDiagnosticConfig |
| Configuration parameters for topic diagnostics. More... | |
Functions | |
| Eigen::Vector2d | to2d (const Eigen::Vector3d &point) |
| Converts a 3D Eigen point to a 2D Eigen point. | |
| Eigen::Vector3d | to3d (const Eigen::Vector2d &point) |
| Converts a 2D Eigen point to a 3D Eigen point. | |
| Eigen::Vector3d | to3d (const Eigen::Vector2d &point, double z) |
| Converts a 2D Eigen point to a 3D Eigen point. | |
| std::vector< Eigen::Vector2d > | to2d (const std::vector< Eigen::Vector3d > &points) |
| Converts a vector of 3D Eigen points to a vector of 2D Eigen points. | |
| std::vector< Eigen::Vector3d > | to3d (const std::vector< Eigen::Vector2d > &points) |
| Converts a vector of 2D Eigen points to a vector of 3D Eigen points. | |
| geometry_msgs::msg::Point | toRos (const Eigen::Vector2d &point) |
| Converts a 2D Eigen point to a ROS point. | |
| geometry_msgs::msg::Point | toRos (const Eigen::Vector3d &point) |
| Converts a 3D Eigen point to a ROS point. | |
| geometry_msgs::msg::Point | toRos (const lanelet::BasicPoint2d &point) |
| Converts a 2D Lanelet point to a ROS point. | |
| lanelet::BasicPoint2d | toLanelet (const Eigen::Vector2d &point) |
| Converts a 2D Eigen point to a Lanelet point. | |
| lanelet::BasicPoint3d | toLanelet (const Eigen::Vector3d &point) |
| Converts a 3D Eigen point to a Lanelet point. | |
| Eigen::Vector2d | toEigen2d (const geometry_msgs::msg::Point &point) |
| Converts a ROS point to a 2D Eigen point. | |
| Eigen::Vector3d | toEigen (const geometry_msgs::msg::Point &point) |
| Converts a ROS point to a 3D Eigen point. | |
| geometry_msgs::msg::Point | egoPosition (const perception_msgs::msg::EgoData &ego_data) |
| Extracts an EgoData position as a ROS point. | |
| std::vector< Eigen::Vector2d > | toEigen (const lanelet::BasicLineString2d &line_string) |
| Converts a 2D Lanelet line string to a vector of Eigen points. | |
| std::vector< Eigen::Vector3d > | toEigen (const lanelet::BasicLineString3d &line_string) |
| Converts a 3D Lanelet line string to a vector of Eigen points. | |
| lanelet::BasicLineString2d | toLanelet (const std::vector< Eigen::Vector2d > &line_string) |
| Converts a vector of 2D Eigen points to a Lanelet line string. | |
| lanelet::BasicLineString3d | toLanelet (const std::vector< Eigen::Vector3d > &line_string) |
| Converts a vector of 3D Eigen points to a Lanelet line string. | |
| geometry_msgs::msg::Quaternion | toRosQuaternion (const Eigen::Vector2d &vector) |
| Converts a 2D Eigen vector pointing in a specific direction to a ROS quaternion. | |
| std::vector< Eigen::Vector3d > | suggestedReferenceLineToEigen (const std::vector< route_planning_msgs::msg::RouteElement > &route_elements) |
| Extracts the reference line along the suggested lane from a list of RouteElements. | |
| double | wrapAngle (const double angle) |
| Wraps an angle to the range [-π, π]. | |
| double | angleBetweenVectors (const Eigen::Vector2d &v1, const Eigen::Vector2d &v2) |
| Computes the angle between two 2D vectors. | |
| std::optional< IntersectionOfLinesResult > | intersectionOfLines (const std::vector< Eigen::Vector2d > &line1, const std::vector< Eigen::Vector2d > &line2) |
| Computes the intersection of two 2D lines. | |
| Eigen::Vector2d | tangentOfPointAlongLineString (const Eigen::Vector2d &point, const Eigen::Vector2d &prev_point, const Eigen::Vector2d &next_point) |
| Computes a unit vector tangential to a point along a line string. | |
| Eigen::Vector2d | normalOfPointAlongLineString (const Eigen::Vector2d &point, const Eigen::Vector2d &prev_point, const Eigen::Vector2d &next_point) |
| Computes a unit vector normal to a point along a line string. | |
| std::vector< Eigen::Vector3d > | resampleLineString (const std::vector< Eigen::Vector3d > &line_string, const double delta, double &offset) |
| Resamples a 3D line string with a constant sampling distance. | |
| std::vector< size_t > | adaptivelySampleLineString (const std::vector< Eigen::Vector2d > &line_string, double max_lateral_error, const std::vector< size_t > &break_after_indices={}) |
| Simplifies a 2D line string within a maximum lateral error. | |
| Eigen::Vector2d | projectPointToLineString (const Eigen::Vector2d &point, const std::vector< Eigen::Vector2d > &line_string) |
| Projects a point to the closest line segment of a line string. | |
| Eigen::Vector3d | projectPointToLineString (const Eigen::Vector3d &point, const std::vector< Eigen::Vector3d > &line_string) |
| Projects a 3D point to the closest line segment of a 3D line string. | |
| std::optional< ProjectPointToLineStringAlongAxisResult > | projectPointToLineStringAlongAxis (const Eigen::Vector2d &point, const Eigen::Vector2d &axis, const std::vector< Eigen::Vector2d > &line_string) |
| Projects a point along an axis to the closest line segment of a line string. | |
| std::optional< ProjectPointToLineStringAlongAxisResult > | projectPointToLineStringAlongNormal (const Eigen::Vector2d &point, const Eigen::Vector2d &prev_point, const Eigen::Vector2d &next_point, const std::vector< Eigen::Vector2d > &line_string) |
| Projects a point to the closest line segment of a line string along the normal to the tangent at the point. | |
| std::optional< lanelet::routing::Route > | getRoute (const lanelet::routing::RoutingGraphUPtr &routing_graph, const std::vector< lanelet::ConstLanelet > &route_lanelets) |
| Computes a route from start to destination along intermediate destinations. | |
| LocalRouteWindow | extractLocalRouteWindow (const route_planning_msgs::msg::Route &full_route, size_t current_global_idx, double distance_behind, double distance_ahead) |
| Extracts a local route window while preserving absolute route data. | |
| size_t | indexOfLineStringPointClosestToPoint (const std::vector< Eigen::Vector2d > &line_string, const Eigen::Vector2d &point, const bool consider_order=false, const bool behind=true) |
| Finds the index of a point in a line string that is closest to another point. | |
| size_t | matchPointToLineString (const std::vector< Eigen::Vector2d > &line_string, const Eigen::Vector2d &point, const size_t idx_indication, const bool consider_order=false, const bool behind=true) |
| Finds the index of a point in a line string that is locally closest to another point. | |
| size_t | considerOrderForPointMatchedToLineString (const std::vector< Eigen::Vector2d > &line_string, const Eigen::Vector2d &point, const size_t idx_closest, const bool behind) |
| Takes a closest point in a line string and guarantees that it is behind or ahead of the given point. | |
| bool | changesLaneFromPointToPoint (const Eigen::Vector2d &point, const Eigen::Vector2d &next_point, const double sampling_distance) |
| Identifies a lane change based on the distance between two reference line points. | |
| std::vector< lanelet::ConstLanelet > | adjacentLeftOrRightLanelets (const lanelet::ConstLanelet &lanelet, const lanelet::routing::RoutingGraphUPtr &routing_graph, bool left, bool sort_from_left=true) |
| Finds lanelets adjacent to the left or right of a given lanelet. | |
| std::vector< ProjectedLaneletPoints > | projectPointToLaneletLines (const Eigen::Vector2d &point, const Eigen::Vector2d &prev_point, const Eigen::Vector2d &next_point, const std::vector< lanelet::ConstLanelet > &lanelets, const rclcpp::Logger &logger=rclcpp::get_logger("lanelet2_route_planning")) |
| Projects a point to the centerline and bounds of a set of lanelets. | |
| std::optional< int > | computeFollowingLaneIdxOffset (const lanelet::ConstLanelet &lanelet, const lanelet::ConstLanelet &lanelet_of_next_point, const lanelet::routing::RoutingGraphUPtr &routing_graph) |
| Computes the offset of lane element indices from current to next route element. | |
| route_planning_msgs::msg::RouteElement | createMinimalRouteElement (const geometry_msgs::msg::Point &position, const geometry_msgs::msg::Quaternion &orientation, double s=0.0, bool will_change_suggested_lane=false, uint8_t speed_limit=0) |
| Create a minimal route element message. | |
| std::pair< Eigen::Vector2d, Eigen::Vector2d > | extractDrivableSpace (const lanelet::LineStringLayer &line_string_layer, const PointSequence &point_sequence, const double max_distance) |
| Extracts drivable space boundaries for a route element. | |
| bool | isLineStringDrivable (const lanelet::ConstLineString3d &line_string) |
| Checks if lanelet line string has a type that is considered drivable. | |
| ExtractRegulatoryElementsResult | extractRegulatoryElements (const lanelet::ConstLanelet &lanelet, const std::vector< lanelet::ConstLanelet > &adjacent_left_lanelets, const std::vector< lanelet::ConstLanelet > &adjacent_right_lanelets, const PointSequence &point_sequence) |
| Extracts regulatory element information for a route element. | |
| std::optional< std::array< geometry_msgs::msg::Point, 2 > > | regulatoryElementReferenceLine (const std::shared_ptr< const lanelet::RegulatoryElement > ®ulatory_element) |
| Extracts the reference/effect line of a regulatory element. | |
| std::optional< std::array< geometry_msgs::msg::Point, 2 > > | regulatoryElementCancelLine (const std::shared_ptr< const lanelet::RegulatoryElement > ®ulatory_element) |
| Extracts the cancel line of a regulatory element. | |
| std::vector< geometry_msgs::msg::Point > | regulatoryElementPositions (const std::shared_ptr< const lanelet::RegulatoryElement > ®ulatory_element) |
| Extracts the sign/signal positions of a regulatory element. | |
| std::pair< uint8_t, uint8_t > | regulatoryElementType (const std::shared_ptr< const lanelet::RegulatoryElement > ®ulatory_element) |
| Extracts the type and meta value of a regulatory element. | |
| uint8_t | regulatoryElementSpeedLimit (const std::shared_ptr< const lanelet::RegulatoryElement > ®ulatory_element) |
| Extracts the speed limit of a regulatory element of subtype 'speed_limit'. | |
| uint8_t | laneBoundaryType (const lanelet::ConstLineString2d &line) |
| Extracts the lane boundary type of a lanelet line. | |
| uint8_t | speedLimit (const lanelet::ConstLanelet &lanelet, const bool consider_regulatory_elements=true) |
| Extracts the speed limit of a lanelet. | |
| uint8_t | speedLimit (const lanelet::ConstLanelet &lanelet, const Eigen::Vector2d &point) |
| Extracts the speed limit of a lanelet at a specific position on that lanelet. | |
| std::tuple< uint8_t, int > | suggestedTurnSignal (const lanelet::ConstLanelet &lanelet, const rclcpp::Logger &logger) |
| Extracts the suggested turn signal of a lanelet. | |
| lanelet::traffic_rules::TrafficRulesPtr | getTrafficRules () |
| Get traffic rules. | |
| std::optional< lanelet::ConstLanelet > | laneletAtPoint (const Eigen::Vector2d &point, const lanelet::LaneletMapConstPtr &map, const std::optional< lanelet::traffic_rules::TrafficRulesPtr > traffic_rules=std::nullopt) |
| Find lanelet at arbitrary point. | |
| lanelet::ConstLanelet | followLaneletsAlongRoutingGraph (const lanelet::routing::RoutingGraphUPtr &routing_graph, const lanelet::ConstLanelet &lanelet, const Eigen::Vector2d &position, const double distance) |
| Follows a lanelet's and following lanelets' centerline for a given distance. | |
| ResampleCenterlinesAlongPathResult | resampleCenterlinesAlongPath (const lanelet::routing::LaneletPath &path, const double delta_s, bool monotonically) |
| Equidistantly resamples lanelet centerlines along a path to one joint centerline. | |
| double | distanceTraveled (const route_planning_msgs::msg::Route &route) |
| Computes the traveled distance along the route. | |
| double | distanceRemaining (const route_planning_msgs::msg::Route &route) |
| Computes the remaining distance along the route. | |
| double | estimateRemainingTime (const route_planning_msgs::msg::Route &route, const double reference_speed=50.0/3.6) |
| Estimate remaining time for a route based on speed limits. | |
| void | postprocessRouteMessage (route_planning_msgs::msg::Route &route_msg, std::vector< std::vector< int > > &suggested_turn_signal_distance_ahead_by_route_element_by_lane_element) |
| Postprocesses a route message, filling missing information that can be inferred from other message contents. | |
| void | sortLaneletsByMatchingCost (const lanelet::BasicPoint2d &point, std::vector< std::pair< double, lanelet::ConstLanelet > > &lanelets_with_distances, const std::optional< lanelet::traffic_rules::TrafficRulesPtr > &traffic_rules=std::nullopt) |
| Sorts lanelet candidates by their matching cost for a 2D point. | |
Variables | |
| template<typename C > | |
| constexpr bool | is_vector_v = is_vector<C>::value |
| std::vector< size_t > lanelet2_route_planning::adaptivelySampleLineString | ( | const std::vector< Eigen::Vector2d > & | line_string, |
| double | max_lateral_error, | ||
| const std::vector< size_t > & | break_after_indices = {} ) |
Simplifies a 2D line string within a maximum lateral error.
Uses Ramer-Douglas-Peucker simplification and returns indices into the input. Breaks split the line after the given indices so discontinuities are retained. A maximum error of zero disables simplification.
| [in] | line_string | line string |
| [in] | max_lateral_error | maximum perpendicular deviation [m] |
| [in] | break_after_indices | indices after which to split the line |
Definition at line 188 of file geometry.cpp.
| std::vector< lanelet::ConstLanelet > lanelet2_route_planning::adjacentLeftOrRightLanelets | ( | const lanelet::ConstLanelet & | lanelet, |
| const lanelet::routing::RoutingGraphUPtr & | routing_graph, | ||
| bool | left, | ||
| bool | sort_from_left = true ) |
Finds lanelets adjacent to the left or right of a given lanelet.
RelationType::Left and RelationType::AdjacentLeft are used for left adjacent lanelets, right vice versa.
| [in] | lanelet | lanelet |
| [in] | routing_graph | routing graph |
| [in] | left | whether to find left or right adjacent lanelets |
| [in] | sort_from_left | whether to sort from left to right (true) or right to left (false) |
Definition at line 184 of file utils.cpp.
| double lanelet2_route_planning::angleBetweenVectors | ( | const Eigen::Vector2d & | v1, |
| const Eigen::Vector2d & | v2 ) |
Computes the angle between two 2D vectors.
Angle is in the range [-π, π].
| [in] | v1 | vector 1 |
| [in] | v2 | vector 2 |
Definition at line 80 of file geometry.cpp.
| bool lanelet2_route_planning::changesLaneFromPointToPoint | ( | const Eigen::Vector2d & | point, |
| const Eigen::Vector2d & | next_point, | ||
| const double | sampling_distance ) |
Identifies a lane change based on the distance between two reference line points.
Assumes that the two points are part of an equidistant reference line. If the distance between the two points is greater than the sampling distance, a lane change is assumed.
| [in] | point | point on reference line |
| [in] | next_point | next point on reference line |
| [in] | sampling_distance | expected distance between points |
Definition at line 177 of file utils.cpp.
| std::optional< int > lanelet2_route_planning::computeFollowingLaneIdxOffset | ( | const lanelet::ConstLanelet & | lanelet, |
| const lanelet::ConstLanelet & | lanelet_of_next_point, | ||
| const lanelet::routing::RoutingGraphUPtr & | routing_graph ) |
Computes the offset of lane element indices from current to next route element.
The algorithm works as follows:
If lane element j of the next route element follows on lane element i of the current route element, the returned offset is (j-i).
| [in] | lanelet | current lanelet |
| [in] | lanelet_of_next_point | lanelet of next point (on next route element) |
| [in] | routing_graph | routing graph |
Definition at line 252 of file utils.cpp.
| size_t lanelet2_route_planning::considerOrderForPointMatchedToLineString | ( | const std::vector< Eigen::Vector2d > & | line_string, |
| const Eigen::Vector2d & | point, | ||
| const size_t | idx_closest, | ||
| const bool | behind ) |
Takes a closest point in a line string and guarantees that it is behind or ahead of the given point.
Behind/ahead is meant physically, not in the order of the line string. The point behind a point at index i is at index i-1.
| [in] | line_string | line string |
| [in] | point | other point |
| [in] | idx_closest | index of closest point in line string |
| [in] | behind | whether to consider points behind (or ahead of) the given point |
Definition at line 144 of file utils.cpp.
| route_planning_msgs::msg::RouteElement lanelet2_route_planning::createMinimalRouteElement | ( | const geometry_msgs::msg::Point & | position, |
| const geometry_msgs::msg::Quaternion & | orientation, | ||
| double | s = 0.0, | ||
| bool | will_change_suggested_lane = false, | ||
| uint8_t | speed_limit = 0 ) |
Create a minimal route element message.
A minimal valid route element only has a single lane element with a reference pose.
| [in] | position | position |
| [in] | orientation | orientation |
| [in] | s | accumulated distance along route |
| [in] | will_change_suggested_lane | whether the lane will change to the next route element |
| [in] | speed_limit | speed limit |
Definition at line 345 of file utils.cpp.
| double lanelet2_route_planning::distanceRemaining | ( | const route_planning_msgs::msg::Route & | route | ) |
Computes the remaining distance along the route.
Accurate to the level of route elements. Ignores route overshoot.
| [in] | route | route |
Definition at line 1004 of file utils.cpp.
| double lanelet2_route_planning::distanceTraveled | ( | const route_planning_msgs::msg::Route & | route | ) |
Computes the traveled distance along the route.
Accurate to the level of route elements. Ignores route undershoot.
| [in] | route | route |
Definition at line 993 of file utils.cpp.
| geometry_msgs::msg::Point lanelet2_route_planning::egoPosition | ( | const perception_msgs::msg::EgoData & | ego_data | ) |
Extracts an EgoData position as a ROS point.
| [in] | ego_data | ego data |
Definition at line 53 of file conversions.cpp.
| double lanelet2_route_planning::estimateRemainingTime | ( | const route_planning_msgs::msg::Route & | route, |
| const double | reference_speed = 50.0 / 3.6 ) |
Estimate remaining time for a route based on speed limits.
| [in] | route | route |
| [in] | reference_speed | reference speed if speed limit is not set [m/s] |
Definition at line 1015 of file utils.cpp.
| std::pair< Eigen::Vector2d, Eigen::Vector2d > lanelet2_route_planning::extractDrivableSpace | ( | const lanelet::LineStringLayer & | line_string_layer, |
| const PointSequence & | point_sequence, | ||
| const double | max_distance ) |
Extracts drivable space boundaries for a route element.
Drivable space is defined as the area around the current point that is physically drivable. To extract it, the intersection of the normal to the current point with all existing map line strings is computed. The outermost intersection point that is not drivable anymore is considered the boundary. If no such point is found, the maximum distance is used.
| [in] | line_string_layer | map line string layer |
| [in] | point_sequence | point sequence (should be centerline of main lanelet) |
| [in] | max_distance | maximum distance to left/right drivable space bounds, if not otherwise restricted |
Definition at line 375 of file utils.cpp.
| LocalRouteWindow lanelet2_route_planning::extractLocalRouteWindow | ( | const route_planning_msgs::msg::Route & | full_route, |
| size_t | current_global_idx, | ||
| double | distance_behind, | ||
| double | distance_ahead ) |
Extracts a local route window while preserving absolute route data.
| [in] | full_route | complete route |
| [in] | current_global_idx | current element index in full_route |
| [in] | distance_behind | distance to include behind the current element [m] |
| [in] | distance_ahead | distance to include ahead of the current element [m] |
Definition at line 1169 of file utils.cpp.
| ExtractRegulatoryElementsResult lanelet2_route_planning::extractRegulatoryElements | ( | const lanelet::ConstLanelet & | lanelet, |
| const std::vector< lanelet::ConstLanelet > & | adjacent_left_lanelets, | ||
| const std::vector< lanelet::ConstLanelet > & | adjacent_right_lanelets, | ||
| const PointSequence & | point_sequence ) |
Extracts regulatory element information for a route element.
Regulatory elements are queried from a lanelet and its adjacent lanelets. They are only considered if their reference line intersects with the given point sequence, which should be the centerline of the main lanelet. This way, regulatory elements are assignable to the closest route element. Note that the assignment to adjacent lanes is also based on the intersection with the single given point sequence.
| [in] | lanelet | lanelet |
| [in] | adjacent_left_lanelets | left adjacent lanelets |
| [in] | adjacent_right_lanelets | right adjacent lanelets |
| [in] | point_sequence | point sequence (should be centerline of main lanelet) |
Definition at line 481 of file utils.cpp.
| lanelet::ConstLanelet lanelet2_route_planning::followLaneletsAlongRoutingGraph | ( | const lanelet::routing::RoutingGraphUPtr & | routing_graph, |
| const lanelet::ConstLanelet & | lanelet, | ||
| const Eigen::Vector2d & | position, | ||
| const double | distance ) |
Follows a lanelet's and following lanelets' centerline for a given distance.
If lanelets cannot be followed anymore, returns the last lanelet.
| [in] | routing_graph | routing graph |
| [in] | lanelet | current lanelet |
| [in] | position | position on current lanelet |
| [in] | distance | distance to follow lanelets (may be negative to follow in opposite direction) |
Definition at line 914 of file utils.cpp.
| std::optional< lanelet::routing::Route > lanelet2_route_planning::getRoute | ( | const lanelet::routing::RoutingGraphUPtr & | routing_graph, |
| const std::vector< lanelet::ConstLanelet > & | route_lanelets ) |
Computes a route from start to destination along intermediate destinations.
| [in] | routing_graph | routing graph |
| [in] | route_lanelets | lanelets to plan along, starting with start lanelet, ending with destination lanelet |
Definition at line 26 of file utils.cpp.
| lanelet::traffic_rules::TrafficRulesPtr lanelet2_route_planning::getTrafficRules | ( | ) |
Get traffic rules.
Definition at line 879 of file utils.cpp.
| size_t lanelet2_route_planning::indexOfLineStringPointClosestToPoint | ( | const std::vector< Eigen::Vector2d > & | line_string, |
| const Eigen::Vector2d & | point, | ||
| const bool | consider_order = false, | ||
| const bool | behind = true ) |
Finds the index of a point in a line string that is closest to another point.
If consider_order, then only the points behind or ahead of the projection of the given point are considered.
| [in] | line_string | line string |
| [in] | point | other point |
| [in] | consider_order | whether to consider the order of points in the line string |
| [in] | behind | whether to consider points behind (or ahead of) the given point |
Definition at line 67 of file utils.cpp.
| std::optional< IntersectionOfLinesResult > lanelet2_route_planning::intersectionOfLines | ( | const std::vector< Eigen::Vector2d > & | line1, |
| const std::vector< Eigen::Vector2d > & | line2 ) |
Computes the intersection of two 2D lines.
| [in] | line1 | first line defined by two points |
| [in] | line2 | second line defined by two points |
Definition at line 87 of file geometry.cpp.
| bool lanelet2_route_planning::isLineStringDrivable | ( | const lanelet::ConstLineString3d & | line_string | ) |
Checks if lanelet line string has a type that is considered drivable.
Drivable in the sense of being able to physically cross it, not whether it is allowed to cross it.
The following types are considered drivable:
Additionally, the extra attribute 'HoldingLine' is considered drivable.
| [in] | line_string | line string |
Definition at line 461 of file utils.cpp.
| uint8_t lanelet2_route_planning::laneBoundaryType | ( | const lanelet::ConstLineString2d & | line | ) |
Extracts the lane boundary type of a lanelet line.
Lane boundary type as in route_planning_msgs::msg::LaneBoundary.
| [in] | line | lanelet line |
Definition at line 666 of file utils.cpp.
| std::optional< lanelet::ConstLanelet > lanelet2_route_planning::laneletAtPoint | ( | const Eigen::Vector2d & | point, |
| const lanelet::LaneletMapConstPtr & | map, | ||
| const std::optional< lanelet::traffic_rules::TrafficRulesPtr > | traffic_rules = std::nullopt ) |
Find lanelet at arbitrary point.
Finds closest passable lanelet within 10m of the given point. Only considers the 5 closest lanelets.
| [in] | point | point |
| [in] | map | map |
| [in] | traffic_rules | traffic rules |
Definition at line 885 of file utils.cpp.
| size_t lanelet2_route_planning::matchPointToLineString | ( | const std::vector< Eigen::Vector2d > & | line_string, |
| const Eigen::Vector2d & | point, | ||
| const size_t | idx_indication, | ||
| const bool | consider_order = false, | ||
| const bool | behind = true ) |
Finds the index of a point in a line string that is locally closest to another point.
The purpose of this function is not to find the globally closest point, but the locally closest one. By locally, what is meant is that points closer in order to idx_indication are preferred over points that may actually be closer in distance.
The range of points 10m before and after idx_indication is considered. A maximum distance of 10m is used to match to this range of points, otherwise globally closer ones are preferred.
If consider_order, then only the points behind or ahead of the projection of the given point are considered.
| [in] | line_string | line string |
| [in] | point | other point |
| [in] | idx_indication | index of point in line string to indicate the range of points to be considered |
| [in] | consider_order | whether to consider the order of points in the line string |
| [in] | behind | whether to consider points behind (or ahead of) the given point |
Definition at line 94 of file utils.cpp.
| Eigen::Vector2d lanelet2_route_planning::normalOfPointAlongLineString | ( | const Eigen::Vector2d & | point, |
| const Eigen::Vector2d & | prev_point, | ||
| const Eigen::Vector2d & | next_point ) |
Computes a unit vector normal to a point along a line string.
The normal is normal to the tangent, see tangentOfPointAlongLineString.
| [in] | point | point along line string |
| [in] | prev_point | previous point along line string |
| [in] | next_point | next point along line string |
Definition at line 143 of file geometry.cpp.
| void lanelet2_route_planning::postprocessRouteMessage | ( | route_planning_msgs::msg::Route & | route_msg, |
| std::vector< std::vector< int > > & | suggested_turn_signal_distance_ahead_by_route_element_by_lane_element ) |
Postprocesses a route message, filling missing information that can be inferred from other message contents.
This includes:
| [in,out] | route_msg | route message to postprocess |
| [in] | suggested_turn_signal_distance_ahead_by_route_element_by_lane_element | suggested turn signal distances ahead by route element and lane element indices |
Definition at line 1031 of file utils.cpp.
| std::vector< ProjectedLaneletPoints > lanelet2_route_planning::projectPointToLaneletLines | ( | const Eigen::Vector2d & | point, |
| const Eigen::Vector2d & | prev_point, | ||
| const Eigen::Vector2d & | next_point, | ||
| const std::vector< lanelet::ConstLanelet > & | lanelets, | ||
| const rclcpp::Logger & | logger = rclcpp::get_logger("lanelet2_route_planning") ) |
Projects a point to the centerline and bounds of a set of lanelets.
For projection, projectPointToLineStringAlongNormal is used.
| [in] | point | point |
| [in] | prev_point | previous point |
| [in] | next_point | next point |
| [in] | lanelets | lanelets |
| [in] | logger | logger (for error logging) |
Definition at line 208 of file utils.cpp.
| Eigen::Vector2d lanelet2_route_planning::projectPointToLineString | ( | const Eigen::Vector2d & | point, |
| const std::vector< Eigen::Vector2d > & | line_string ) |
Projects a point to the closest line segment of a line string.
| [in] | point | point |
| [in] | line_string | line string |
Definition at line 231 of file geometry.cpp.
| Eigen::Vector3d lanelet2_route_planning::projectPointToLineString | ( | const Eigen::Vector3d & | point, |
| const std::vector< Eigen::Vector3d > & | line_string ) |
Projects a 3D point to the closest line segment of a 3D line string.
| [in] | point | point |
| [in] | line_string | line string |
Definition at line 235 of file geometry.cpp.
| std::optional< ProjectPointToLineStringAlongAxisResult > lanelet2_route_planning::projectPointToLineStringAlongAxis | ( | const Eigen::Vector2d & | point, |
| const Eigen::Vector2d & | axis, | ||
| const std::vector< Eigen::Vector2d > & | line_string ) |
Projects a point along an axis to the closest line segment of a line string.
| [in] | point | point |
| [in] | axis | axis direction |
| [in] | line_string | line string |
Definition at line 239 of file geometry.cpp.
| std::optional< ProjectPointToLineStringAlongAxisResult > lanelet2_route_planning::projectPointToLineStringAlongNormal | ( | const Eigen::Vector2d & | point, |
| const Eigen::Vector2d & | prev_point, | ||
| const Eigen::Vector2d & | next_point, | ||
| const std::vector< Eigen::Vector2d > & | line_string ) |
Projects a point to the closest line segment of a line string along the normal to the tangent at the point.
| [in] | point | point along line string |
| [in] | prev_point | previous point along line string |
| [in] | next_point | next point along line string |
| [in] | line_string | other line string to project to |
Definition at line 279 of file geometry.cpp.
| std::optional< std::array< geometry_msgs::msg::Point, 2 > > lanelet2_route_planning::regulatoryElementCancelLine | ( | const std::shared_ptr< const lanelet::RegulatoryElement > & | regulatory_element | ) |
Extracts the cancel line of a regulatory element.
Only the first cancel line of the regulatory element is considered. Only the end points of that cancel line are considered.
| [in] | regulatory_element | regulatory element |
Definition at line 574 of file utils.cpp.
| std::vector< geometry_msgs::msg::Point > lanelet2_route_planning::regulatoryElementPositions | ( | const std::shared_ptr< const lanelet::RegulatoryElement > & | regulatory_element | ) |
Extracts the sign/signal positions of a regulatory element.
Only the first point of referenced line strings is considered.
| [in] | regulatory_element | regulatory element |
Definition at line 589 of file utils.cpp.
| std::optional< std::array< geometry_msgs::msg::Point, 2 > > lanelet2_route_planning::regulatoryElementReferenceLine | ( | const std::shared_ptr< const lanelet::RegulatoryElement > & | regulatory_element | ) |
Extracts the reference/effect line of a regulatory element.
Only the first reference line of the regulatory element is considered. Only the end points of that reference line are considered.
| [in] | regulatory_element | regulatory element |
Definition at line 559 of file utils.cpp.
| uint8_t lanelet2_route_planning::regulatoryElementSpeedLimit | ( | const std::shared_ptr< const lanelet::RegulatoryElement > & | regulatory_element | ) |
Extracts the speed limit of a regulatory element of subtype 'speed_limit'.
As defined in route_planning_msgs::msg::RegulatoryElement.
| [in] | regulatory_element | regulatory element |
Definition at line 631 of file utils.cpp.
| std::pair< uint8_t, uint8_t > lanelet2_route_planning::regulatoryElementType | ( | const std::shared_ptr< const lanelet::RegulatoryElement > & | regulatory_element | ) |
Extracts the type and meta value of a regulatory element.
Type and meta value as in route_planning_msgs::msg::RegulatoryElement.
| [in] | regulatory_element | regulatory element |
Definition at line 603 of file utils.cpp.
| ResampleCenterlinesAlongPathResult lanelet2_route_planning::resampleCenterlinesAlongPath | ( | const lanelet::routing::LaneletPath & | path, |
| const double | delta_s, | ||
| bool | monotonically ) |
Equidistantly resamples lanelet centerlines along a path to one joint centerline.
| [in] | path | path |
| [in] | delta_s | sampling distance |
| [in] | monotonically | whether to ensure that the centerline cannot make turns greater than 90 degrees |
Definition at line 946 of file utils.cpp.
| std::vector< Eigen::Vector3d > lanelet2_route_planning::resampleLineString | ( | const std::vector< Eigen::Vector3d > & | line_string, |
| const double | delta, | ||
| double & | offset ) |
Resamples a 3D line string with a constant sampling distance.
Sampling distance is measured in the xy-plane; z is interpolated.
| [in] | line | line string |
| [in] | delta | sampling distance |
| [in,out] | offset | starts sampling at offset distance, returns overshoot distance |
Definition at line 152 of file geometry.cpp.
| void lanelet2_route_planning::sortLaneletsByMatchingCost | ( | const lanelet::BasicPoint2d & | point, |
| std::vector< std::pair< double, lanelet::ConstLanelet > > & | lanelets_with_distances, | ||
| const std::optional< lanelet::traffic_rules::TrafficRulesPtr > & | traffic_rules = std::nullopt ) |
Sorts lanelet candidates by their matching cost for a 2D point.
Points inside a lanelet are favored, lateral distance is penalized quadratically, and non-passable lanelets receive an additional penalty if traffic rules are available.
Derived simplified implementation from deprecated lanelet2_utilties package.
| [in] | point | point to match |
| [in,out] | lanelets_with_distances | candidate lanelets from lanelet::geometry::findNearest |
| [in] | traffic_rules | optional traffic rules used to penalize non-passable lanelets |
Definition at line 1132 of file utils.cpp.
| uint8_t lanelet2_route_planning::speedLimit | ( | const lanelet::ConstLanelet & | lanelet, |
| const bool | consider_regulatory_elements = true ) |
Extracts the speed limit of a lanelet.
Uses lanelet traffic rules to determine the speed limit for the whole lanelet.
If consider_regulatory_elements is true, speed-limit regulatory elements attached to the lanelet may override the lanelet-wide speed limit according to lanelet traffic rules. If consider_regulatory_elements is false, only the lanelet's own speed_limit and speed_limit_mandatory attributes are considered.
As defined in route_planning_msgs::msg::RegulatoryElement.
| [in] | lanelet | lanelet |
| [in] | consider_regulatory_elements | whether to consider regulatory elements related to the lanelet |
Definition at line 704 of file utils.cpp.
| uint8_t lanelet2_route_planning::speedLimit | ( | const lanelet::ConstLanelet & | lanelet, |
| const Eigen::Vector2d & | point ) |
Extracts the speed limit of a lanelet at a specific position on that lanelet.
Speed-limit regulatory elements take precedence over the lanelet-wide speed limit, but only once the given point is behind the regulatory element's reference line and, if present, still before its cancel line.
If no applicable speed-limit regulatory element is active at the given point, this falls back to the lanelet-wide speed limit. If the point is still before an intersecting reference line, the fallback ignores regulatory elements and uses only the lanelet's own speed-limit attributes.
This implementation considers only the first reference line and first cancel line of a speed-limit regulatory element, using their end points.
As defined in route_planning_msgs::msg::RegulatoryElement.
| [in] | lanelet | lanelet |
| [in] | point | point on or near the lanelet |
Definition at line 735 of file utils.cpp.
| std::vector< Eigen::Vector3d > lanelet2_route_planning::suggestedReferenceLineToEigen | ( | const std::vector< route_planning_msgs::msg::RouteElement > & | route_elements | ) |
Extracts the reference line along the suggested lane from a list of RouteElements.
| [in] | route_elements | list of RouteElements |
Definition at line 97 of file conversions.cpp.
| std::tuple< uint8_t, int > lanelet2_route_planning::suggestedTurnSignal | ( | const lanelet::ConstLanelet & | lanelet, |
| const rclcpp::Logger & | logger ) |
Extracts the suggested turn signal of a lanelet.
Checks for the attribute suggested_turn_signal with values left, right, or hazard. Checks for the attribute suggested_turn_signal_distance_ahead to get the suggested distance ahead for the turn signal.
| [in] | lanelet | lanelet |
| [in] | logger | logger (for error logging) |
Definition at line 833 of file utils.cpp.
| Eigen::Vector2d lanelet2_route_planning::tangentOfPointAlongLineString | ( | const Eigen::Vector2d & | point, |
| const Eigen::Vector2d & | prev_point, | ||
| const Eigen::Vector2d & | next_point ) |
Computes a unit vector tangential to a point along a line string.
The tangent is pointing in the average direction of previous to current and current to next point directions.
If two points are equal, the tangent is pointing in the direction from/to the third. If three points are equal, the tangent is undefined and returns (0,0).
| [in] | point | point along line string |
| [in] | prev_point | previous point along line string |
| [in] | next_point | next point along line string |
Definition at line 123 of file geometry.cpp.
| Eigen::Vector2d lanelet2_route_planning::to2d | ( | const Eigen::Vector3d & | point | ) |
Converts a 3D Eigen point to a 2D Eigen point.
Removes the z-coordinate.
| [in] | point | point |
Definition at line 11 of file conversions.cpp.
| std::vector< Eigen::Vector2d > lanelet2_route_planning::to2d | ( | const std::vector< Eigen::Vector3d > & | points | ) |
Converts a vector of 3D Eigen points to a vector of 2D Eigen points.
Removes the z-coordinate.
| [in] | points | points |
Definition at line 17 of file conversions.cpp.
| Eigen::Vector3d lanelet2_route_planning::to3d | ( | const Eigen::Vector2d & | point | ) |
Converts a 2D Eigen point to a 3D Eigen point.
Adds a z-coordinate of 0.
| [in] | point | point |
Definition at line 13 of file conversions.cpp.
| Eigen::Vector3d lanelet2_route_planning::to3d | ( | const Eigen::Vector2d & | point, |
| double | z ) |
Converts a 2D Eigen point to a 3D Eigen point.
Adds the given z-coordinate.
| [in] | point | point |
| [in] | z | z-coordinate |
Definition at line 15 of file conversions.cpp.
| std::vector< Eigen::Vector3d > lanelet2_route_planning::to3d | ( | const std::vector< Eigen::Vector2d > & | points | ) |
Converts a vector of 2D Eigen points to a vector of 3D Eigen points.
Adds a z-coordinate of 0.
| [in] | points | points |
Definition at line 25 of file conversions.cpp.
| Eigen::Vector3d lanelet2_route_planning::toEigen | ( | const geometry_msgs::msg::Point & | point | ) |
Converts a ROS point to a 3D Eigen point.
| [in] | point | point |
Definition at line 51 of file conversions.cpp.
| std::vector< Eigen::Vector2d > lanelet2_route_planning::toEigen | ( | const lanelet::BasicLineString2d & | line_string | ) |
Converts a 2D Lanelet line string to a vector of Eigen points.
| [in] | line_string | line string |
Definition at line 61 of file conversions.cpp.
| std::vector< Eigen::Vector3d > lanelet2_route_planning::toEigen | ( | const lanelet::BasicLineString3d & | line_string | ) |
Converts a 3D Lanelet line string to a vector of Eigen points.
| [in] | line_string | line string |
Definition at line 65 of file conversions.cpp.
| Eigen::Vector2d lanelet2_route_planning::toEigen2d | ( | const geometry_msgs::msg::Point & | point | ) |
Converts a ROS point to a 2D Eigen point.
| [in] | point | point |
Definition at line 49 of file conversions.cpp.
| lanelet::BasicPoint2d lanelet2_route_planning::toLanelet | ( | const Eigen::Vector2d & | point | ) |
Converts a 2D Eigen point to a Lanelet point.
| [in] | point | point |
Definition at line 45 of file conversions.cpp.
| lanelet::BasicPoint3d lanelet2_route_planning::toLanelet | ( | const Eigen::Vector3d & | point | ) |
Converts a 3D Eigen point to a Lanelet point.
| [in] | point | point |
Definition at line 47 of file conversions.cpp.
| lanelet::BasicLineString2d lanelet2_route_planning::toLanelet | ( | const std::vector< Eigen::Vector2d > & | line_string | ) |
Converts a vector of 2D Eigen points to a Lanelet line string.
| [in] | line_string | line string |
Definition at line 69 of file conversions.cpp.
| lanelet::BasicLineString3d lanelet2_route_planning::toLanelet | ( | const std::vector< Eigen::Vector3d > & | line_string | ) |
Converts a vector of 3D Eigen points to a Lanelet line string.
| [in] | line_string | line string |
Definition at line 77 of file conversions.cpp.
| geometry_msgs::msg::Point lanelet2_route_planning::toRos | ( | const Eigen::Vector2d & | point | ) |
Converts a 2D Eigen point to a ROS point.
| [in] | point | point |
Definition at line 33 of file conversions.cpp.
| geometry_msgs::msg::Point lanelet2_route_planning::toRos | ( | const Eigen::Vector3d & | point | ) |
Converts a 3D Eigen point to a ROS point.
| [in] | point | point |
Definition at line 35 of file conversions.cpp.
| geometry_msgs::msg::Point lanelet2_route_planning::toRos | ( | const lanelet::BasicPoint2d & | point | ) |
Converts a 2D Lanelet point to a ROS point.
| [in] | point | point |
Definition at line 43 of file conversions.cpp.
| geometry_msgs::msg::Quaternion lanelet2_route_planning::toRosQuaternion | ( | const Eigen::Vector2d & | vector | ) |
Converts a 2D Eigen vector pointing in a specific direction to a ROS quaternion.
The vector is assumed to lie in the xy-plane.
| [in] | vector | vector |
Definition at line 85 of file conversions.cpp.
| double lanelet2_route_planning::wrapAngle | ( | const double | angle | ) |
Wraps an angle to the range [-π, π].
| [in] | angle | angle to wrap |
Definition at line 73 of file geometry.cpp.
|
inlineconstexpr |
Definition at line 34 of file lanelet2_route_planning.hpp.