44 std::vector<LaneLink> lane_links;
52 std::vector<Connection> connections;
53 std::set<road::ContId> controllers;
59 std::vector<Junction> junctions;
62 junction.id = junction_node.attribute(
"id").as_int();
63 junction.name = junction_node.attribute(
"name").value();
68 Connection connection;
69 connection.id = connection_node.attribute(
"id").as_uint();
70 connection.incoming_road = connection_node.attribute(
"incomingRoad").as_uint();
71 connection.connecting_road = connection_node.attribute(
"connectingRoad").as_uint();
77 lane_link.from = lane_link_node.attribute(
"from").as_int();
78 lane_link.to = lane_link_node.attribute(
"to").as_int();
80 connection.lane_links.push_back(lane_link);
83 junction.connections.push_back(connection);
88 const road::ContId controller_id = controller_node.attribute(
"id").value();
91 junction.controllers.insert(controller_id);
94 junctions.push_back(junction);
98 for (
auto &junction : junctions) {
99 map_builder.
AddJunction(junction.id, junction.name);
100 for (
auto &connection : junction.connections) {
104 connection.incoming_road,
105 connection.connecting_road);
106 for (
auto &lane_link : connection.lane_links) {
static void Parse(const pugi::xml_document &xml, carla::road::MapBuilder &map_builder)
解析XML文档中的交叉路口信息,并构建道路地图中的交叉路口部分 该函数读取XML文档中的交叉路口数据,如连接点、车道信息等 并使用这些数据来构建或更新道路地图中的交叉路口部分
void AddJunctionController(const JuncId junction_id, std::set< ContId > &&controllers)
void AddJunction(const JuncId id, const std::string name)
void AddLaneLink(const JuncId junction_id, const ConId connection_id, const LaneId from, const LaneId to)
void AddConnection(const JuncId junction_id, const ConId connection_id, const RoadId incoming_road, const RoadId connecting_road)
xml_node child(const char_t *name) const
xml_object_range< xml_node_iterator > children() const