small refactor
This commit is contained in:
parent
0302b44bf5
commit
ae672bbfc7
|
@ -15,13 +15,13 @@ namespace opendrive {
|
||||||
namespace parser {
|
namespace parser {
|
||||||
|
|
||||||
void LaneParser::ParseLanes(
|
void LaneParser::ParseLanes(
|
||||||
int32_t road_id,
|
RoadId road_id,
|
||||||
int32_t lane_section_id,
|
int32_t lane_section_id,
|
||||||
const pugi::xml_node &parent_node,
|
const pugi::xml_node &parent_node,
|
||||||
carla::road::MapBuilder &map_builder) {
|
carla::road::MapBuilder &map_builder) {
|
||||||
for (pugi::xml_node lane_node : parent_node.children("lane")) {
|
for (pugi::xml_node lane_node : parent_node.children("lane")) {
|
||||||
|
|
||||||
int32_t lane_id = lane_node.attribute("id").as_int();
|
LaneId lane_id = lane_node.attribute("id").as_int();
|
||||||
|
|
||||||
// Lane Width
|
// Lane Width
|
||||||
for (pugi::xml_node lane_width_node : lane_node.children("width")) {
|
for (pugi::xml_node lane_width_node : lane_node.children("width")) {
|
||||||
|
@ -185,14 +185,14 @@ namespace parser {
|
||||||
|
|
||||||
// Lanes
|
// Lanes
|
||||||
for (pugi::xml_node road_node : open_drive_node.children("road")) {
|
for (pugi::xml_node road_node : open_drive_node.children("road")) {
|
||||||
int32_t road_id = road_node.attribute("id").as_uint();
|
RoadId road_id = road_node.attribute("id").as_uint();
|
||||||
|
|
||||||
for (pugi::xml_node lanes_node : road_node.children("lanes")) {
|
for (pugi::xml_node lanes_node : road_node.children("lanes")) {
|
||||||
int32_t lane_section_id = 0;
|
int32_t lane_section_id = 0;
|
||||||
for (pugi::xml_node lane_section_node : lanes_node.children("laneSection")) {
|
for (pugi::xml_node lane_section_node : lanes_node.children("laneSection")) {
|
||||||
|
|
||||||
pugi::xml_node left_node = lane_section_node.child("left");
|
pugi::xml_node left_node = lane_section_node.child("left");
|
||||||
if (left_node != nullptr) {
|
if (left_node) {
|
||||||
ParseLanes(road_id, lane_section_id, left_node, map_builder);
|
ParseLanes(road_id, lane_section_id, left_node, map_builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace parser {
|
||||||
private:
|
private:
|
||||||
|
|
||||||
static void ParseLanes(
|
static void ParseLanes(
|
||||||
int road_id,
|
RoadId road_id,
|
||||||
int lane_section_id,
|
int lane_section_id,
|
||||||
const pugi::xml_node &parent_node,
|
const pugi::xml_node &parent_node,
|
||||||
carla::road::MapBuilder &map_builder);
|
carla::road::MapBuilder &map_builder);
|
||||||
|
|
Loading…
Reference in New Issue