0
$\begingroup$

Rosanswers logo

Hi, everyone ! I've got a question related to Lanelet2 map creation for Autoware.Auto. First of all i created lanelet2 map with Tier4 tool https://tools.tier4.jp/vector_map_builder_ll2/, but when i tried to put it in map loader, it ran into problems and didn't load one.

[ERROR] [lanelet2_map_provider_exe-12]: process has died [pid 29844, exit code -6, cmd '/home/prius/AutowareAuto/install/lanelet2_map_provider/lib/lanelet2_map_provider/lanelet2_map_provider_exe --ros-args -r __node:=lanelet2_map_provider_node -r __node:=lanelet2_map_provider_node -r __ns:=/had_maps --params-file /home/prius/AutowareAuto/install/autoware_auto_avp_demo/share/autoware_auto_avp_demo/param/lanelet2_map_provider.param.yaml'].

I've decide to test my map by replacing the original one in ms3 AVP demo. The way i did it -> I put my own pcd and osm links to map_publisher.param.yaml, map_publisher_vehicle.param.yaml and lanelet2_map_provider.param.yaml. After that i decide to inspect original autonomous_stuff osm map and my one created in tier4 web tool. As i see there are different generator type, version and format.

autonomoustuff_parkin_lot.osm ->

<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.6' generator='JOSM'>
  <node id='1001' visible='true' version='1' lat='37.38143282929' lon='-121.90825956337'>
    <tag k='ele' v='-1.4483755826950073' />
  </node>

my_own_map.osm (created with Tier4 web tool) ->

<?xml version="1.0" encoding="UTF-8"?>
<generator="VMB">
  <MetaInfo format_version="1" map_version="2"/>
  <node id="22" lat="" lon="">
    <tag k="mgrs_code" v="99XXX0-2001"/>
    <tag k="local_x" v="-111.9826"/>
    <tag k="local_y" v="192.4938"/>
    <tag k="ele" v="-18.5134"/>
  </node>

As i found out there is special JOSM editor for Open street maps and lanelet extension for it. I tried to create osm map with JOSM editor. And i'm faced with such issue, every node in original autonomous_stuff.osm map has tags (ele, x, y). When i draw nodes in JOSM these tags don't creating themselves. of course i can create these tags manually, but i don't know what values must be there. Also when i created lanelet map with tier4 web tool these tags was created by default. I thought that i can open my map from josm in https://tools.tier4.jp/vector_map_builder_ll2/ and add these tags in some automatic way, but this tier4 web tool rejects this map for missing ele tags.

Also as i know there is third way to create lanelet2 map, it's autocore.ai MapToolbox, but i hope that first two approaches must be workable. But anyway i'll try to build one more map in this unity extension toolbox.

UPD:

  1. I've tried to import and export original autonomoustuff_parking_lot.osm in tier4 web tool, after that lanelet map becomes invalid to use in autoware.auto. One more proof of incompatibility.

  2. I've tried to create map in unity editor with autocore-ai map tool for lanelet2 maps. I used autoware_auto branch, and it has bag that not allowed to save map. I changed save function to master branch version and save lanelet map, but in this case resulting map doesn't work with lanelet2_map_provider.

  3. I tried to fix small sample lanelet map in manual way, but there are still error messages in rviz. And no lanelet visualization. ERROR: center_lane_line/1112 Contains invalid floating point values (nans or infs) Yes i inspect map topic, and there is nans in message. But there is no center_line in the map, maybe it creates by map loader, but why in this case it is wrong...

Example of small sample lanelet2 map from tier4 web tool:

<?xml version="1.0" encoding="UTF-8"?> 
<osm generator="VMB"> 
  <MetaInfo format_version="1" map_version="0.6"/> 
  <node id="1105" visible='true' version='1' lat="55.0067654205581" lon="35.87257570728888"> 
    <tag k="mgrs_code" v="37UCB000000"/> 
    <tag k="local_x" v="10.8885"/> 
    <tag k="local_y" v="17.4909"/> 
    <tag k="ele" v="0.6262"/> 
  </node> 
  <node id="1106" visible='true' version='1' lat="55.00669333658489" lon="35.87242688136361"> 
    <tag k="mgrs_code" v="37UCB000000"/> 
    <tag k="local_x" v="1.0159"/> 
    <tag k="local_y" v="9.8994"/> 
    <tag k="ele" v="0.1493"/> 
  </node> 
  <node id="1108" visible='true' version='1' lat="55.00675168351445" lon="35.87259584940539"> 
    <tag k="mgrs_code" v="37UCB000000"/> 
    <tag k="local_x" v="12.1077"/> 
    <tag k="local_y" v="15.9054"/> 
    <tag k="ele" v="0.6262"/> 
  </node> 
  <node id="1109" visible='true' version='1' lat="55.00667959952578" lon="35.872447021931784"> 
    <tag k="mgrs_code" v="37UCB000000"/> 
    <tag k="local_x" v="2.235"/> 
    <tag k="local_y" v="8.3139"/> 
    <tag k="ele" v="0.1493"/> 
  </node> 
  <way id="1107" visible='true'> 
    <nd ref="1105"/> 
    <nd ref="1106"/> 
    <tag k="type" v="line_thin"/> 
    <tag k="subtype" v="solid"/> 
  </way> 
  <way id="1110" visible='true'> 
    <nd ref="1108"/> 
    <nd ref="1109"/> 
    <tag k="type" v="line_thin"/> 
    <tag k="subtype" v="solid"/> 
  </way> 
  <relation id="1111" visible='true' version='1'> 
    <member type="way" role="left" ref="1110"/> 
    <member type="way" role="right" ref="1107"/> 
    <tag k="type" v="lanelet"/> 
    <tag k="subtype" v="road"/> 
    <tag k="speed_limit" v="10"/> 
    <tag k="location" v="urban"/> 
    <tag k="one_way" v="yes"/> 
  </relation> 
</osm> 

Still stumped with map creation ...


Originally posted by Aleksandr Savel'ev on ROS Answers with karma: 146 on 2021-04-15

Post score: 4


Original comments

Comment by Josh Whitley on 2021-04-17:
@mitsudome-r Can you provide guidance here?

Comment by Aleksandr Savel'ev on 2021-04-21:
As i see there are another "users" of Autoware.Auto, that are faced with such issue.

https://github.com/hatem-darweesh/assuremappingtools/issues/50

https://github.com/hatem-darweesh/assuremappingtools/issues/47

https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto/-/issues/1018

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

As far as I know there is no perfect tool to create lanelet2 map for autoware. Recently I had to create a map for a long city road. I did the following:

  1. with JOSM, the lanelet2 plugins and the satellite view, I created all the linestrings. JOSM is great to manipulate lines (cut, split, create circular shapes, etc), however it is absolutely not designed to create complex relations like lanelets, traffic lights and so on.
  2. for this task I used TierIV's vector map tool

Unfortunately both tools are incompatible as is as they produce different output as you saw. So I wrote a small python script to go back and forth and "fix" the map so that both editor can work on the same map. It looks to something like this: https://gitlab.com/vrichard/operational-design-domains/-/blob/master/tools/fix_osm.py (note that this script is a bit old so it may not be complete, it would not be difficult to add the few missing things). Whenever I make a modification to the map with one tool, I use the script right after so that the map stays compatible with TierIV's tool, JOSM and autoware.

Maybe the most important to keep in mind is that TierIV's ignores lat/lon if x/y already exists, yet JOSM ignores x/y and only uses lat/lon. So whenever you want to modify a map modified by TierIV's tool in JOSM, always remove x/y fields (select all then delete or add this to a post process script). The next time you will open the map with TierIV's tool, the tool will convert lat/lon into x/y/mgrs_code

As you can see the process is a bit tedious, but this is by far the best way I have found to create lanelet2 maps.


Originally posted by vrichard with karma: 108 on 2021-04-22

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by Aleksandr Savel'ev on 2021-04-22:
Yes it needs some modification. And resulting format that keep lat lon and x y info, and do not loose JOSM and Tier4 lanelet map builder capability at the same time looks like.

<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.6' generator='JOSM'>
  <node id='22' action='modify' visible='true' version='1' lat='55.00839000086' lon='35.87068198463'>
    <tag k='ele' v='-18.5134' />
    <tag k='local_x' v='-111.9826' />
    <tag k='local_y' v='192.4938' />
    <tag k='mgrs_code' v='37UCB0-2001' />
  </node>

I've got huge help from Mitsudome-san with correct map building rules, i hope he comes back here with more detailed answer soon.

Comment by congphase on 2021-04-24:
Hello @Aleksandr Savel'ev , I'm facing the same issue (I'm one of the guys who you mentioned having the same issue, in above comment). Can you describe how he instructed on what are the rules for creating a runnable map? I'm in a rush at the moment ...

Comment by Aleksandr Savel'ev on 2021-04-26:
Hello @congphase, you are welcome to read my answer, i hope it helps you in map creation.

Comment by rahul14k on 2021-05-10:
Hi,

  1. I am also trying to do the similar.
  2. have created a lanelet2 map using the josm and lg simulator.
  3. I made changes in the autoware_auto_avp_demo for loading the lanelet2 map file and build it.
  4. That lanelet2 map is visible on rviz2 but when I set the initial pose and goal pose on the map, it set the initial position but not the goal position.
  5. I am not sure what I had missed in the creation of lanelet2 map.

Can anyone provide me help regarding the same? Also, I was trying to attach the screenshot and my map file for reference but getting an error.

Regards,

Rahul

Comment by congphase on 2021-05-10:\

That lanelet2 map is visible on rviz2 but when I set the initial pose and goal pose on the map, it set the initial position but not the goal position.

What does the terminal log say when the goal pose failed to be set? If it says something similar: [ERROR] [lanelet2_global_planner_node_exe-14]: process has died [pid 23500, exit code -11, cmd '/home/anhnv/AutowareAuto/install/lanelet2_global_planner_nodes/lib/lanelet2_global_planner_nodes/lanelet2_global_planner_node_exe --ros-args -r __node:=lanelet2_global_planner_node -r __node:=lanelet2_global_planner_node -r __ns:=/planning -r HAD_Map_Client:=/had_maps/HAD_Map_Service -r vehicle_kinematic_state:=/vehicle/vehicle_kinematic_state'], chances are your map lacks the parking rules (as Autoware.Auto currently supports only parking on sparking spots and connected lanes). If it is the case, check this guidance

Failed attaching screenshot.

Upload to an online drive and share the link here

Comment by rahul14k on 2021-05-13:
Hi @congphase,

Thank you for the help, It worked for me. Also is there any demo in Autoware Auto that will work without parking as a goal pose. for example - If I want to drive my ego vehicle from the start point (initial position) to the endpoint (goal position) using autoware_auto.

Comment by congphase on 2021-06-14:
Sorry for the late reply. As far as I know, unfortunately, no. A trajectory can only planned with start and goal post on lanes connected with parking spots. If you don't want to eliminate the dependence on parking slots, you have to modify lanelet2_global_planner node C++ code to your needs.

Comment by RDaneelOlivaw on 2021-06-29:
Hi,

I'm having the issue of "Contains invalid floating point"

@mitsudome-r do you have any idea of what could be the issue?

I post here the link to the osm file: simple.osm

I changed the version and its the most simplest osm file in the world.

I'm starting it with this scripts:

pcl_map_publisher.launch.py

lanelet2_map_provider.launch.py

lanelet2_map_provider.param.yaml

Any ideas of why it could be giving issues ALWAYS in the center lines?

Thanks

$\endgroup$
0
$\begingroup$

Rosanswers logo

Ok, i'll try to share all the tips that i received from @mitsudome-r (citation blocks), and another information that helped me to bring my own pcd and osm(lanelet2) map to Autoware.Auto and visualize it in Rviz. First of all i think it's important to give some clarification about my approach. I decided to use Autoware.Auto ms3_avp_demo as the basis for my demo package. And for the start the only primitives that i use are lanelet with centerline and parking zone area, no curbs, no traffic lights or anything else. First i made my own pcd map by standard ndt_mapping, after that filtered it and binarized with builtin pcl_tools. Second step was creating lanelet2 map with Autoware web tool https://tools.tier4.jp/vector_map_builder_ll2 . It's important to know, when you load your pcd and after that create Lanelet2 map it's necessarily to define correct "MGRS grid zone" and "MGRS 100,000-meter square" in the corresponding pop-up dialog window, otherwise nothing works. You can find it at any online services, for example i used this one https://mgrs-mapper.com/app , all you need is only find your map location on earth map and take value of MGRS zone from information string. For example MGRS: 46U DH , MGRS grid zone: 46U and MGRS 100,000-meter square: DH. Third step, export the created map ( ̶a̶n̶d̶ ̶b̶e̶ ̶h̶a̶p̶p̶y̶,̶ ̶b̶e̶c̶a̶u̶s̶e̶ ̶e̶v̶e̶r̶y̶t̶h̶i̶n̶g̶ ̶w̶o̶r̶k̶s̶)̶ and faced with some issues ). Actually i tried to load my pcd and osm map instead of default ms3_avp_demo maps, and run it. The way i did it:

put my osm and pcd maps files in
/home/user/AutowareAuto/src/tools/autoware_auto_avp_demo/data

define path to my osm file in /home/user/AutowareAuto/src/tools/autoware_auto_avp_demo/param/lanelet2_map_provider.param.yaml

define path to my pcd map in /home/user/AutowareAuto/src/tools/autoware_auto_avp_demo/param/map_publisher.param.yaml

modify map_yaml_file path in src/tools/autoware_auto_avp_demo/param/map_publisher.param.yaml to the local file that you modified instead of path to the param file installed in /opt. (e.g. "/home/user/AutowareAuto/src/tools/autoware_auto_avp_demo/data/autonomoustuff_parking_lot_lgsvl.yaml"

define correct latitude longitude origins of my map for alignment that are also necessary for visualization in /home/user/AutowareAuto/src/tools/autoware_auto_avp_demo/data/autonomoustuff_parking_lot_lgsvl.yaml

After that i run ros2 launch autoware_auto_avp_demo ms3_sim.launch.py and see no map. But there was errors in rviz like this "error: center_lane_line/5544 Contains invalid floating point values (nans or infs)" And here Mitsudome-r helped me again with inspecting my osm map.

I've looked into the map, and it looks like to error message comes from the fact that centerline generated internally is giving error due to invalid lanes. some of the lanes consist of left/right boundaries with a single point. For example, lanelet 4921 has right bound 4919 which only contains point 4543 as shown in the image. There were 31 more lanelets with similar issue, and the error disappeared from Rviz once I deleted those lanelets. image description

I don't know how i created such wrong lanelets, i definitely didn't do it on purpose, but maybe during creating difficult roundabout circular intersection i made some mistakes.

After that i "successfully" run ms3_sim.launch.py and saw my pointcloud and vector map in rviz. But there was small misalignment.

image description

I fixed misalignment in x y direction by correcting latitude/ longitude in autonomoustuff_parking_lot_lgsvl.yaml, but tweaking RPY parameters in this file had no effect. For RPY correcting i have one more advice from Mitsudome-r:

At the moment, I believe there is no way to rotate in vector map builder, but you can do it with JSOM which is a generic tool to modify OSM files. Install instruction is here https://josm.openstreetmap.de/wiki/Download#LinuxRepositories JOSM requires certain version tags to be specified which is not specified in the map file exported from Tier IV's Vector Map Builder so you might have to modify your map using when you try to load them. The modified map that attached earlier has that change already, but if you have exported again from Vector Map Builder, do the following before loading it to JOSM. Here's the change you have to make: open the map in text editor add version="0.6" to osm element: i.e. replace <osm generator="VMB"> with <osm version="0.6" generator="VMB"> add version="1" to all node, way, and relation elements. If you are using gedit, Open replace dialog(Ctrl+H). Specify id="(.*)" for "Find" and id="\1" version="1" , Tick "Regular expression" option and click Replace All. Then, you should be able to load it in JOSM. After loading in JOSM you can rotate it by first selecting all objects and drag while pressing CTRL+SHIFT.

Another way is to modify pcd map. You can do that by running the following: sudo apt install pcl-tools pcl_transform_point_cloud input.pcd output.pcd -axisangle ax,ay,az,theta

After this minor change in JOSM Editor, i received fine point cloud-vector map vizualization in rviz.

image description

And of course, i would like to thank @mitsudome-r for help, one more time.

If there's some unclear or uncovered things related to map creation process, you are welcome to ask more questions in comments.

P.S. Now i'm on the way to tune my three velodyne sensing configuration to Autoware.Auto.


Originally posted by Aleksandr Savel'ev with karma: 146 on 2021-04-26

This answer was ACCEPTED on the original site

Post score: 7


Original comments

Comment by congphase on 2021-04-26:
Congratulations @Aleksandr Savel'ev. Thank you a lot, a lot, for a very detailed answer. I really appreciate it. I'll try those instructions.

Another quick question, with this successful visualization of pcd & osm, have you successfully planned a trajectory? Is it smooth as you expect? Can you share a screenshot of the generated trajectory? Thank you a lot.

Comment by Aleksandr Savel'ev on 2021-04-26:
Thank you @congphase, i glade to "hear" it. No, now i'm trying to run sensing and localization on real hardware. After that i will go back to working with the map and global planner.

Comment by congphase on 2021-04-26:
Okay @Aleksandr Savel'ev, how did you get support from Mr. mitsudome-r? From private message? How do you get his contact? I'm wondering if I can ask him for support here or via some other channels.

Comment by Aleksandr Savel'ev on 2021-04-26:
@congphase, firstly i asked short question on Autoware slack channel, after that i was asked to do it on ros answers, and only in third step after several days i had a pm chat in slack. It is preferable to start looking for an answer on public resources.

Comment by asobhy on 2021-06-29:
do you have a link to the instructions on how you created the pcd map using ndt_mapping?

Comment by asobhy on 2021-06-29:
there is an ndt_mapping_nodes in AutowareAuto that I will test

Comment by Aleksandr Savel'ev on 2021-06-30:
@asobhy I use ndt mapper from Autoware.AI, i just run it from runtime manager.

Comment by asobhy on 2021-06-30:
Thanks for your reply. FYI, I used ndt_mapping_nodes yesterday and generated a pcd file successfully

Comment by Aleksandr Savel'ev on 2021-08-06:
@asobhy Did you successfully used ndt_mapping_nodes ndt_mapper.launch.py from Autoware.Auto for live Lidar data without any tweaking ?

Comment by OpaOparator on 2021-09-30:
Thanks for the detailed answer! I've met a problem with the different scale showed in rviz between osm and pcd map(the osm map is built from the same pcd map in Vector Map Builder, I'm sure they're aligned well), but the pcd map is 1.2x larger than lanelets of osm map in my rviz. Have you encountered the same issue? @Aleksandr Savel'ev

====== EDIT ======

now I know what cause this issue, that I randomly choose a grid zone code in Vector Map Builder, and then using JOSM to modify the lanelets to another location, this cause the scale issue between pcd map and the osm map

Comment by Aleksandr Savel'ev on 2021-09-30:
@opaoparator That's interesting investigation ) In my case wrong MGRS zone or location of (lat lon) led to absolute disapearing of lanelet map from vizualization plane. But now we know one more "symptom" of wrong location definition.

Comment by Chaitanya on 2022-06-01:
How exactly did you find the problematic nodes in the osm map? I get this error with every generated osm map i try to import. Im not exactly understanding how to use the josm editor to delete the problematic points

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.