snow-orld / MapEditor

8 stars 0 forks source link

xodr converter not working #1

Open paulsans opened 2 years ago

paulsans commented 2 years ago

Hey,

When I create a simple map with the web editor (just one object and one road, without further modifications), the converter script json_to_opendrive.py fails:

Traceback (most recent call last):
  File "json_to_opendrive.py", line 251, in <module>
    main()
  File "json_to_opendrive.py", line 246, in main
    convert(sys.argv[1])
  File "json_to_opendrive.py", line 55, in convert
    road0 = obj[0]
KeyError: 0

That error was easy to trace back, since the exported json is a dict, not a list:

{
    "lanes": [
        {
            "id": 0,
            "points": [
                121.240834693338,
                30.33411178558101
...

I tried to quick-fix it, but there seems to be a general incomatibility between what is exported and what the converter script expects, so I didn't continue.

snow-orld commented 2 years ago

Hi paulsans, as mentioned in the README.md, you should use the map_raw.json instead of the map.json for the python script to convert.