30 std::vector<LaneLink> lane_links;
36 std::vector<Connection> connections;
37 std::set<road::ContId> controllers;
43 std::vector<Junction> junctions;
46 junction.id = junction_node.attribute(
"id").as_int();
47 junction.name = junction_node.attribute(
"name").value();
52 Connection connection;
53 connection.id = connection_node.attribute(
"id").as_uint();
54 connection.incoming_road = connection_node.attribute(
"incomingRoad").as_uint();
55 connection.connecting_road = connection_node.attribute(
"connectingRoad").as_uint();
61 lane_link.from = lane_link_node.attribute(
"from").as_int();
62 lane_link.to = lane_link_node.attribute(
"to").as_int();
64 connection.lane_links.push_back(lane_link);
67 junction.connections.push_back(connection);
72 const road::ContId controller_id = controller_node.attribute(
"id").value();
75 junction.controllers.insert(controller_id);
78 junctions.push_back(junction);
82 for (
auto &junction : junctions) {
83 map_builder.
AddJunction(junction.id, junction.name);
84 for (
auto &connection : junction.connections) {
88 connection.incoming_road,
89 connection.connecting_road);
90 for (
auto &lane_link : connection.lane_links) {
void AddJunctionController(const JuncId junction_id, std::set< ContId > &&controllers)
This file contains definitions of common data structures used in traffic manager. ...
xml_node child(const char_t *name) const
void AddLaneLink(const JuncId junction_id, const ConId connection_id, const LaneId from, const LaneId to)
void AddJunction(const JuncId id, const std::string name)
void AddConnection(const JuncId junction_id, const ConId connection_id, const RoadId incoming_road, const RoadId connecting_road)
static void Parse(const pugi::xml_document &xml, carla::road::MapBuilder &map_builder)
xml_object_range< xml_node_iterator > children() const
carla::SharedPtr< carla::client::Junction > Junction