From 89f76be971b72f3c52e9eb4658ace116066fec42 Mon Sep 17 00:00:00 2001 From: Sergi Hernandez Juan <shernand@iri.upc.edu> Date: Wed, 17 Feb 2021 09:18:16 +0100 Subject: [PATCH] Solved a bug in the get_prev_segment() function: the next lanes references where used instead of the previous ones. --- src/opendrive_road_segment.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/opendrive_road_segment.cpp b/src/opendrive_road_segment.cpp index 3326af6..bfd6b04 100644 --- a/src/opendrive_road_segment.cpp +++ b/src/opendrive_road_segment.cpp @@ -853,7 +853,7 @@ std::vector<const COpendriveRoadSegment *> COpendriveRoadSegment::get_prev_segme for(unsigned int i=1;i<=this->get_num_right_lanes();i++) { const COpendriveLane &lane=this->get_lane(-i); - for(unsigned int j=0;j<lane.get_num_next_lanes();j++) + for(unsigned int j=0;j<lane.get_num_prev_lanes();j++) { already_present=false; for(unsigned int k=0;k<segment_candidates.size();k++) @@ -875,7 +875,7 @@ std::vector<const COpendriveRoadSegment *> COpendriveRoadSegment::get_prev_segme for(unsigned int i=1;i<=this->get_num_left_lanes();i++) { const COpendriveLane &lane=this->get_lane(i); - for(unsigned int j=0;j<lane.get_num_next_lanes();j++) + for(unsigned int j=0;j<lane.get_num_prev_lanes();j++) { already_present=false; for(unsigned int k=0;k<segment_candidates.size();k++) -- GitLab