20 const std::string &node_name,
24 validity_node = validity_node.
next_sibling(
"validity")) {
25 const auto from_lane = validity_node.attribute(
"fromLane").as_int();
26 const auto to_lane = validity_node.attribute(
"toLane").as_int();
37 const std::string validity =
"validity";
48 const double t_position = signal_node.attribute(
"t").as_double();
49 const road::SignId signal_id = signal_node.attribute(
"id").value();
50 const std::string name = signal_node.attribute(
"name").value();
51 const std::string dynamic = signal_node.attribute(
"dynamic").value();
52 const std::string orientation = signal_node.attribute(
"orientation").value();
53 const double zOffset = signal_node.attribute(
"zOffSet").as_double();
54 const std::string country = signal_node.attribute(
"country").value();
55 const std::string type = signal_node.attribute(
"type").value();
56 const std::string subtype = signal_node.attribute(
"subtype").value();
57 const double value = signal_node.attribute(
"value").as_double();
58 const std::string unit = signal_node.attribute(
"unit").value();
59 const double height = signal_node.attribute(
"height").as_double();
60 const double width = signal_node.attribute(
"width").as_double();
61 const std::string text = signal_node.attribute(
"text").value();
62 const double hOffset = signal_node.attribute(
"hOffset").as_double();
63 const double pitch = signal_node.attribute(
"pitch").as_double();
64 const double roll = signal_node.attribute(
"roll").as_double();
88 auto signal_reference = map_builder.
AddSignal(road,
107 AddValidity(signal_reference, signal_node,
"validity", map_builder);
110 const std::string dependency_id = dependency_node.attribute(
"id").value();
111 const std::string dependency_type = dependency_node.attribute(
"type").value();
112 log_debug(
"Added dependency to signal ", signal_id,
":", dependency_id, dependency_type);
116 const double x = position_node.attribute(
"x").as_double();
117 const double y = position_node.attribute(
"y").as_double();
118 const double z = position_node.attribute(
"z").as_double();
119 const double hdg = position_node.attribute(
"hdg").as_double();
120 const double inertial_pitch = position_node.attribute(
"pitch").as_double();
121 const double inertial_roll = position_node.attribute(
"roll").as_double();
125 hdg, inertial_pitch, inertial_roll);
129 const double s_position = signal_reference_node.attribute(
"s").as_double();
130 const double t_position = signal_reference_node.attribute(
"t").as_double();
131 const road::SignId signal_id = signal_reference_node.attribute(
"id").value();
132 const std::string signal_reference_orientation =
133 signal_reference_node.attribute(
"orientation").value();
136 "Added SignalReference ",
139 signal_reference_orientation);
146 signal_reference_orientation);
147 AddValidity(signal_reference, signal_reference_node,
"validity", map_builder);
void AddSignalPositionInertial(const SignId signal_id, const double x, const double y, const double z, const double hdg, const double pitch, const double roll)
double as_double(double def=0) const
Road * GetRoad(const RoadId road_id)
element::RoadInfoSignal * AddSignalReference(Road *road, const SignId signal_id, const double s_position, const double t_position, const std::string signal_reference_orientation)
unsigned int as_uint(unsigned int def=0) const
xml_node next_sibling() const
void AddDependencyToSignal(const SignId signal_id, const std::string dependency_id, const std::string dependency_type)
This file contains definitions of common data structures used in traffic manager. ...
xml_attribute attribute(const char_t *name) const
static void log_debug(Args &&...)
void AddValidityToSignalReference(element::RoadInfoSignal *signal_reference, const LaneId from_lane, const LaneId to_lane)
xml_node child(const char_t *name) const
static void Parse(const pugi::xml_document &xml, carla::road::MapBuilder &map_builder)
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)
static void AddValidity(road::element::RoadInfoSignal *signal_reference, pugi::xml_node parent_node, const std::string &node_name, road::MapBuilder &map_builder)
xml_object_range< xml_node_iterator > children() const