HD Map Creator
I want to create apollo open drive from open drive (.xodr file) . How can I do that with this package ? Any suggestion?
As I know, there is a xml opendrive reader in "apollo/modules/map/hdmap/adapter/xml_parser". You can transform ".xodr" to ".xml" then use the .xml file in apollo.
Yes I know but I really didnt understand how apollo convert open drive to apollo open drive. Any clear document about it?
It would be better to read the code. I did not find the relevant doc.
1. Open drive to Apollo hd map
I found a way to change open drive(.xodr) to apollo hdmap, which need a little modfiy the code.
https://github.com/ApolloAuto/apollo/blob/01062c85b5c731963eff8dfdf220025f49c25c13/modules/map/tools/sim_map_generator.cc#L106-L126
2. How to
- put the .xodr file into dir "/apollo/modules/map/data/demo/"
- rename the .xodr file to "base_map.xml" (the .xodr file is just a xml file but with different file name suffix)
- modify the sim_map_generator.cc and remove https://github.com/ApolloAuto/apollo/blob/01062c85b5c731963eff8dfdf220025f49c25c13/modules/map/tools/sim_map_generator.cc#L121
- run "./apollo.sh build " to build apollo
- run "./bazel-bin/modules/map/tools/sim_map_generator"
- the generate hd map file is "/tmp/sim_map.bin" and "/tmp/sim_map.txt"
Thanks for your answer . I need to build apollo in docker looks like . Which release of apollo do you use for this process?
The Apollo 5.0 is ok, other version will ok too if they have sim_map_generator
Is there any way to convert Apollo .xml files to .xodr format ?
Hello,everyone! where can i get apollo opendrive sample data?
1. Open drive to Apollo hd map
I found a way to change open drive(.xodr) to apollo hdmap, which need a little modfiy the code.
https://github.com/ApolloAuto/apollo/blob/01062c85b5c731963eff8dfdf220025f49c25c13/modules/map/tools/sim_map_generator.cc#L106-L126
2. How to
1. put the .xodr file into dir "/apollo/modules/map/data/demo/" 2. rename the .xodr file to "base_map.xml" (the .xodr file is just a xml file but with different file name suffix) 3. modify the sim_map_generator.cc and remove https://github.com/ApolloAuto/apollo/blob/01062c85b5c731963eff8dfdf220025f49c25c13/modules/map/tools/sim_map_generator.cc#L121 4. run "./apollo.sh build " to build apollo 5. run "./bazel-bin/modules/map/tools/sim_map_generator" 6. the generate hd map file is "/tmp/sim_map.bin" and "/tmp/sim_map.txt"
base on above, how to generate "routing_map.bin" and "routing_map.txt",please?
I found below cmd that could genereate "routing_map.bin" and "routing_map.txt",but it is based on "base_map.txt".
i only have "base_map.xml(.xodr file rename)".
./bazel-bin/modules/map/tools/sim_map_generator --map_dir ./modules/map/data/demo/
You cannot directly use a opendrive map format in apollo. The Apollo opendrive format is a bit different than normal, you can find some help in https://github.com/ApolloAuto/apollo/issues/3005
@daohu527 thank you for point me a correct direction. thank you !
You're welcome, I have always wanted to write a conversion tool, but time is limited, maybe you can write and publish it
@daohu527 I would like to write this tool,but I don't have "apollo opendrive specification" which may be useful for comparing the difference between normal opendrive file and apollo's opendrive file. I have left email on apollo's github 3005 ,but haven't got it. if you have it,could you send it to [email protected],please? thank you !
I also don't have the spec, I think you can just see the protobuf in modules\map\proto. I wrote some introduction about it link
@daohu527 I compared normal opendrive and apollo's opendrive. It is quite diffenent. The tags is not one-to-one relationship. I 've also seen your note(Dig into Apollo - Map),that's really great help. but I still have no idea about how to convert(even manually).Do you find any rule about it ? the below is code about generating base_map.txt ,if we could extract data from tags in normal opendrive,and call this function. maybe we could generate base_map.txt . is it right(my idea) ? gen base_map.txt
@daohu527 Hello, thank you for your detailed answer. When I recitify my code, I meet some questions.
- Which the version of apollo do you use? I currently use apollo 2.5.
- How to cite asbl header files?
- Whether any xodr file can be converted to sim_map?
Your answers are very important for me. Thankyou for your help.
Which the version of apollo do you use? I currently use apollo 2.5.
apollo 5.0
Whether any xodr file can be converted to sim_map?
I made some mistakes before. sim_map is not a hd map, but it is used by dreamview. The tool from xodr to hdmap needs to be adapted, because apollo's own xml_parse is apollo custom format
Yes, the base_map is hd map. When I use sim_map_generator and proto_map_generator in the tools, I meet the error. The base.xml is the file that I copy from the VTD.
E0415 18:24:53.355163 12055 opendrive_adapter.cc:52] []fail to parse opendrive road, Error parse lane uid
F0415 18:24:53.356544 12055 sim_map_generator.cc:117] Check failed: OpendriveAdapter::LoadData(map_file, &map_pb) []
I also look the issue about converting Fromat. But I have no idear doing this.
There is currently no good solution to this problem but do some adapt in "modules\map\hdmap\adapter\xml_parser"
Hi,@wangzhensuo Do you have "apollo opendrive specification", could you please send it to [email protected]? thank you !