mitsudome-r / autoware

Open-source software for self-driving vehicles
https://www.autoware.ai/
Apache License 2.0
5 stars 2 forks source link

Vector map converter - Crashing with simple lanelet2 file #1

Closed rzerohan closed 5 years ago

rzerohan commented 5 years ago

Hi there,

I am having an issue when trying to convert my lanelet2 map to the vector map format.

I have created a file containing a simple lane, which I have validated using the lanelet2 validator. I try to convert the file with an arbitrarily close origin, however when I run the following:

rosrun vector_map_converter lanelet2vectormap _map_file:=/home/autoware/map_test/test.osm _origin_lat:=-33.01_origin_lon:=115.0

The program crashes with the following stack trace:

/home/autoware/map_test/test.osm
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at

Thread 1 "lanelet2vectorm" received signal SIGABRT, Aborted.
0x00007ffff5e10428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff5e10428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff5e1202a in __GI_abort () at abort.c:89
#2  0x00007ffff675384d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff67516b6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff6751701 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff6751919 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff677a2cf in std::__throw_out_of_range(char const*) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x00007ffff79b5e1d in std::__detail::_Map_base<int, std::pair<int const, std::shared_ptr<autoware_map::Waypoint> >, std::allocator<std::pair<int const, std::shared_ptr<autoware_map::Waypoint> > >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true>, true>::at (this=this@entry=0x7fffffff5f20, __k=@0x696240: 4) at /usr/include/c++/5/bits/hashtable_policy.h:646
#8  0x00007ffff79abe5b in std::unordered_map<int, std::shared_ptr<autoware_map::Waypoint>, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<int const, std::shared_ptr<autoware_map::Waypoint> > > >::at (__k=@0x696240: 4, this=0x7fffffff5f20) at /usr/include/c++/5/bits/unordered_map.h:685
#9  autoware_map::AutowareMapHandler::resolveRelations (this=this@entry=0x7fffffff5dd0) at /home/autoware/Autoware/ros/src/data/packages/autoware_map/lib/autoware_map/map_handler.cpp:292
#10 0x0000000000420e1c in main (argc=1, argv=<optimized out>) at /home/autoware/Autoware/ros/src/data/packages/vector_map_converter/src/lanelet2vectormap.cpp:137

Any advice or help would be greatly appreciated! Thank you!

LANELET2 FILE:

<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.6' generator='JOSM'>
  <node id='402321' visible='true' version='1' lat='-33.45578919404' lon='115.59192046456' />
  <node id='402322' visible='true' version='1' lat='-33.45576569716' lon='115.59193052284' />
  <node id='402324' visible='true' version='1' lat='-33.45574555697' lon='115.59193722837' />
  <node id='402326' visible='true' version='1' lat='-33.45571982228' lon='115.59194594555' />
  <node id='402328' visible='true' version='1' lat='-33.45579646688' lon='115.59194460444' />
  <node id='402329' visible='true' version='1' lat='-33.45577241055' lon='115.59195399217' />
  <node id='402331' visible='true' version='1' lat='-33.45575003257' lon='115.59196136825' />
  <node id='402333' visible='true' version='1' lat='-33.45572485733' lon='115.59197008543' />
  <way id='402323' visible='true' version='1'>
    <nd ref='402321' />
    <nd ref='402322' />
    <nd ref='402324' />
    <nd ref='402326' />
    <tag k='subtype' v='solid' />
    <tag k='type' v='line_thin' />
  </way>
  <way id='402330' visible='true' version='1'>
    <nd ref='402328' />
    <nd ref='402329' />
    <nd ref='402331' />
    <nd ref='402333' />
    <tag k='subtype' v='solid' />
    <tag k='type' v='line_thin' />
  </way>
  <relation id='402494' visible='true' version='1'>
    <member type='way' ref='402323' role='left' />
    <member type='way' ref='402330' role='right' />
    <tag k='location' v='urban' />
    <tag k='name' v='random' />
    <tag k='one_way' v='yes' />
    <tag k='region' v='au' />
    <tag k='subtype' v='road' />
    <tag k='type' v='lanelet' />
  </relation>
</osm>
mitsudome-r commented 5 years ago

Thank you for the report. I have fix the bug with this commit

Please let me know if you have problem anywhere else in the converter.