How to generate base_map.txt from base_map.xml
Hi Guys,
Is there a way to generate base_map.txt file from base_map.xml file?
Thank you, KK
There is a tool for doing this provided in apollo which is: modules/map/tools/proto_map_generator, you need to build it first, then run the programm with parameters which specify the base_map directory.
@hzdsdhr Thanks for the response. I will check and update you if any queries.
@hzdsdhr by building you mean running apollo.sh build? I assume there should be an executable to which I should pass the file location, but I don't know how to get it. I tried compiling it with gcc but it didn't work.
@SanduIrina if you excute bash apollo.sh build ,if would automatically build that code,and you cd into the bazel-bin folder,you could fine the binary file.then you run it with parameter: map_dir and out_dir,it would success generate a base_map.txt and a base_map.bin to the out_put folder.
@gengqx .. I hope you are referring to the below link https://github.com/ApolloAuto/apollo/tree/master/modules/map/data where generation of bin files for map is explained.
I am yet to try the method mentioned by @hzdsdhr to convert txt to xml. Will update here once I give a try.
Thank you.
@kk2491 were you able to convert txt to xml?
@natashadsouza Yes, I was able to convert the base_map.xml to base_map.txt file using proto_map_generator tool.
/apollo$ bazel-bin/modules/map/tools/proto_map_generator --map_dir=/apollo/modules/map/data/map_input_folder --output_dir=/apollo/modules/map/data/map_output_folder
Just curious to know is there a tool to do the reverse conversion ? i.e from base_map.txt to base_map.xml
Thank you, KK
Hi, I tried to to run proto_map_generator on the sample map file in modules/maps/data/sunnyvale_loop, but I am getting the following error.
E0220 16:08:43.812430 10062 opendrive_adapter.cc:52] [] fail to parse opendrive road, Error parse road sample associations F0220 16:08:43.986624 10062 proto_map_generator.cc:39] Check failed: apollo::hdmap::adapter::OpendriveAdapter::LoadData(map_filename, &pb_map) fail to load data from : /apollo/modules/maps/data/sunnyvale_loop/base_map.xml
Can anyone provide me with some insight? Thanks!
@tlin051 I just tried, and it looks like it is not able to read the xml file. Probably those files are hidden as it gets from the docker. I have tried copying the xml file to different directory and but it was not successful.
@kk2491 thanks for trying it out. Did you get similar errors as I did?
You mentioned you were successful in converting the base_map.xml to base_map.txt in your previous comment. Was this referring to your own custom map or any of the example maps provided by Apollo?
@tlin051 Yes, I got the similar errors.
I was referring to the custom map.
@natashadsouza Yes, I was able to convert the base_map.xml to base_map.txt file using proto_map_generator tool.
/apollo$ bazel-bin/modules/map/tools/proto_map_generator --map_dir=/apollo/modules/map/data/map_input_folder --output_dir=/apollo/modules/map/data/map_output_folderJust curious to know is there a tool to do the reverse conversion ? i.e from base_map.txt to base_map.xml
Thank you, KK
Any update on this ?
@kk2491 we do not provide a tool for conversion from .text to .xml
Thanks for the confirmation. We can close the issue.
hi all
How to generate base_map.bin from base_map.txt??