20#include <unordered_map>
24#include "modules/common_msgs/map_msgs/map.pb.h"
25#include "modules/common_msgs/map_msgs/map_area.pb.h"
26#include "modules/common_msgs/map_msgs/map_barrier_gate.pb.h"
27#include "modules/common_msgs/map_msgs/map_clear_area.pb.h"
28#include "modules/common_msgs/map_msgs/map_crosswalk.pb.h"
29#include "modules/common_msgs/map_msgs/map_geometry.pb.h"
30#include "modules/common_msgs/map_msgs/map_junction.pb.h"
31#include "modules/common_msgs/map_msgs/map_lane.pb.h"
32#include "modules/common_msgs/map_msgs/map_overlap.pb.h"
33#include "modules/common_msgs/map_msgs/map_parking_space.pb.h"
34#include "modules/common_msgs/map_msgs/map_pnc_junction.pb.h"
35#include "modules/common_msgs/map_msgs/map_signal.pb.h"
36#include "modules/common_msgs/map_msgs/map_speed_bump.pb.h"
37#include "modules/common_msgs/map_msgs/map_stop_sign.pb.h"
38#include "modules/common_msgs/map_msgs/map_yield_sign.pb.h"
61 using LaneTable = std::unordered_map<std::string, std::shared_ptr<LaneInfo>>;
63 std::unordered_map<std::string, std::shared_ptr<JunctionInfo>>;
64 using AreaTable = std::unordered_map<std::string, std::shared_ptr<AreaInfo>>;
66 std::unordered_map<std::string, std::shared_ptr<SignalInfo>>;
68 std::unordered_map<std::string, std::shared_ptr<BarrierGateInfo>>;
70 std::unordered_map<std::string, std::shared_ptr<CrosswalkInfo>>;
72 std::unordered_map<std::string, std::shared_ptr<StopSignInfo>>;
74 std::unordered_map<std::string, std::shared_ptr<YieldSignInfo>>;
76 std::unordered_map<std::string, std::shared_ptr<ClearAreaInfo>>;
78 std::unordered_map<std::string, std::shared_ptr<SpeedBumpInfo>>;
80 std::unordered_map<std::string, std::shared_ptr<OverlapInfo>>;
81 using RoadTable = std::unordered_map<std::string, std::shared_ptr<RoadInfo>>;
83 std::unordered_map<std::string, std::shared_ptr<ParkingSpaceInfo>>;
85 std::unordered_map<std::string, std::shared_ptr<PNCJunctionInfo>>;
86 using RSUTable = std::unordered_map<std::string, std::shared_ptr<RSUInfo>>;
133 std::vector<AreaInfoConstPtr>* areas)
const;
142 std::vector<LaneInfoConstPtr>* lanes)
const;
151 std::vector<JunctionInfoConstPtr>* junctions)
const;
160 std::vector<CrosswalkInfoConstPtr>* crosswalks)
const;
169 std::vector<SignalInfoConstPtr>* signals)
const;
178 std::vector<BarrierGateInfoConstPtr>* barrier_gates)
const;
187 std::vector<StopSignInfoConstPtr>* stop_signs)
const;
196 std::vector<YieldSignInfoConstPtr>* yield_signs)
const;
205 std::vector<ClearAreaInfoConstPtr>* clear_areas)
const;
214 std::vector<SpeedBumpInfoConstPtr>* speed_bumps)
const;
223 std::vector<RoadInfoConstPtr>* roads)
const;
234 std::vector<ParkingSpaceInfoConstPtr>* parking_spaces)
const;
245 std::vector<PNCJunctionInfoConstPtr>* pnc_junctions)
const;
257 const double distance,
259 double* nearest_s,
double* nearest_l)
const;
271 double* nearest_l)
const;
284 const double distance,
285 const double central_heading,
286 const double max_heading_difference,
288 double* nearest_s,
double* nearest_l)
const;
299 const double distance,
const double central_heading,
300 const double max_heading_difference,
301 std::vector<LaneInfoConstPtr>* lanes)
const;
311 std::vector<RoadROIBoundaryPtr>* road_boundaries,
312 std::vector<JunctionBoundaryPtr>* junctions)
const;
322 std::vector<RoadRoiPtr>* road_boundaries,
323 std::vector<JunctionInfoConstPtr>* junctions)
const;
333 std::vector<RoadRoiPtr>* roads_roi,
334 std::vector<PolygonRoiPtr>* polygons_roi);
346 std::vector<SignalInfoConstPtr>* signals)
const;
357 std::vector<BarrierGateInfoConstPtr>* barrier_gates)
const;
367 const Id&
id, std::vector<StopSignInfoConstPtr>* stop_signs)
const;
376 std::vector<LaneInfoConstPtr>* lanes)
const;
387 const std::pair<double, double>& range,
Map* local_map)
const;
399 double distance,
double central_heading,
400 double max_heading_difference,
401 std::vector<RSUInfoConstPtr>* rsus)
const;
407 std::vector<LaneInfoConstPtr>* lanes)
const;
409 std::vector<JunctionInfoConstPtr>* junctions)
const;
411 std::vector<AreaInfoConstPtr>* areas)
const;
413 std::vector<CrosswalkInfoConstPtr>* crosswalks)
const;
415 std::vector<SignalInfoConstPtr>* signals)
const;
417 std::vector<BarrierGateInfoConstPtr>* barrier_gates)
const;
419 std::vector<StopSignInfoConstPtr>* stop_signs)
const;
421 std::vector<YieldSignInfoConstPtr>* yield_signs)
const;
423 std::vector<ClearAreaInfoConstPtr>* clear_areas)
const;
425 std::vector<SpeedBumpInfoConstPtr>* speed_bumps)
const;
428 std::vector<ParkingSpaceInfoConstPtr>* parking_spaces)
const;
431 std::vector<PNCJunctionInfoConstPtr>* pnc_junctions)
const;
434 double* nearest_l)
const;
436 const double distance,
437 const double central_heading,
438 const double max_heading_difference,
440 double* nearest_s,
double* nearest_l)
const;
442 const double distance,
const double central_heading,
443 const double max_heading_difference,
444 std::vector<LaneInfoConstPtr>* lanes)
const;
446 std::vector<RoadInfoConstPtr>* roads)
const;
448 const double distance,
450 double* nearest_s,
double* nearest_l)
const;
452 template <
class Table,
class BoxTable,
class KDTree>
453 static void BuildSegmentKDTree(
455 BoxTable*
const box_table, std::unique_ptr<KDTree>*
const kdtree);
457 template <
class Table,
class BoxTable,
class KDTree>
458 static void BuildPolygonKDTree(
460 BoxTable*
const box_table, std::unique_ptr<KDTree>*
const kdtree);
462 void BuildLaneSegmentKDTree();
463 void BuildJunctionPolygonKDTree();
464 void BuildCrosswalkPolygonKDTree();
465 void BuildSignalSegmentKDTree();
466 void BuildStopSignSegmentKDTree();
467 void BuildYieldSignSegmentKDTree();
468 void BuildClearAreaPolygonKDTree();
469 void BuildSpeedBumpSegmentKDTree();
470 void BuildParkingSpacePolygonKDTree();
471 void BuildPNCJunctionPolygonKDTree();
472 void BuildAreaPolygonKDTree();
473 void BuildBarrierGateSegmentKDTree();
475 template <
class KDTree>
477 const double radius,
const KDTree& kdtree,
478 std::vector<std::string>*
const results);
500 std::vector<LaneSegmentBox> lane_segment_boxes_;
501 std::unique_ptr<LaneSegmentKDTree> lane_segment_kdtree_;
503 std::vector<JunctionPolygonBox> junction_polygon_boxes_;
504 std::unique_ptr<JunctionPolygonKDTree> junction_polygon_kdtree_;
506 std::vector<AreaPolygonBox> area_polygon_boxes_;
507 std::unique_ptr<AreaPolygonKDTree> area_polygon_kdtree_;
509 std::vector<CrosswalkPolygonBox> crosswalk_polygon_boxes_;
510 std::unique_ptr<CrosswalkPolygonKDTree> crosswalk_polygon_kdtree_;
512 std::vector<SignalSegmentBox> signal_segment_boxes_;
513 std::unique_ptr<SignalSegmentKDTree> signal_segment_kdtree_;
515 std::vector<BarrierGateSegmentBox> barrier_gate_segment_boxes_;
516 std::unique_ptr<BarrierGateSegmentKDTree> barrier_gate_segment_kdtree_;
518 std::vector<StopSignSegmentBox> stop_sign_segment_boxes_;
519 std::unique_ptr<StopSignSegmentKDTree> stop_sign_segment_kdtree_;
521 std::vector<YieldSignSegmentBox> yield_sign_segment_boxes_;
522 std::unique_ptr<YieldSignSegmentKDTree> yield_sign_segment_kdtree_;
524 std::vector<ClearAreaPolygonBox> clear_area_polygon_boxes_;
525 std::unique_ptr<ClearAreaPolygonKDTree> clear_area_polygon_kdtree_;
527 std::vector<SpeedBumpSegmentBox> speed_bump_segment_boxes_;
528 std::unique_ptr<SpeedBumpSegmentKDTree> speed_bump_segment_kdtree_;
530 std::vector<ParkingSpacePolygonBox> parking_space_polygon_boxes_;
531 std::unique_ptr<ParkingSpacePolygonKDTree> parking_space_polygon_kdtree_;
533 std::vector<PNCJunctionPolygonBox> pnc_junction_polygon_boxes_;
534 std::unique_ptr<PNCJunctionPolygonKDTree> pnc_junction_polygon_kdtree_;
Defines the AABox2d class.
Defines the templated AABoxKDTree2dNode class.
Implements a class of 2-dimensional vectors.
High-precision map loader implement.
std::unordered_map< std::string, std::shared_ptr< YieldSignInfo > > YieldSignTable
std::unordered_map< std::string, std::shared_ptr< SignalInfo > > SignalTable
std::unordered_map< std::string, std::shared_ptr< SpeedBumpInfo > > SpeedBumpTable
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
std::unordered_map< std::string, std::shared_ptr< BarrierGateInfo > > BarrierGateTable
std::unordered_map< std::string, std::shared_ptr< StopSignInfo > > StopSignTable
Id CreateHDMapId(const std::string &string_id) const
convert id data type
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,
std::unordered_map< std::string, std::shared_ptr< JunctionInfo > > JunctionTable
OverlapInfoConstPtr GetOverlapById(const Id &id) const
std::unordered_map< std::string, std::shared_ptr< LaneInfo > > LaneTable
std::unordered_map< std::string, std::shared_ptr< OverlapInfo > > OverlapTable
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 GetRoadBoundaries(const apollo::common::PointENU &point, double radius, std::vector< RoadRoiPtr > *road_boundaries, std::vector< JunctionInfoConstPtr > *junctions) const
get all road boundaries and junctions within certain range
int LoadMapFromProto(const Map &map_proto)
load map from a protobuf message
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,
std::unordered_map< std::string, std::shared_ptr< AreaInfo > > AreaTable
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
std::unordered_map< std::string, std::shared_ptr< CrosswalkInfo > > CrosswalkTable
std::unordered_map< std::string, std::shared_ptr< RSUInfo > > RSUTable
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
std::unordered_map< std::string, std::shared_ptr< ParkingSpaceInfo > > ParkingSpaceTable
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
std::unordered_map< std::string, std::shared_ptr< ClearAreaInfo > > ClearAreaTable
LaneInfoConstPtr GetLaneById(const Id &id) const
std::unordered_map< std::string, std::shared_ptr< PNCJunctionInfo > > PNCJunctionTable
BarrierGateInfoConstPtr GetBarrierGateById(const Id &id) const
bool GetMapHeader(Header *map_header) const
RSUInfoConstPtr GetRSUById(const Id &id) const
int GetParkingSpaces(const apollo::common::PointENU &point, double distance, std::vector< ParkingSpaceInfoConstPtr > *parking_spaces) const
get all parking space in certain range
std::unordered_map< std::string, std::shared_ptr< RoadInfo > > RoadTable
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
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
Define the LineSegment2d class.
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 RSUInfo > RSUInfoConstPtr
std::shared_ptr< const YieldSignInfo > YieldSignInfoConstPtr
std::shared_ptr< const ParkingSpaceInfo > ParkingSpaceInfoConstPtr
std::shared_ptr< const OverlapInfo > OverlapInfoConstPtr
Define the Polygon2d class.
Contains parameters of axis-aligned bounding box.