Commit f8dfee4d authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Modified the example to show on screen all the trajectory point of all links.

parent a3f047d7
......@@ -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)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment