Autoware.Auto
lanelet2_global_planner.hpp
Go to the documentation of this file.
1 // Copyright 2021 the Autoware Foundation
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 // Co-developed by Tier IV, Inc. and Apex.AI, Inc.
16 
17 #ifndef LANELET2_GLOBAL_PLANNER__LANELET2_GLOBAL_PLANNER_HPP_
18 #define LANELET2_GLOBAL_PLANNER__LANELET2_GLOBAL_PLANNER_HPP_
19 
20 // lanelet2
21 #include <lanelet2_core/primitives/Lanelet.h>
22 #include <lanelet2_io/Io.h>
23 #include <lanelet2_projection/UTM.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 // autoware
31 #include <autoware_auto_msgs/msg/trajectory_point.hpp>
32 #include <common/types.hpp>
33 // c++
34 #include <chrono>
35 #include <string>
36 #include <memory>
37 #include <vector>
38 #include <cmath>
39 #include <unordered_map>
40 #include <regex>
41 
44 
45 namespace autoware
46 {
47 namespace planning
48 {
50 {
51 
53 
54 class LANELET2_GLOBAL_PLANNER_PUBLIC Lanelet2GlobalPlanner
55 {
56 public:
57  Lanelet2GlobalPlanner() = default;
58 
59  void load_osm_map(const std::string & file, float64_t lat, float64_t lon, float64_t alt);
60  void parse_lanelet_element();
61  bool8_t plan_route(
63  std::vector<lanelet::Id> & route) const;
64 
97  TrajectoryPoint refine_pose_by_parking_spot(
98  const lanelet::Id & parking_id,
99  const TrajectoryPoint & input_point) const;
100 
101  bool8_t point_in_parking_spot(
102  const lanelet::Point3d & point, const lanelet::Id & parking_id) const;
103  std::string get_primitive_type(const lanelet::Id & prim_id);
104  lanelet::Id find_nearparking_from_point(const lanelet::Point3d & point) const;
105  lanelet::Id find_nearroute_from_parking(const lanelet::Id & park_id) const;
106  lanelet::Id find_parkingaccess_from_parking(const lanelet::Id & park_id) const;
107  std::vector<lanelet::Id> find_lane_from_parkingaccess(const lanelet::Id & parkaccess_id) const;
108  lanelet::Id find_lane_id(const lanelet::Id & cad_id) const;
109  std::vector<lanelet::Id> get_lane_route(
110  const std::vector<lanelet::Id> & from_id,
111  const std::vector<lanelet::Id> & to) const;
112  bool8_t compute_parking_center(lanelet::Id & parking_id, lanelet::Point3d & parking_center) const;
113  float64_t p2p_euclidean(const lanelet::Point3d & p1, const lanelet::Point3d & p2) const;
114  std::vector<lanelet::Id> lanelet_chr2num(const std::string & str) const;
115  std::vector<lanelet::Id> lanelet_str2num(const std::string & str) const;
116  std::shared_ptr<lanelet::LaneletMap> osm_map;
117 
118 private:
119  std::vector<lanelet::Id> parking_id_list;
120  std::unordered_map<lanelet::Id, std::vector<lanelet::Id>> parking_lane_map;
121  std::unordered_map<lanelet::Id, std::vector<lanelet::Id>> parking2access_map;
122  std::unordered_map<lanelet::Id, std::vector<lanelet::Id>> access2lane_map;
123  std::unordered_map<lanelet::Id, lanelet::Id> near_road_map;
124 };
125 } // namespace lanelet2_global_planner
126 } // namespace planning
127 } // namespace autoware
128 
129 #endif // LANELET2_GLOBAL_PLANNER__LANELET2_GLOBAL_PLANNER_HPP_
lanelet2_global_planner
Definition: lanelet2_global_planner.launch.py:1
motion::motion_testing_nodes::TrajectoryPoint
autoware_auto_msgs::msg::TrajectoryPoint TrajectoryPoint
Definition: motion_testing_publisher.hpp:36
types.hpp
This file includes common type definition.
autoware::common::types::bool8_t
bool bool8_t
Definition: types.hpp:33
autoware
This file defines the lanelet2_map_provider_node class.
Definition: quick_sort.hpp:24
visibility_control.hpp
autoware::planning::lanelet2_global_planner::Lanelet2GlobalPlanner::osm_map
std::shared_ptr< lanelet::LaneletMap > osm_map
Definition: lanelet2_global_planner.hpp:116
autoware::planning::lanelet2_global_planner::Lanelet2GlobalPlanner
Definition: lanelet2_global_planner.hpp:54
autoware::common::types::float64_t
double float64_t
Definition: types.hpp:37
get_open_port.end
end
Definition: scripts/get_open_port.py:23