bark-simulator / carla-interface

Carla-Interface for BARK
9 stars 4 forks source link

Try to import Carla's open drive map in BARK #6

Closed klemense1 closed 5 years ago

klemense1 commented 5 years ago

try out the scenario from the Carla Challenge (https://carlachallenge.org/challenge/nhtsa/) to import the XODR file in BARK and see if it looks similar to Carla

--> is it really according to the standard?

tin1254 commented 5 years ago

In Carla challenge, town 1~6 are used and can be accessed publicly. All the maps are generated by a software called "RoadRunner", which generates maps with openDRIVE v1.4 standard. In addition, the map also annotates the driving direction in "userData". All of those maps cannot be imported directly into BARK, I'll try to look into the reasons later.

Error of importing all maps: .../bark_project/modules/runtime/commons/xodr_parser.py", line 364, in create_cpp_lane_section previous_line = new_lane_section.get_lane_by_position(lane['id']-1).line AttributeError: 'NoneType' object has no attribute 'line'

Error of importing all town 3, 4, 5: .../bark_project/modules/runtime/commons/xodr_parser.py", line 321, in create_cpp_lane new_lane.link = self.create_lane_link(lane["link"]) KeyError: 'link'

klemense1 commented 5 years ago

it is possible that there is a bug in xodr_parser.py. In order to narrow the error down, Can you load it with the open drive viewer (see http://www.opendrive.org/download.html)

Do you get the same error for all maps?

tin1254 commented 5 years ago

The maps can be loaded into the viewer without issue. For the second error, unlike the maps we have, the <link> tag is always under <lane> inside <laneSection> if the type is ["driving", "border", "sidewalk"], in Carla's map the link defination of lane is sometimes under <junction> , I guess that is the reason, at the line if lane.find("link") is not None: in function parse_lane.

tin1254 commented 5 years ago

For the first error, the reason would be if str(lane.get("type")) not in ["driving", "border", "sidewalk"]: continue in parse_lane. Take Town03.xodr Road 0 as example, only lane [3, 2, -1, -2] belong to support lane type, after sorting it will be [-1, 2, -2, 3]. With the call of get_lane_by_position(lane['id']-1) to the function in lane_section.cpp at step 2, LanePosition=1 and only -1 is added as a lane in the object, it returns null ptr.

tin1254 commented 5 years ago

I uploaded the maps as they are not on Carla's github https://github.com/bark-simulator/carla-interface/tree/testing/maps

tin1254 commented 5 years ago

only town 1 and 2 can be imported normally for now, the others show Segmentation Fault I guess the reason would be the sizes of others are too large, town 3~6 are ~2MB and town 1,2 are ~500KB