Apollo  6.0
Open source self driving car software
lanes_xml_parser.h
Go to the documentation of this file.
1 /* Copyright 2017 The Apollo Authors. 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 #pragma once
16 
17 #include <string>
18 #include <vector>
19 
20 #include <tinyxml2.h>
21 
24 
25 namespace apollo {
26 namespace hdmap {
27 namespace adapter {
28 
30  public:
31  static Status Parse(const tinyxml2::XMLElement& xml_node,
32  const std::string& road_id,
33  std::vector<RoadSectionInternal>* sections);
34 
35  private:
36  static Status ParseLaneSection(const tinyxml2::XMLElement& xml_node,
37  std::vector<LaneInternal>* lanes);
38 
39  static Status ParseSectionBoundary(const tinyxml2::XMLElement& xml_node,
40  PbBoundaryPolygon* boundary);
41 
42  static Status ToPbBoundaryType(const std::string& type,
43  PbBoundaryEdgeType* boundary_type);
44  static Status ParseLane(const tinyxml2::XMLElement& xml_node,
45  LaneInternal* lane_internal);
46  static Status ParseDirection(const tinyxml2::XMLElement& xml_node,
47  PbLane* lane);
48  static Status ParseCenterCurve(const tinyxml2::XMLElement& xml_node,
49  PbLane* lane);
50  static Status ParseSpeed(const tinyxml2::XMLElement& xml_node, PbLane* lane);
51  static Status ParseSampleAssociates(const tinyxml2::XMLElement& xml_node,
52  PbLane* lane);
53  static Status ParseSingleSideRoadSampleAssociates(
54  const tinyxml2::XMLElement& xml_node, bool bleft, PbLane* lane);
55  static Status ParseLeftRoadSampleAssociates(
56  const tinyxml2::XMLElement& xml_node, PbLane* lane);
57  static Status ParseRightRoadSampleAssociates(
58  const tinyxml2::XMLElement& xml_node, PbLane* lane);
59  static Status ParseRoadSampleAssociates(const tinyxml2::XMLElement& xml_node,
60  PbLane* lane);
61  static Status ParseObjectOverlapGroup(
62  const tinyxml2::XMLElement& xml_node,
63  std::vector<OverlapWithLane>* object_overlaps);
64  static Status ParseSignalOverlapGroup(
65  const tinyxml2::XMLElement& xml_node,
66  std::vector<OverlapWithLane>* signal_overlaps);
67  static Status ParseJunctionOverlapGroup(
68  const tinyxml2::XMLElement& xml_node,
69  std::vector<OverlapWithLane>* junction_overlaps);
70  static Status ParseLaneOverlapGroup(
71  const tinyxml2::XMLElement& xml_node,
72  std::vector<OverlapWithLane>* lane_overlaps);
73 
74  static Status ToPbLaneType(const std::string& type, PbLaneType* pb_type);
75  static Status ToPbTurnType(const std::string& type, PbTurnType* pb_turn_type);
76  static Status ToPbDirection(const std::string& type,
77  PbLaneDirection* pb_direction);
78 
79  static void ParseLaneLink(const tinyxml2::XMLElement& xml_node, PbLane* lane);
80  static Status ParseLaneBorderMark(const tinyxml2::XMLElement& xml_node,
81  PbLaneBoundaryTypeType* boundary_type);
82  static Status ToPbLaneMarkType(const std::string& type,
83  const std::string& color,
84  PbLaneBoundaryTypeType* boundary_type);
85  static Status ParseRegionOverlap(
86  const tinyxml2::XMLElement& xml_node,
87  std::vector<PbRegionOverlap>* region_overlaps);
88 };
89 
90 } // namespace adapter
91 } // namespace hdmap
92 } // namespace apollo
Definition: lanes_xml_parser.h:29
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
apollo::hdmap::Lane_LaneTurn PbTurnType
Definition: common_define.h:49
apollo::hdmap::Lane_LaneType PbLaneType
Definition: common_define.h:48
static Status Parse(const tinyxml2::XMLElement &xml_node, const std::string &road_id, std::vector< RoadSectionInternal > *sections)
apollo::hdmap::BoundaryPolygon PbBoundaryPolygon
Definition: common_define.h:54
apollo::hdmap::BoundaryEdge_Type PbBoundaryEdgeType
Definition: common_define.h:63
apollo::hdmap::Lane_LaneDirection PbLaneDirection
Definition: common_define.h:59
Definition: common_define.h:106
A general class to denote the return status of an API call. It can either be an OK status for success...
Definition: status.h:43
apollo::hdmap::LaneBoundaryType_Type PbLaneBoundaryTypeType
Definition: common_define.h:52
apollo::hdmap::Lane PbLane
Definition: common_define.h:31