From f8dfee4d94d1fda40f37712c97027b96d7feaf49 Mon Sep 17 00:00:00 2001 From: Sergi Hernandez Juan <shernand@iri.upc.edu> Date: Thu, 31 Dec 2020 17:59:30 +0100 Subject: [PATCH] Modified the example to show on screen all the trajectory point of all links. --- src/examples/opendrive_test.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/examples/opendrive_test.cpp b/src/examples/opendrive_test.cpp index 77de272..1f901b8 100644 --- a/src/examples/opendrive_test.cpp +++ b/src/examples/opendrive_test.cpp @@ -6,8 +6,9 @@ int main(int argc, char *argv[]) { + std::vector<double> x,y; COpendriveRoad road; - std::string xml_file="/home/shernand/iri-lab/adc_ws/code/autonomous_driving_tools/src/xml/add_road_full.xodr"; + std::string xml_file="/home/sergi/iri-lab/adc_ws/code/autonomous_driving_tools/src/xml/add_road_full.xodr"; try { @@ -15,7 +16,18 @@ int main(int argc, char *argv[]) road.set_scale_factor(10.0); road.set_min_road_length(0.01); road.load(xml_file); - std::cout << road << std::endl; +// std::cout << road << std::endl; + for(unsigned int i=0;i<road.get_num_nodes();i++) + { + const COpendriveRoadNode &node=road.get_node(i); + for(unsigned int j=0;j<node.get_num_links();j++) + { + const COpendriveLink &link=node.get_link(j); + link.get_trajectory(x,y); + for(unsigned int k=0;k<x.size();k++) + std::cout << x[k] << "," << y[k] << std::endl; + } + } } catch (CException &e) { -- GitLab