apollo icon indicating copy to clipboard operation
apollo copied to clipboard

HD Map Creator

Open enesemre opened this issue 6 years ago • 25 comments

I want to create apollo open drive from open drive (.xodr file) . How can I do that with this package ? Any suggestion?

enesemre avatar May 04 '20 23:05 enesemre

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.

daohu527 avatar May 05 '20 08:05 daohu527

Yes I know but I really didnt understand how apollo convert open drive to apollo open drive. Any clear document about it?

enesemre avatar May 05 '20 09:05 enesemre

It would be better to read the code. I did not find the relevant doc.

daohu527 avatar May 05 '20 09:05 daohu527

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"

daohu527 avatar May 09 '20 01:05 daohu527

Thanks for your answer . I need to build apollo in docker looks like . Which release of apollo do you use for this process?

enesemre avatar May 10 '20 12:05 enesemre

The Apollo 5.0 is ok, other version will ok too if they have sim_map_generator

daohu527 avatar May 10 '20 13:05 daohu527

Is there any way to convert Apollo .xml files to .xodr format ?

whuxhzhang avatar Jul 03 '20 07:07 whuxhzhang

Hello,everyone! where can i get apollo opendrive sample data?

JackRen88 avatar Aug 08 '20 15:08 JackRen88

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/

wangzhensuo avatar Jan 05 '21 06:01 wangzhensuo

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 avatar Jan 05 '21 08:01 daohu527

@daohu527 thank you for point me a correct direction. thank you !

wangzhensuo avatar Jan 05 '21 12:01 wangzhensuo

You're welcome, I have always wanted to write a conversion tool, but time is limited, maybe you can write and publish it

daohu527 avatar Jan 05 '21 14:01 daohu527

@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 !

wangzhensuo avatar Jan 06 '21 00:01 wangzhensuo

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 avatar Jan 06 '21 00:01 daohu527

@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

wangzhensuo avatar Jan 08 '21 07:01 wangzhensuo

@daohu527 Hello, thank you for your detailed answer. When I recitify my code, I meet some questions.

  1. Which the version of apollo do you use? I currently use apollo 2.5.
  2. How to cite asbl header files?
  3. Whether any xodr file can be converted to sim_map?

Your answers are very important for me. Thankyou for your help.

shandaolu avatar Apr 15 '21 09:04 shandaolu

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

daohu527 avatar Apr 15 '21 09:04 daohu527

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.

shandaolu avatar Apr 15 '21 10:04 shandaolu

There is currently no good solution to this problem but do some adapt in "modules\map\hdmap\adapter\xml_parser"

daohu527 avatar Apr 16 '21 00:04 daohu527

Hi,@wangzhensuo Do you have "apollo opendrive specification", could you please send it to [email protected]? thank you !

InterKnight avatar Jun 12 '21 13:06 InterKnight