scenario_simulator_v2 C++ API
hdmap_utils.hpp
Go to the documentation of this file.
1 // Copyright 2015 TIER IV, Inc. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef TRAFFIC_SIMULATOR__HDMAP_UTILS__HDMAP_UTILS_HPP_
16 #define TRAFFIC_SIMULATOR__HDMAP_UTILS__HDMAP_UTILS_HPP_
17 
18 #include <geometry_msgs/msg/vector3.h>
19 #include <lanelet2_core/LaneletMap.h>
20 #include <lanelet2_core/geometry/Lanelet.h>
21 #include <lanelet2_core/primitives/BasicRegulatoryElements.h>
22 #include <lanelet2_core/primitives/LaneletSequence.h>
23 #include <lanelet2_matching/LaneletMatching.h>
24 #include <lanelet2_routing/Route.h>
25 #include <lanelet2_routing/RoutingCost.h>
26 #include <lanelet2_routing/RoutingGraph.h>
27 #include <lanelet2_routing/RoutingGraphContainer.h>
28 #include <lanelet2_traffic_rules/TrafficRulesFactory.h>
29 #include <tf2/LinearMath/Matrix3x3.h>
30 
31 #include <autoware_lanelet2_extension/utility/message_conversion.hpp>
32 #include <autoware_lanelet2_extension/utility/query.hpp>
33 #include <autoware_lanelet2_extension/utility/utilities.hpp>
34 #include <autoware_map_msgs/msg/lanelet_map_bin.hpp>
35 #include <boost/filesystem.hpp>
36 #include <geographic_msgs/msg/geo_point.hpp>
40 #include <geometry_msgs/msg/pose_stamped.hpp>
41 #include <map>
42 #include <memory>
43 #include <optional>
44 #include <rclcpp/rclcpp.hpp>
45 #include <string>
46 #include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
52 #include <traffic_simulator_msgs/msg/bounding_box.hpp>
53 #include <traffic_simulator_msgs/msg/entity_status.hpp>
54 #include <tuple>
55 #include <unordered_map>
56 #include <utility>
57 #include <vector>
58 #include <visualization_msgs/msg/marker_array.hpp>
59 
60 namespace hdmap_utils
61 {
62 enum class LaneletType { LANE, CROSSWALK };
63 
65 {
66 public:
67  explicit HdMapUtils(const boost::filesystem::path &, const geographic_msgs::msg::GeoPoint &);
68 
69  auto canChangeLane(
70  const lanelet::Id from, const lanelet::Id to,
72  traffic_simulator::RoutingConfiguration().routing_graph_type) const -> bool;
73 
75  -> std::tuple<
76  std::optional<traffic_simulator_msgs::msg::LaneletPose>, std::optional<lanelet::Id>>;
77 
79  const traffic_simulator_msgs::msg::LaneletPose &, const lanelet::Ids & route_lanelets) const
80  -> std::tuple<
81  std::optional<traffic_simulator_msgs::msg::LaneletPose>, std::optional<lanelet::Id>>;
82 
84  const lanelet::Id, const double s, const lanelet::Ids &,
85  const double forward_distance = 20) const -> std::vector<geometry_msgs::msg::Point>;
86 
87  auto countLaneChanges(
90  const traffic_simulator::RoutingConfiguration & routing_configuration =
91  traffic_simulator::RoutingConfiguration()) const -> std::optional<std::pair<int, int>>;
92 
93  auto filterLaneletIds(const lanelet::Ids &, const char subtype[]) const -> lanelet::Ids;
94 
95  auto generateMarker() const -> visualization_msgs::msg::MarkerArray;
96 
98  -> std::vector<traffic_simulator_msgs::msg::LaneletPose>;
99 
100  auto getAlongLaneletPose(
101  const traffic_simulator_msgs::msg::LaneletPose & from, const double along,
103  traffic_simulator::RoutingConfiguration().routing_graph_type) const
105 
106  auto getCenterPoints(const lanelet::Ids &) const -> std::vector<geometry_msgs::msg::Point>;
107 
108  auto getCenterPoints(const lanelet::Id) const -> std::vector<geometry_msgs::msg::Point>;
109 
110  auto getCenterPointsSpline(const lanelet::Id) const
111  -> std::shared_ptr<math::geometry::CatmullRomSpline>;
112 
113  auto getClosestLaneletId(
114  const geometry_msgs::msg::Pose &, const double distance_thresh = 30.0,
115  const bool include_crosswalk = false) const -> std::optional<lanelet::Id>;
116 
118  const lanelet::Id lanelet_id, const lanelet::Id crossing_lanelet_id) const
119  -> std::optional<double>;
120 
121  auto getConflictingCrosswalkIds(const lanelet::Ids &) const -> lanelet::Ids;
122 
124  const lanelet::Ids &, const traffic_simulator::RoutingGraphType type =
125  traffic_simulator::RoutingConfiguration().routing_graph_type) const
126  -> lanelet::Ids;
127 
129  const lanelet::Ids & route_lanelets,
130  const math::geometry::CatmullRomSplineInterface & spline) const -> std::optional<double>;
131 
133  const lanelet::Ids & route_lanelets,
134  const std::vector<geometry_msgs::msg::Point> & waypoints) const -> std::optional<double>;
135 
137  const lanelet::Ids & route_lanelets,
138  const math::geometry::CatmullRomSplineInterface & spline) const -> std::optional<double>;
139 
141  const lanelet::Ids & route_lanelets,
142  const std::vector<geometry_msgs::msg::Point> & waypoints) const -> std::optional<double>;
143 
146  const lanelet::Id traffic_light_id) const -> std::optional<double>;
147 
149  const std::vector<geometry_msgs::msg::Point> & waypoints,
150  const lanelet::Id traffic_light_id) const -> std::optional<double>;
151 
153  const lanelet::Id current_lanelet_id, const lanelet::Ids & route, const double horizon = 100,
154  const bool include_current_lanelet_id = true,
156  traffic_simulator::RoutingConfiguration().routing_graph_type) const -> lanelet::Ids;
157 
159  const lanelet::Id, const double distance = 100, const bool include_self = true,
161  traffic_simulator::RoutingConfiguration().routing_graph_type) const -> lanelet::Ids;
162 
163  auto getAltitude(const traffic_simulator_msgs::msg::LaneletPose &) const -> double;
164 
166  const geometry_msgs::msg::Pose & from,
167  const traffic_simulator::lane_change::Parameter & lane_change_parameter,
168  const double maximum_curvature_threshold, const double target_trajectory_length,
169  const double forward_distance_threshold) const
170  -> std::optional<std::pair<math::geometry::HermiteCurve, double>>;
171 
174  const traffic_simulator::lane_change::Parameter & lane_change_parameter) const
175  -> std::optional<std::pair<math::geometry::HermiteCurve, double>>;
176 
178  const lanelet::Id, const traffic_simulator::lane_change::Direction,
180  traffic_simulator::RoutingConfiguration().routing_graph_type) const
181  -> std::optional<lanelet::Id>;
182 
184  const lanelet::Id, const traffic_simulator::lane_change::Direction, const std::uint8_t shift,
186  traffic_simulator::RoutingConfiguration().routing_graph_type) const
187  -> std::optional<lanelet::Id>;
188 
189  auto getLaneletIds() const -> lanelet::Ids;
190 
191  auto getLaneletLength(const lanelet::Id) const -> double;
192 
193  auto getLaneletPolygon(const lanelet::Id) const -> std::vector<geometry_msgs::msg::Point>;
194 
195  auto getLanelets(const lanelet::Ids &) const -> lanelet::Lanelets;
196 
197  auto getLateralDistance(
200  const traffic_simulator::RoutingConfiguration & routing_configuration =
201  traffic_simulator::RoutingConfiguration()) const -> std::optional<double>;
202 
203  auto getLeftBound(const lanelet::Id) const -> std::vector<geometry_msgs::msg::Point>;
204 
205  auto getLeftLaneletIds(
206  const lanelet::Id, const traffic_simulator::RoutingGraphType,
207  const bool include_opposite_direction) const -> lanelet::Ids;
208 
212  const traffic_simulator::RoutingConfiguration & routing_configuration =
213  traffic_simulator::RoutingConfiguration()) const -> std::optional<double>;
214 
215  auto getNearbyLaneletIds(
216  const geometry_msgs::msg::Point &, const double distance_threshold,
217  const bool include_crosswalk, const std::size_t search_count = 5) const -> lanelet::Ids;
218 
219  auto getNearbyLaneletIds(
220  const geometry_msgs::msg::Point &, const double distance_threshold,
221  const std::size_t search_count = 5) const -> lanelet::Ids;
222 
223  auto getNextLaneletIds(
224  const lanelet::Ids &, const traffic_simulator::RoutingGraphType type =
225  traffic_simulator::RoutingConfiguration().routing_graph_type) const
226  -> lanelet::Ids;
227 
228  auto getNextLaneletIds(
229  const lanelet::Ids &, const std::string & turn_direction,
231  traffic_simulator::RoutingConfiguration().routing_graph_type) const -> lanelet::Ids;
232 
233  auto getNextLaneletIds(
234  const lanelet::Id, const traffic_simulator::RoutingGraphType type =
235  traffic_simulator::RoutingConfiguration().routing_graph_type) const
236  -> lanelet::Ids;
237 
238  auto getNextLaneletIds(
239  const lanelet::Id, const std::string & turn_direction,
241  traffic_simulator::RoutingConfiguration().routing_graph_type) const -> lanelet::Ids;
242 
244  const lanelet::Ids &, const traffic_simulator::RoutingGraphType type =
245  traffic_simulator::RoutingConfiguration().routing_graph_type) const
246  -> lanelet::Ids;
247 
249  const lanelet::Ids &, const std::string & turn_direction,
251  traffic_simulator::RoutingConfiguration().routing_graph_type) const -> lanelet::Ids;
252 
254  const lanelet::Id, const traffic_simulator::RoutingGraphType type =
255  traffic_simulator::RoutingConfiguration().routing_graph_type) const
256  -> lanelet::Ids;
257 
259  const lanelet::Id, const std::string & turn_direction,
261  traffic_simulator::RoutingConfiguration().routing_graph_type) const -> lanelet::Ids;
262 
263  auto getPreviousLanelets(
264  const lanelet::Id, const double backward_horizon = 100,
266  traffic_simulator::RoutingConfiguration().routing_graph_type) const -> lanelet::Ids;
267 
268  auto getRightBound(const lanelet::Id) const -> std::vector<geometry_msgs::msg::Point>;
269 
270  auto getRightLaneletIds(
271  const lanelet::Id, const traffic_simulator::RoutingGraphType,
272  const bool include_opposite_direction) const -> lanelet::Ids;
273 
274  auto getRightOfWayLaneletIds(const lanelet::Ids &) const
275  -> std::unordered_map<lanelet::Id, lanelet::Ids>;
276 
277  auto getRightOfWayLaneletIds(const lanelet::Id) const -> lanelet::Ids;
278 
279  auto getRoute(
280  const lanelet::Id from, const lanelet::Id to,
281  const traffic_simulator::RoutingConfiguration & routing_configuration =
282  traffic_simulator::RoutingConfiguration()) const -> lanelet::Ids;
283 
284  auto getSpeedLimit(
285  const lanelet::Ids &, const traffic_simulator::RoutingGraphType type =
286  traffic_simulator::RoutingConfiguration().routing_graph_type) const
287  -> double;
288 
289  auto getStopLineIds() const -> lanelet::Ids;
290 
291  auto getStopLineIdsOnPath(const lanelet::Ids & route_lanelets) const -> lanelet::Ids;
292 
293  auto getStopLinePolygon(const lanelet::Id) const -> std::vector<geometry_msgs::msg::Point>;
294 
295  auto getTangentVector(const lanelet::Id, const double s) const
296  -> std::optional<geometry_msgs::msg::Vector3>;
297 
298  auto getTrafficLightBulbPosition(const lanelet::Id traffic_light_id, const std::string &) const
299  -> std::optional<geometry_msgs::msg::Point>;
300 
301  auto getTrafficLightIds() const -> lanelet::Ids;
302 
303  auto getTrafficLightIdsOnPath(const lanelet::Ids & route_lanelets) const -> lanelet::Ids;
304 
305  auto getTrafficLightRegulatoryElement(const lanelet::Id) const -> lanelet::TrafficLight::Ptr;
306 
307  auto getTrafficLightRegulatoryElementIDsFromTrafficLight(const lanelet::Id) const -> lanelet::Ids;
308 
309  auto getTrafficLightStopLineIds(const lanelet::Id traffic_light_id) const -> lanelet::Ids;
310 
311  auto getTrafficLightStopLinesPoints(const lanelet::Id traffic_light_id) const
312  -> std::vector<std::vector<geometry_msgs::msg::Point>>;
313 
314  auto insertMarkerArray(
315  visualization_msgs::msg::MarkerArray &, const visualization_msgs::msg::MarkerArray &) const
316  -> void;
317 
318  auto isInIntersection(const lanelet::Id) const -> bool;
319 
320  auto isInLanelet(const lanelet::Id, const double s) const -> bool;
321 
322  auto isInRoute(const lanelet::Id, const lanelet::Ids & route) const -> bool;
323 
324  auto isTrafficLight(const lanelet::Id) const -> bool;
325 
326  auto isTrafficLightRegulatoryElement(const lanelet::Id) const -> bool;
327 
328 private:
331  constexpr static double DEFAULT_MATCH_TO_LANE_REDUCTION_RATIO = 0.8;
332 
333 public:
334  auto matchToLane(
335  const geometry_msgs::msg::Pose &, const traffic_simulator_msgs::msg::BoundingBox &,
336  const bool include_crosswalk, const double matching_distance = 1.0,
337  const double reduction_ratio = DEFAULT_MATCH_TO_LANE_REDUCTION_RATIO,
339  traffic_simulator::RoutingConfiguration().routing_graph_type) const
340  -> std::optional<lanelet::Id>;
341 
342  auto toLaneletPose(
343  const geometry_msgs::msg::Pose &, const bool include_crosswalk,
344  const double matching_distance = 1.0) const
345  -> std::optional<traffic_simulator_msgs::msg::LaneletPose>;
346 
347  auto toLaneletPose(
348  const geometry_msgs::msg::Pose &, const lanelet::Ids &,
349  const double matching_distance = 1.0) const
350  -> std::optional<traffic_simulator_msgs::msg::LaneletPose>;
351 
352  auto toLaneletPose(
353  const geometry_msgs::msg::Point &, const traffic_simulator_msgs::msg::BoundingBox &,
354  const bool include_crosswalk, const double matching_distance = 1.0,
356  traffic_simulator::RoutingConfiguration().routing_graph_type) const
357  -> std::optional<traffic_simulator_msgs::msg::LaneletPose>;
358 
359  auto toLaneletPose(
360  const geometry_msgs::msg::Pose &, const traffic_simulator_msgs::msg::BoundingBox &,
361  const bool include_crosswalk, const double matching_distance = 1.0,
363  traffic_simulator::RoutingConfiguration().routing_graph_type) const
364  -> std::optional<traffic_simulator_msgs::msg::LaneletPose>;
365 
366  auto toLaneletPose(
367  const geometry_msgs::msg::Pose &, const lanelet::Id, const double matching_distance = 1.0) const
368  -> std::optional<traffic_simulator_msgs::msg::LaneletPose>;
369 
370  auto toLaneletPoses(
371  const geometry_msgs::msg::Pose &, const lanelet::Id, const double matching_distance = 5.0,
372  const bool include_opposite_direction = false,
374  traffic_simulator::RoutingConfiguration().routing_graph_type) const
375  -> std::vector<traffic_simulator_msgs::msg::LaneletPose>;
376 
377  auto toMapBin() const -> autoware_map_msgs::msg::LaneletMapBin;
378 
379  auto toMapPoints(const lanelet::Id, const std::vector<double> & s) const
380  -> std::vector<geometry_msgs::msg::Point>;
381 
382  auto toMapPose(const traffic_simulator_msgs::msg::LaneletPose &, const bool fill_pitch = true)
383  const -> geometry_msgs::msg::PoseStamped;
384 
385  auto isAltitudeMatching(const double current_altitude, const double target_altitude) const
386  -> bool;
387 
388  auto getLaneletAltitude(
389  const lanelet::Id & lanelet_id, const geometry_msgs::msg::Pose & pose,
390  const double matching_distance = 1.0) const -> std::optional<double>;
391 
392 private:
396  // @{
397  mutable CenterPointsCache center_points_cache_;
398  mutable LaneletLengthCache lanelet_length_cache_;
399  // @}
400 
401  lanelet::LaneletMapPtr lanelet_map_ptr_;
402 
403  class RoutingGraphs
404  {
405  public:
406  explicit RoutingGraphs(const lanelet::LaneletMapPtr & lanelet_map);
407 
409  {
410  lanelet::traffic_rules::TrafficRulesPtr rules;
411  lanelet::routing::RoutingGraphPtr graph;
413  };
414 
415  [[nodiscard]] lanelet::routing::RoutingGraphPtr routing_graph(
416  const traffic_simulator::RoutingGraphType type) const;
417 
418  [[nodiscard]] lanelet::traffic_rules::TrafficRulesPtr traffic_rule(
419  const traffic_simulator::RoutingGraphType type) const;
420 
421  [[nodiscard]] auto getRoute(
422  const lanelet::Id from_lanelet_id, const lanelet::Id to_lanelet_id,
423  lanelet::LaneletMapPtr lanelet_map_ptr,
424  const traffic_simulator::RoutingConfiguration & routing_configuration =
425  traffic_simulator::RoutingConfiguration()) -> lanelet::Ids;
426 
427  private:
428  [[nodiscard]] RouteCache & route_cache(const traffic_simulator::RoutingGraphType type);
429 
430  RuleWithGraph vehicle;
431 
432  RuleWithGraph vehicle_with_road_shoulder;
433 
434  RuleWithGraph pedestrian;
435  };
436 
437  std::unique_ptr<RoutingGraphs> routing_graphs_;
438 
439  template <typename Lanelet>
440  auto getLaneletIds(const std::vector<Lanelet> & lanelets) const -> lanelet::Ids
441  {
442  lanelet::Ids ids;
443  std::transform(
444  lanelets.begin(), lanelets.end(), std::back_inserter(ids),
445  [](const auto & lanelet) { return lanelet.id(); });
446  return ids;
447  }
448 
449  auto absoluteHull(
450  const lanelet::BasicPolygon2d & relative_hull, const lanelet::matching::Pose2d &) const
451  -> lanelet::BasicPolygon2d;
452 
453  auto calcEuclidDist(
454  const std::vector<double> & x, const std::vector<double> & y,
455  const std::vector<double> & z) const -> std::vector<double>;
456 
457  auto calculateAccumulatedLengths(const lanelet::ConstLineString3d &) const -> std::vector<double>;
458 
459  auto calculateSegmentDistances(const lanelet::ConstLineString3d &) const -> std::vector<double>;
460 
461  auto excludeSubtypeLanelets(
462  const std::vector<std::pair<double, lanelet::Lanelet>> &, const char subtype[]) const
463  -> std::vector<std::pair<double, lanelet::Lanelet>>;
464 
465  auto filterLanelets(const lanelet::Lanelets &, const char subtype[]) const -> lanelet::Lanelets;
466 
467  auto findNearestIndexPair(
468  const std::vector<double> & accumulated_lengths, const double target_length) const
469  -> std::pair<std::size_t, std::size_t>;
470 
471  auto generateFineCenterline(const lanelet::ConstLanelet &, const double resolution) const
472  -> lanelet::LineString3d;
473 
475  const geometry_msgs::msg::Pose & from, const traffic_simulator_msgs::msg::LaneletPose & to,
477  const double tangent_vector_size = 100) const -> math::geometry::HermiteCurve;
478 
479  auto getStopLines() const -> lanelet::ConstLineStrings3d;
480 
481  auto getStopLinesOnPath(const lanelet::Ids &) const -> lanelet::ConstLineStrings3d;
482 
483  auto getTrafficLightRegulatoryElementsOnPath(const lanelet::Ids &) const
484  -> std::vector<std::shared_ptr<const lanelet::autoware::AutowareTrafficLight>>;
485 
486  auto getTrafficLights(const lanelet::Id traffic_light_id) const
487  -> std::vector<lanelet::AutowareTrafficLightConstPtr>;
488 
489  auto getTrafficSignRegulatoryElementsOnPath(const lanelet::Ids &) const
490  -> std::vector<std::shared_ptr<const lanelet::TrafficSign>>;
491 
492  auto getTrafficSignRegulatoryElements() const
493  -> std::vector<std::shared_ptr<const lanelet::TrafficSign>>;
494 
495  auto getVectorFromPose(const geometry_msgs::msg::Pose &, const double magnitude) const
496  -> geometry_msgs::msg::Vector3;
497 
498  auto mapCallback(const autoware_map_msgs::msg::LaneletMapBin &) const -> void;
499 
500  auto overwriteLaneletsCenterline() -> void;
501 
502  auto resamplePoints(const lanelet::ConstLineString3d &, const std::int32_t num_segments) const
503  -> lanelet::BasicPoints3d;
504 
505  auto toPoint2d(const geometry_msgs::msg::Point &) const -> lanelet::BasicPoint2d;
506 
507  auto toPolygon(const lanelet::ConstLineString3d &) const
508  -> std::vector<geometry_msgs::msg::Point>;
509 };
510 } // namespace hdmap_utils
511 
512 #endif // TRAFFIC_SIMULATOR__HDMAP_UTILS__HDMAP_UTILS_HPP_
Definition: cache.hpp:85
Definition: hdmap_utils.hpp:65
auto getStopLineIds() const -> lanelet::Ids
Definition: hdmap_utils.cpp:1781
auto getTangentVector(const lanelet::Id, const double s) const -> std::optional< geometry_msgs::msg::Vector3 >
Definition: hdmap_utils.cpp:1433
auto getLongitudinalDistance(const traffic_simulator_msgs::msg::LaneletPose &from_pose, const traffic_simulator_msgs::msg::LaneletPose &to_pose, const traffic_simulator::RoutingConfiguration &routing_configuration=traffic_simulator::RoutingConfiguration()) const -> std::optional< double >
Definition: hdmap_utils.cpp:1494
auto getRoute(const lanelet::Id from, const lanelet::Id to, const traffic_simulator::RoutingConfiguration &routing_configuration=traffic_simulator::RoutingConfiguration()) const -> lanelet::Ids
Definition: hdmap_utils.cpp:928
auto toMapPoints(const lanelet::Id, const std::vector< double > &s) const -> std::vector< geometry_msgs::msg::Point >
Definition: hdmap_utils.cpp:1390
HdMapUtils(const boost::filesystem::path &, const geographic_msgs::msg::GeoPoint &)
Definition: hdmap_utils.cpp:60
auto isInIntersection(const lanelet::Id) const -> bool
Definition: hdmap_utils.cpp:1380
auto getCenterPointsSpline(const lanelet::Id) const -> std::shared_ptr< math::geometry::CatmullRomSpline >
Definition: hdmap_utils.cpp:936
auto isAltitudeMatching(const double current_altitude, const double target_altitude) const -> bool
Definition: hdmap_utils.cpp:626
auto getDistanceToTrafficLightStopLine(const lanelet::Ids &route_lanelets, const math::geometry::CatmullRomSplineInterface &spline) const -> std::optional< double >
Definition: hdmap_utils.cpp:1906
auto getStopLineIdsOnPath(const lanelet::Ids &route_lanelets) const -> lanelet::Ids
Definition: hdmap_utils.cpp:1790
auto getTrafficLightStopLinesPoints(const lanelet::Id traffic_light_id) const -> std::vector< std::vector< geometry_msgs::msg::Point >>
Definition: hdmap_utils.cpp:1833
auto getCollisionPointInLaneCoordinate(const lanelet::Id lanelet_id, const lanelet::Id crossing_lanelet_id) const -> std::optional< double >
Definition: hdmap_utils.cpp:343
auto getDistanceToStopLine(const lanelet::Ids &route_lanelets, const math::geometry::CatmullRomSplineInterface &spline) const -> std::optional< double >
Definition: hdmap_utils.cpp:1995
auto getTrafficLightIds() const -> lanelet::Ids
Definition: hdmap_utils.cpp:1102
auto getSpeedLimit(const lanelet::Ids &, const traffic_simulator::RoutingGraphType type=traffic_simulator::RoutingConfiguration().routing_graph_type) const -> double
Definition: hdmap_utils.cpp:753
auto getLeftLaneletIds(const lanelet::Id, const traffic_simulator::RoutingGraphType, const bool include_opposite_direction) const -> lanelet::Ids
Definition: hdmap_utils.cpp:1207
auto getConflictingLaneIds(const lanelet::Ids &, const traffic_simulator::RoutingGraphType type=traffic_simulator::RoutingConfiguration().routing_graph_type) const -> lanelet::Ids
Definition: hdmap_utils.cpp:392
auto isInRoute(const lanelet::Id, const lanelet::Ids &route) const -> bool
Definition: hdmap_utils.cpp:842
auto canChangeLane(const lanelet::Id from, const lanelet::Id to, const traffic_simulator::RoutingGraphType type=traffic_simulator::RoutingConfiguration().routing_graph_type) const -> bool
Definition: hdmap_utils.cpp:1439
auto toLaneletPose(const geometry_msgs::msg::Pose &, const bool include_crosswalk, const double matching_distance=1.0) const -> std::optional< traffic_simulator_msgs::msg::LaneletPose >
Definition: hdmap_utils.cpp:571
auto getRightOfWayLaneletIds(const lanelet::Ids &) const -> std::unordered_map< lanelet::Id, lanelet::Ids >
Definition: hdmap_utils.cpp:1687
auto getRightLaneletIds(const lanelet::Id, const traffic_simulator::RoutingGraphType, const bool include_opposite_direction) const -> lanelet::Ids
Definition: hdmap_utils.cpp:1220
auto filterLaneletIds(const lanelet::Ids &, const char subtype[]) const -> lanelet::Ids
Definition: hdmap_utils.cpp:264
auto getLaneChangeTrajectory(const geometry_msgs::msg::Pose &from, const traffic_simulator::lane_change::Parameter &lane_change_parameter, const double maximum_curvature_threshold, const double target_trajectory_length, const double forward_distance_threshold) const -> std::optional< std::pair< math::geometry::HermiteCurve, double >>
Definition: hdmap_utils.cpp:1288
auto getStopLinePolygon(const lanelet::Id) const -> std::vector< geometry_msgs::msg::Point >
Definition: hdmap_utils.cpp:1855
auto getPreviousLaneletIds(const lanelet::Ids &, const traffic_simulator::RoutingGraphType type=traffic_simulator::RoutingConfiguration().routing_graph_type) const -> lanelet::Ids
Definition: hdmap_utils.cpp:1018
auto canonicalizeLaneletPose(const traffic_simulator_msgs::msg::LaneletPose &) const -> std::tuple< std::optional< traffic_simulator_msgs::msg::LaneletPose >, std::optional< lanelet::Id >>
Definition: hdmap_utils.cpp:149
auto getTrafficLightRegulatoryElement(const lanelet::Id) const -> lanelet::TrafficLight::Ptr
Definition: hdmap_utils.cpp:2159
auto getAltitude(const traffic_simulator_msgs::msg::LaneletPose &) const -> double
Definition: hdmap_utils.cpp:337
auto isTrafficLightRegulatoryElement(const lanelet::Id) const -> bool
Definition: hdmap_utils.cpp:2152
auto getTrafficLightBulbPosition(const lanelet::Id traffic_light_id, const std::string &) const -> std::optional< geometry_msgs::msg::Point >
Definition: hdmap_utils.cpp:1121
auto clipTrajectoryFromLaneletIds(const lanelet::Id, const double s, const lanelet::Ids &, const double forward_distance=20) const -> std::vector< geometry_msgs::msg::Point >
Definition: hdmap_utils.cpp:430
auto toMapPose(const traffic_simulator_msgs::msg::LaneletPose &, const bool fill_pitch=true) const -> geometry_msgs::msg::PoseStamped
Definition: hdmap_utils.cpp:1401
auto getNextLaneletIds(const lanelet::Ids &, const traffic_simulator::RoutingGraphType type=traffic_simulator::RoutingConfiguration().routing_graph_type) const -> lanelet::Ids
Definition: hdmap_utils.cpp:1066
auto toLaneletPoses(const geometry_msgs::msg::Pose &, const lanelet::Id, const double matching_distance=5.0, const bool include_opposite_direction=false, const traffic_simulator::RoutingGraphType type=traffic_simulator::RoutingConfiguration().routing_graph_type) const -> std::vector< traffic_simulator_msgs::msg::LaneletPose >
Definition: hdmap_utils.cpp:701
auto getLeftBound(const lanelet::Id) const -> std::vector< geometry_msgs::msg::Point >
Definition: hdmap_utils.cpp:1195
auto getTrafficLightRegulatoryElementIDsFromTrafficLight(const lanelet::Id) const -> lanelet::Ids
Definition: hdmap_utils.cpp:2167
auto getTrafficLightIdsOnPath(const lanelet::Ids &route_lanelets) const -> lanelet::Ids
Definition: hdmap_utils.cpp:1870
auto getLaneletLength(const lanelet::Id) const -> double
Definition: hdmap_utils.cpp:996
auto getRightBound(const lanelet::Id) const -> std::vector< geometry_msgs::msg::Point >
Definition: hdmap_utils.cpp:1201
auto isTrafficLight(const lanelet::Id) const -> bool
Definition: hdmap_utils.cpp:2138
auto getLaneletIds() const -> lanelet::Ids
Definition: hdmap_utils.cpp:239
auto getFollowingLanelets(const lanelet::Id current_lanelet_id, const lanelet::Ids &route, const double horizon=100, const bool include_current_lanelet_id=true, const traffic_simulator::RoutingGraphType type=traffic_simulator::RoutingConfiguration().routing_graph_type) const -> lanelet::Ids
Definition: hdmap_utils.cpp:847
auto getLaneletAltitude(const lanelet::Id &lanelet_id, const geometry_msgs::msg::Pose &pose, const double matching_distance=1.0) const -> std::optional< double >
Definition: hdmap_utils.cpp:2199
auto generateMarker() const -> visualization_msgs::msg::MarkerArray
Definition: hdmap_utils.cpp:1589
auto getClosestLaneletId(const geometry_msgs::msg::Pose &, const double distance_thresh=30.0, const bool include_crosswalk=false) const -> std::optional< lanelet::Id >
Definition: hdmap_utils.cpp:721
auto getTrafficLightStopLineIds(const lanelet::Id traffic_light_id) const -> lanelet::Ids
Definition: hdmap_utils.cpp:1821
auto getCenterPoints(const lanelet::Ids &) const -> std::vector< geometry_msgs::msg::Point >
Definition: hdmap_utils.cpp:943
auto getLaneletPolygon(const lanelet::Id) const -> std::vector< geometry_msgs::msg::Point >
Definition: hdmap_utils.cpp:248
auto toMapBin() const -> autoware_map_msgs::msg::LaneletMapBin
Definition: hdmap_utils.cpp:1566
auto getLateralDistance(const traffic_simulator_msgs::msg::LaneletPose &from, const traffic_simulator_msgs::msg::LaneletPose &to, const traffic_simulator::RoutingConfiguration &routing_configuration=traffic_simulator::RoutingConfiguration()) const -> std::optional< double >
Definition: hdmap_utils.cpp:1448
auto getAllCanonicalizedLaneletPoses(const traffic_simulator_msgs::msg::LaneletPose &) const -> std::vector< traffic_simulator_msgs::msg::LaneletPose >
Definition: hdmap_utils.cpp:83
auto matchToLane(const geometry_msgs::msg::Pose &, const traffic_simulator_msgs::msg::BoundingBox &, const bool include_crosswalk, const double matching_distance=1.0, const double reduction_ratio=DEFAULT_MATCH_TO_LANE_REDUCTION_RATIO, const traffic_simulator::RoutingGraphType type=traffic_simulator::RoutingConfiguration().routing_graph_type) const -> std::optional< lanelet::Id >
Definition: hdmap_utils.cpp:528
auto getLaneChangeableLaneletId(const lanelet::Id, const traffic_simulator::lane_change::Direction, const traffic_simulator::RoutingGraphType type=traffic_simulator::RoutingConfiguration().routing_graph_type) const -> std::optional< lanelet::Id >
Definition: hdmap_utils.cpp:793
auto getPreviousLanelets(const lanelet::Id, const double backward_horizon=100, const traffic_simulator::RoutingGraphType type=traffic_simulator::RoutingConfiguration().routing_graph_type) const -> lanelet::Ids
Definition: hdmap_utils.cpp:817
auto getLanelets(const lanelet::Ids &) const -> lanelet::Lanelets
Definition: hdmap_utils.cpp:2129
auto isInLanelet(const lanelet::Id, const double s) const -> bool
Definition: hdmap_utils.cpp:1385
auto getConflictingCrosswalkIds(const lanelet::Ids &) const -> lanelet::Ids
Definition: hdmap_utils.cpp:408
auto getNearbyLaneletIds(const geometry_msgs::msg::Point &, const double distance_threshold, const bool include_crosswalk, const std::size_t search_count=5) const -> lanelet::Ids
Definition: hdmap_utils.cpp:299
auto getAlongLaneletPose(const traffic_simulator_msgs::msg::LaneletPose &from, const double along, const traffic_simulator::RoutingGraphType type=traffic_simulator::RoutingConfiguration().routing_graph_type) const -> traffic_simulator_msgs::msg::LaneletPose
Definition: hdmap_utils.cpp:1157
auto insertMarkerArray(visualization_msgs::msg::MarkerArray &, const visualization_msgs::msg::MarkerArray &) const -> void
Definition: hdmap_utils.cpp:1582
auto countLaneChanges(const traffic_simulator_msgs::msg::LaneletPose &from, const traffic_simulator_msgs::msg::LaneletPose &to, const traffic_simulator::RoutingConfiguration &routing_configuration=traffic_simulator::RoutingConfiguration()) const -> std::optional< std::pair< int, int >>
Definition: hdmap_utils.cpp:207
Definition: cache.hpp:127
Definition: cache.hpp:48
Definition: catmull_rom_spline_interface.hpp:30
Definition: cache.hpp:46
LaneletType
Definition: hdmap_utils.hpp:62
Definition: bounding_box.hpp:32
auto distance(const geometry_msgs::Pose &pose1, const geometry_msgs::Pose &pose2)
Definition: detection_sensor.cpp:36
Definition: cache.hpp:27
TrajectoryShape
Definition: lane_change.hpp:31
Direction
Definition: lane_change.hpp:29
RoutingGraphType
Definition: routing_graph_type.hpp:24
traffic_simulator_msgs::msg::LaneletPose LaneletPose
Definition: lanelet_pose.hpp:22
std::string string
Definition: junit5.hpp:26
lanelet::traffic_rules::TrafficRulesPtr rules
Definition: hdmap_utils.hpp:410
RouteCache route_cache
Definition: hdmap_utils.hpp:412
lanelet::routing::RoutingGraphPtr graph
Definition: hdmap_utils.hpp:411
Definition: routing_configuration.hpp:24
parameters for behavior plugin
Definition: lane_change.hpp:75