23 std::vector<road::element::CrosswalkPoint> points;
35 std::string name = node_object.attribute(
"name").as_string();
36 if (type ==
"crosswalk") {
43 points.emplace_back(node_corner.attribute(
"u").as_double(),
44 node_corner.attribute(
"v").as_double(),
45 node_corner.attribute(
"z").as_double());
54 node_object.attribute(
"name").as_string(),
55 node_object.attribute(
"s").as_double(),
56 node_object.attribute(
"t").as_double(),
57 node_object.attribute(
"zOffset").as_double(),
58 node_object.attribute(
"hdg").as_double(),
59 node_object.attribute(
"pitch").as_double(),
60 node_object.attribute(
"roll").as_double(),
61 node_object.attribute(
"orientation").as_string(),
62 node_object.attribute(
"width").as_double(),
63 node_object.attribute(
"length").as_double(),
66 }
else if (name.substr(0, 6) ==
"Speed_" || name.substr(0, 6) ==
"speed_") {
67 road::RoadId road_id = node_road.attribute(
"id").as_uint();
70 std::string speed_str;
71 if (name.find(
"STATIC") != std::string::npos) {
72 speed_str = name.substr(13);
74 speed_str = name.substr(6);
76 double speed = std::stod(speed_str);
78 node_object.attribute(
"id").as_string(),
79 node_object.attribute(
"s").as_double(),
80 node_object.attribute(
"t").as_double(),
81 node_object.attribute(
"name").as_string(),
83 node_object.attribute(
"orientation").as_string(),
84 node_object.attribute(
"zOffset").as_double(),
90 node_object.attribute(
"height").as_double(),
91 node_object.attribute(
"width").as_double(),
93 node_object.attribute(
"hdg").as_double(),
94 node_object.attribute(
"pitch").as_double(),
95 node_object.attribute(
"roll").as_double());
96 }
else if (name.find(
"Stencil_STOP") != std::string::npos) {
97 road::RoadId road_id = node_road.attribute(
"id").as_uint();
100 node_object.attribute(
"id").as_string(),
101 node_object.attribute(
"s").as_double(),
102 node_object.attribute(
"t").as_double(),
103 node_object.attribute(
"name").as_string(),
105 node_object.attribute(
"orientation").as_string(),
106 node_object.attribute(
"zOffset").as_double(),
112 node_object.attribute(
"height").as_double(),
113 node_object.attribute(
"width").as_double(),
115 node_object.attribute(
"hdg").as_double(),
116 node_object.attribute(
"pitch").as_double(),
117 node_object.attribute(
"roll").as_double());
void AddRoadObjectCrosswalk(Road *road, const std::string name, const double s, const double t, const double zOffset, const double hdg, const double pitch, const double roll, const std::string orientation, const double width, const double length, const std::vector< road::element::CrosswalkPoint > points)
Road * GetRoad(const RoadId road_id)
unsigned int as_uint(unsigned int def=0) const
This file contains definitions of common data structures used in traffic manager. ...
xml_attribute attribute(const char_t *name) const
static void Parse(const pugi::xml_document &xml, carla::road::MapBuilder &map_builder)
const char_t * as_string(const char_t *def=PUGIXML_TEXT("")) const
xml_node child(const char_t *name) const
element::RoadInfoSignal * AddSignal(Road *road, const SignId signal_id, const double s, const double t, const std::string name, const std::string dynamic, const std::string orientation, const double zOffset, const std::string country, const std::string type, const std::string subtype, const double value, const std::string unit, const double height, const double width, const std::string text, const double hOffset, const double pitch, const double roll)
xml_object_range< xml_node_iterator > children() const