Apollo 10.0
自动驾驶开放平台
hdmap.cc
浏览该文件的文档.
1/* Copyright 2017 The Apollo Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14=========================================================================*/
15
17
19
20namespace apollo {
21namespace hdmap {
22
23int HDMap::LoadMapFromFile(const std::string& map_filename) {
24 AINFO << "Loading HDMap: " << map_filename << " ...";
25 return impl_.LoadMapFromFile(map_filename);
26}
27
28int HDMap::LoadMapFromProto(const Map& map_proto) {
29 ADEBUG << "Loading HDMap with header: "
30 << map_proto.header().ShortDebugString();
31 return impl_.LoadMapFromProto(map_proto);
32}
33
35 return impl_.GetLaneById(id);
36}
37
39 return impl_.GetJunctionById(id);
40}
41
43 return impl_.GetAreaById(id);
44}
45
47 return impl_.GetSignalById(id);
48}
49
51 return impl_.GetBarrierGateById(id);
52}
53
55 return impl_.GetCrosswalkById(id);
56}
57
59 return impl_.GetStopSignById(id);
60}
61
63 return impl_.GetYieldSignById(id);
64}
65
67 return impl_.GetClearAreaById(id);
68}
69
71 return impl_.GetSpeedBumpById(id);
72}
73
75 return impl_.GetOverlapById(id);
76}
77
79 return impl_.GetRoadById(id);
80}
81
85
87 return impl_.GetPNCJunctionById(id);
88}
89
90int HDMap::GetLanes(const apollo::common::PointENU& point, double distance,
91 std::vector<LaneInfoConstPtr>* lanes) const {
92 return impl_.GetLanes(point, distance, lanes);
93}
94
95int HDMap::GetJunctions(const apollo::common::PointENU& point, double distance,
96 std::vector<JunctionInfoConstPtr>* junctions) const {
97 return impl_.GetJunctions(point, distance, junctions);
98}
99
100int HDMap::GetAreas(const apollo::common::PointENU& point, double distance,
101 std::vector<AreaInfoConstPtr>* areas) const {
102 return impl_.GetAreas(point, distance, areas);
103}
104
105int HDMap::GetSignals(const apollo::common::PointENU& point, double distance,
106 std::vector<SignalInfoConstPtr>* signals) const {
107 return impl_.GetSignals(point, distance, signals);
108}
109
111 const apollo::common::PointENU& point, double distance,
112 std::vector<BarrierGateInfoConstPtr>* barrier_gates) const {
113 return impl_.GetBarrierGates(point, distance, barrier_gates);
114}
115
116int HDMap::GetCrosswalks(const apollo::common::PointENU& point, double distance,
117 std::vector<CrosswalkInfoConstPtr>* crosswalks) const {
118 return impl_.GetCrosswalks(point, distance, crosswalks);
119}
120
121int HDMap::GetStopSigns(const apollo::common::PointENU& point, double distance,
122 std::vector<StopSignInfoConstPtr>* stop_signs) const {
123 return impl_.GetStopSigns(point, distance, stop_signs);
124}
125
127 const apollo::common::PointENU& point, double distance,
128 std::vector<YieldSignInfoConstPtr>* yield_signs) const {
129 return impl_.GetYieldSigns(point, distance, yield_signs);
130}
131
133 const apollo::common::PointENU& point, double distance,
134 std::vector<ClearAreaInfoConstPtr>* clear_areas) const {
135 return impl_.GetClearAreas(point, distance, clear_areas);
136}
137
139 const apollo::common::PointENU& point, double distance,
140 std::vector<SpeedBumpInfoConstPtr>* speed_bumps) const {
141 return impl_.GetSpeedBumps(point, distance, speed_bumps);
142}
143
144int HDMap::GetRoads(const apollo::common::PointENU& point, double distance,
145 std::vector<RoadInfoConstPtr>* roads) const {
146 return impl_.GetRoads(point, distance, roads);
147}
148
150 const apollo::common::PointENU& point, double distance,
151 std::vector<ParkingSpaceInfoConstPtr>* parking_spaces) const {
152 return impl_.GetParkingSpaces(point, distance, parking_spaces);
153}
154
156 const apollo::common::PointENU& point, double distance,
157 std::vector<PNCJunctionInfoConstPtr>* pnc_junctions) const {
158 return impl_.GetPNCJunctions(point, distance, pnc_junctions);
159}
160
162 const double distance,
163 LaneInfoConstPtr* nearest_lane,
164 double* nearest_s,
165 double* nearest_l) const {
166 return impl_.GetNearestLaneWithDistance(point, distance, nearest_lane,
167 nearest_s, nearest_l);
168}
169
171 LaneInfoConstPtr* nearest_lane, double* nearest_s,
172 double* nearest_l) const {
173 return impl_.GetNearestLane(point, nearest_lane, nearest_s, nearest_l);
174}
175
177 const double distance,
178 const double central_heading,
179 const double max_heading_difference,
180 LaneInfoConstPtr* nearest_lane,
181 double* nearest_s,
182 double* nearest_l) const {
183 return impl_.GetNearestLaneWithHeading(point, distance, central_heading,
184 max_heading_difference, nearest_lane,
185 nearest_s, nearest_l);
186}
187
189 const double distance,
190 const double central_heading,
191 const double max_heading_difference,
192 std::vector<LaneInfoConstPtr>* lanes) const {
193 return impl_.GetLanesWithHeading(point, distance, central_heading,
194 max_heading_difference, lanes);
195}
196
198 const apollo::common::PointENU& point, double radius,
199 std::vector<RoadROIBoundaryPtr>* road_boundaries,
200 std::vector<JunctionBoundaryPtr>* junctions) const {
201 return impl_.GetRoadBoundaries(point, radius, road_boundaries, junctions);
202}
203
205 const apollo::common::PointENU& point, double radius,
206 std::vector<RoadRoiPtr>* road_boundaries,
207 std::vector<JunctionInfoConstPtr>* junctions) const {
208 return impl_.GetRoadBoundaries(point, radius, road_boundaries, junctions);
209}
210
211int HDMap::GetRoi(const apollo::common::PointENU& point, double radius,
212 std::vector<RoadRoiPtr>* roads_roi,
213 std::vector<PolygonRoiPtr>* polygons_roi) {
214 return impl_.GetRoi(point, radius, roads_roi, polygons_roi);
215}
216
218 const apollo::common::PointENU& point, const double distance,
219 std::vector<SignalInfoConstPtr>* signals) const {
220 return impl_.GetForwardNearestSignalsOnLane(point, distance, signals);
221}
222
224 const apollo::common::PointENU& point, const double distance,
225 std::vector<BarrierGateInfoConstPtr>* barrier_gates) const {
226 return impl_.GetForwardNearestBarriersOnLane(point, distance, barrier_gates);
227}
228
230 const Id& id, std::vector<StopSignInfoConstPtr>* stop_signs) const {
231 return impl_.GetStopSignAssociatedStopSigns(id, stop_signs);
232}
233
235 const Id& id, std::vector<LaneInfoConstPtr>* lanes) const {
236 return impl_.GetStopSignAssociatedLanes(id, lanes);
237}
238
240 const std::pair<double, double>& range,
241 Map* local_map) const {
242 return impl_.GetLocalMap(point, range, local_map);
243}
244
246 double distance, double central_heading,
247 double max_heading_difference,
248 std::vector<RSUInfoConstPtr>* rsus) const {
249 return impl_.GetForwardNearestRSUs(point, distance,
250 central_heading,
251 max_heading_difference, rsus);
252}
253
254bool HDMap::GetMapHeader(Header* map_header) const {
255 return impl_.GetMapHeader(map_header);
256}
257
258} // namespace hdmap
259} // namespace apollo
int GetNearestLaneWithHeading(const apollo::common::PointENU &point, const double distance, const double central_heading, const double max_heading_difference, LaneInfoConstPtr *nearest_lane, double *nearest_s, double *nearest_l) const
get the nearest lane within a certain range by pose
int GetAreas(const apollo::common::PointENU &point, double distance, std::vector< AreaInfoConstPtr > *areas) const
get all areas in certain range
int GetRoadBoundaries(const apollo::common::PointENU &point, double radius, std::vector< RoadROIBoundaryPtr > *road_boundaries, std::vector< JunctionBoundaryPtr > *junctions) const
get all road and junctions boundaries within certain range
int GetStopSignAssociatedStopSigns(const Id &id, std::vector< StopSignInfoConstPtr > *stop_signs) const
get all other stop signs associated with a stop sign in the same junction
int GetJunctions(const apollo::common::PointENU &point, double distance, std::vector< JunctionInfoConstPtr > *junctions) const
get all junctions in certain range
int GetBarrierGates(const apollo::common::PointENU &point, double distance, std::vector< BarrierGateInfoConstPtr > *barrier_gates) const
get all barrier_gates in certain range
int GetNearestLane(const apollo::common::PointENU &point, LaneInfoConstPtr *nearest_lane, double *nearest_s, double *nearest_l) const
get nearest lane from target point,
OverlapInfoConstPtr GetOverlapById(const Id &id) const
int GetStopSigns(const apollo::common::PointENU &point, double distance, std::vector< StopSignInfoConstPtr > *stop_signs) const
get all stop signs in certain range
StopSignInfoConstPtr GetStopSignById(const Id &id) const
AreaInfoConstPtr GetAreaById(const Id &id) const
int GetLanesWithHeading(const apollo::common::PointENU &point, const double distance, const double central_heading, const double max_heading_difference, std::vector< LaneInfoConstPtr > *lanes) const
get all lanes within a certain range by pose
int LoadMapFromProto(const Map &map_proto)
load map from a protobuf message
Definition hdmap_impl.cc:74
JunctionInfoConstPtr GetJunctionById(const Id &id) const
ParkingSpaceInfoConstPtr GetParkingSpaceById(const Id &id) const
int GetNearestLaneWithDistance(const apollo::common::PointENU &point, const double distance, LaneInfoConstPtr *nearest_lane, double *nearest_s, double *nearest_l) const
get nearest lane from target point with search radius,
CrosswalkInfoConstPtr GetCrosswalkById(const Id &id) const
ClearAreaInfoConstPtr GetClearAreaById(const Id &id) const
int GetRoads(const apollo::common::PointENU &point, double distance, std::vector< RoadInfoConstPtr > *roads) const
get all roads in certain range
SignalInfoConstPtr GetSignalById(const Id &id) const
int GetPNCJunctions(const apollo::common::PointENU &point, double distance, std::vector< PNCJunctionInfoConstPtr > *pnc_junctions) const
get all pnc junctions in certain range
int GetForwardNearestRSUs(const apollo::common::PointENU &point, double distance, double central_heading, double max_heading_difference, std::vector< RSUInfoConstPtr > *rsus) const
get forward nearest rsus within certain range
int GetSignals(const apollo::common::PointENU &point, double distance, std::vector< SignalInfoConstPtr > *signals) const
get all signals in certain range
YieldSignInfoConstPtr GetYieldSignById(const Id &id) const
int GetCrosswalks(const apollo::common::PointENU &point, double distance, std::vector< CrosswalkInfoConstPtr > *crosswalks) const
get all crosswalks in certain range
int GetLocalMap(const apollo::common::PointENU &point, const std::pair< double, double > &range, Map *local_map) const
get a local map which is identical to the origin map except that all map elements without overlap wit...
int GetClearAreas(const apollo::common::PointENU &point, double distance, std::vector< ClearAreaInfoConstPtr > *clear_areas) const
get all clear areas in certain range
int GetRoi(const apollo::common::PointENU &point, double radius, std::vector< RoadRoiPtr > *roads_roi, std::vector< PolygonRoiPtr > *polygons_roi)
get ROI within certain range
PNCJunctionInfoConstPtr GetPNCJunctionById(const Id &id) const
int GetForwardNearestBarriersOnLane(const apollo::common::PointENU &point, const double distance, std::vector< BarrierGateInfoConstPtr > *barrier_gates) const
get forward nearest barrier_gates within certain range on the lane
RoadInfoConstPtr GetRoadById(const Id &id) const
int GetYieldSigns(const apollo::common::PointENU &point, double distance, std::vector< YieldSignInfoConstPtr > *yield_signs) const
get all yield signs in certain range
LaneInfoConstPtr GetLaneById(const Id &id) const
BarrierGateInfoConstPtr GetBarrierGateById(const Id &id) const
bool GetMapHeader(Header *map_header) const
Definition hdmap_impl.cc:66
int GetParkingSpaces(const apollo::common::PointENU &point, double distance, std::vector< ParkingSpaceInfoConstPtr > *parking_spaces) const
get all parking space in certain range
int GetSpeedBumps(const apollo::common::PointENU &point, double distance, std::vector< SpeedBumpInfoConstPtr > *speed_bumps) const
get all speed bumps in certain range
int LoadMapFromFile(const std::string &map_filename)
load map from local file
Definition hdmap_impl.cc:51
int GetForwardNearestSignalsOnLane(const apollo::common::PointENU &point, const double distance, std::vector< SignalInfoConstPtr > *signals) const
get forward nearest signals within certain range on the lane if there are two signals related to one ...
SpeedBumpInfoConstPtr GetSpeedBumpById(const Id &id) const
int GetStopSignAssociatedLanes(const Id &id, std::vector< LaneInfoConstPtr > *lanes) const
get all lanes associated with a stop sign in the same junction
int GetLanes(const apollo::common::PointENU &point, double distance, std::vector< LaneInfoConstPtr > *lanes) const
get all lanes in certain range
StopSignInfoConstPtr GetStopSignById(const Id &id) const
Definition hdmap.cc:58
int GetSpeedBumps(const apollo::common::PointENU &point, double distance, std::vector< SpeedBumpInfoConstPtr > *speed_bumps) const
get all speed bumps in certain range
Definition hdmap.cc:138
PNCJunctionInfoConstPtr GetPNCJunctionById(const Id &id) const
Definition hdmap.cc:86
int GetLanesWithHeading(const apollo::common::PointENU &point, const double distance, const double central_heading, const double max_heading_difference, std::vector< LaneInfoConstPtr > *lanes) const
get all lanes within a certain range by pose
Definition hdmap.cc:188
YieldSignInfoConstPtr GetYieldSignById(const Id &id) const
Definition hdmap.cc:62
int GetSignals(const apollo::common::PointENU &point, double distance, std::vector< SignalInfoConstPtr > *signals) const
get all signals in certain range
Definition hdmap.cc:105
int GetCrosswalks(const apollo::common::PointENU &point, double distance, std::vector< CrosswalkInfoConstPtr > *crosswalks) const
get all crosswalks in certain range
Definition hdmap.cc:116
BarrierGateInfoConstPtr GetBarrierGateById(const Id &id) const
Definition hdmap.cc:50
ClearAreaInfoConstPtr GetClearAreaById(const Id &id) const
Definition hdmap.cc:66
int GetLanes(const apollo::common::PointENU &point, double distance, std::vector< LaneInfoConstPtr > *lanes) const
get all lanes in certain range
Definition hdmap.cc:90
LaneInfoConstPtr GetLaneById(const Id &id) const
Definition hdmap.cc:34
int GetNearestLaneWithHeading(const apollo::common::PointENU &point, const double distance, const double central_heading, const double max_heading_difference, LaneInfoConstPtr *nearest_lane, double *nearest_s, double *nearest_l) const
get the nearest lane within a certain range by pose
Definition hdmap.cc:176
int GetForwardNearestBarriersOnLane(const apollo::common::PointENU &point, const double distance, std::vector< BarrierGateInfoConstPtr > *barrier_gates) const
get forward nearest barrier_gates within certain range on the lane
Definition hdmap.cc:223
int LoadMapFromProto(const Map &map_proto)
load map from a given protobuf message.
Definition hdmap.cc:28
int GetAreas(const apollo::common::PointENU &point, double distance, std::vector< AreaInfoConstPtr > *areas) const
get all areas in certain range
Definition hdmap.cc:100
int GetStopSignAssociatedStopSigns(const Id &id, std::vector< StopSignInfoConstPtr > *stop_signs) const
get all other stop signs associated with a stop sign in the same junction
Definition hdmap.cc:229
int GetParkingSpaces(const apollo::common::PointENU &point, double distance, std::vector< ParkingSpaceInfoConstPtr > *parking_spaces) const
get all parking spaces in certain range
Definition hdmap.cc:149
AreaInfoConstPtr GetAreaById(const Id &id) const
Definition hdmap.cc:42
int GetRoads(const apollo::common::PointENU &point, double distance, std::vector< RoadInfoConstPtr > *roads) const
get all roads in certain range
Definition hdmap.cc:144
int GetForwardNearestRSUs(const apollo::common::PointENU &point, double distance, double central_heading, double max_heading_difference, std::vector< RSUInfoConstPtr > *rsus) const
get forward nearest rsus within certain range
Definition hdmap.cc:245
int GetClearAreas(const apollo::common::PointENU &point, double distance, std::vector< ClearAreaInfoConstPtr > *clear_areas) const
get all clear areas in certain range
Definition hdmap.cc:132
RoadInfoConstPtr GetRoadById(const Id &id) const
Definition hdmap.cc:78
int GetNearestLane(const apollo::common::PointENU &point, LaneInfoConstPtr *nearest_lane, double *nearest_s, double *nearest_l) const
get nearest lane from target point,
Definition hdmap.cc:170
int GetLocalMap(const apollo::common::PointENU &point, const std::pair< double, double > &range, Map *local_map) const
get a local map which is identical to the origin map except that all map elements without overlap wit...
Definition hdmap.cc:239
JunctionInfoConstPtr GetJunctionById(const Id &id) const
Definition hdmap.cc:38
int GetBarrierGates(const apollo::common::PointENU &point, double distance, std::vector< BarrierGateInfoConstPtr > *barrier_gates) const
get all barrier_gates in certain range
Definition hdmap.cc:110
int LoadMapFromFile(const std::string &map_filename)
load map from local file
Definition hdmap.cc:23
OverlapInfoConstPtr GetOverlapById(const Id &id) const
Definition hdmap.cc:74
int GetRoi(const apollo::common::PointENU &point, double radius, std::vector< RoadRoiPtr > *roads_roi, std::vector< PolygonRoiPtr > *polygons_roi)
get ROI within certain range
Definition hdmap.cc:211
int GetPNCJunctions(const apollo::common::PointENU &point, double distance, std::vector< PNCJunctionInfoConstPtr > *pnc_junctions) const
get all pnc junctions in certain range
Definition hdmap.cc:155
ParkingSpaceInfoConstPtr GetParkingSpaceById(const Id &id) const
Definition hdmap.cc:82
int GetRoadBoundaries(const apollo::common::PointENU &point, double radius, std::vector< RoadROIBoundaryPtr > *road_boundaries, std::vector< JunctionBoundaryPtr > *junctions) const
get all road and junctions boundaries within certain range
Definition hdmap.cc:197
int GetNearestLaneWithDistance(const apollo::common::PointENU &point, const double distance, LaneInfoConstPtr *nearest_lane, double *nearest_s, double *nearest_l) const
get nearest lane from target point with search radius,
Definition hdmap.cc:161
bool GetMapHeader(Header *map_header) const
Definition hdmap.cc:254
int GetStopSignAssociatedLanes(const Id &id, std::vector< LaneInfoConstPtr > *lanes) const
get all lanes associated with a stop sign in the same junction
Definition hdmap.cc:234
CrosswalkInfoConstPtr GetCrosswalkById(const Id &id) const
Definition hdmap.cc:54
int GetForwardNearestSignalsOnLane(const apollo::common::PointENU &point, const double distance, std::vector< SignalInfoConstPtr > *signals) const
get forward nearest signals within certain range on the lane if there are two signals related to one ...
Definition hdmap.cc:217
int GetYieldSigns(const apollo::common::PointENU &point, double distance, std::vector< YieldSignInfoConstPtr > *yield_signs) const
get all yield signs in certain range
Definition hdmap.cc:126
SignalInfoConstPtr GetSignalById(const Id &id) const
Definition hdmap.cc:46
int GetJunctions(const apollo::common::PointENU &point, double distance, std::vector< JunctionInfoConstPtr > *junctions) const
get all junctions in certain range
Definition hdmap.cc:95
SpeedBumpInfoConstPtr GetSpeedBumpById(const Id &id) const
Definition hdmap.cc:70
int GetStopSigns(const apollo::common::PointENU &point, double distance, std::vector< StopSignInfoConstPtr > *stop_signs) const
get all stop signs in certain range
Definition hdmap.cc:121
#define ADEBUG
Definition log.h:41
#define AINFO
Definition log.h:42
std::shared_ptr< const PNCJunctionInfo > PNCJunctionInfoConstPtr
std::shared_ptr< const JunctionInfo > JunctionInfoConstPtr
std::shared_ptr< const StopSignInfo > StopSignInfoConstPtr
std::shared_ptr< const AreaInfo > AreaInfoConstPtr
std::shared_ptr< const LaneInfo > LaneInfoConstPtr
std::shared_ptr< const ClearAreaInfo > ClearAreaInfoConstPtr
std::shared_ptr< const BarrierGateInfo > BarrierGateInfoConstPtr
std::shared_ptr< const SignalInfo > SignalInfoConstPtr
std::shared_ptr< const SpeedBumpInfo > SpeedBumpInfoConstPtr
std::shared_ptr< const RoadInfo > RoadInfoConstPtr
std::shared_ptr< const CrosswalkInfo > CrosswalkInfoConstPtr
std::shared_ptr< const YieldSignInfo > YieldSignInfoConstPtr
std::shared_ptr< const ParkingSpaceInfo > ParkingSpaceInfoConstPtr
std::shared_ptr< const OverlapInfo > OverlapInfoConstPtr
class register implement
Definition arena_queue.h:37
optional Header header
Definition map.proto:45