metadriverse/scenarionet

Compatibility with OpenDrive and CommonDrive format

Opened this issue · 11 comments

Hello,
Do you know whether ScenarioNet format is compatible in some way with OpenDrive and/or CommonDrive data format?

Yes. Just extract lane center lines/polygons and lane lines from these map format. Then the map can be loaded into the simulator. We don't implement such a converter, so you need to do it on your own. We can help with it.

Do you have any reference to both data format used ? Because I would like to measure criticality in nuScenes scenes by CommonRoad-CriMe, metrics here. Maybe it would be easier to just adapt these metrics to your data format instead of convert from nuScenes to ScenarioNet and then to CommonRoad format.

An example of ScenarioNet data format is like this. Basically, it is a dictionary where you have vehicle trajectories/velocities/headings, and map structures represented by polyline and polygons. And everything is explicit and human-readable. The nuScenes data has no explicit format, you have to access everything in the scenario by calling the original APIs which take their database file as input. For OpenDrive, it is a map format stored .xml file which also recorded in lane center lines and lane lines, which can be easily converted from ScenarioNet format (I guess)

Regarding your question, the solution in my mind is using ScenarioNet to extract explicit scenario data from the nuScenes dataset. And then making a data loader for CommonRoad-CriMe, allowing it to parse trajectories and map structures from the dictionary-like ScenarioNet format.

Ok thank you very much!
I will get back to you in case you are interested in also measuring safety/critical scenarios by those metrics.
You do not have any safety metrics in your scenario net tool right?

Indeed, these metrics are missing in both MetaDrive and ScenarioNet but can be useful for training policies, measuring performance, and so on. It is good to have this. Feel free to ask me any questions.

Ok, I will then convert nuScenes (ScenarioNet format) into commonroad format to compute these metrics. However I have some doubts:

  • How can I extract lane boarders (left and right), from boundaries in ScenarioNet?
  • Which is the coordinate system used in ScenarioNet
  • They also extract adjacent lines, do you think it would be possible to extract them from scenarionet?
  1. Lane borders can be retrieved by lane.position(longitudinal, lateral). Just set later to i.e. 1.5 and iterate from long=0 to long=lane.length with a 1-meter interval, and you can extract a lane border. Note: it is likely boarders extracted in this way don't match the solid/dashed lane lines in the dataset. If you want to find a lane line in the dataset as boarder, that could be a bit difficult...
  2. Right-handed coordinates
  3. Some dataset provides connectivity information, but some not. If the original data provides it, it should be stored in map_features as well with keys like entry_lanes, exit_lanes, left/right_neighbours

Hello

I saw that some support for OpenDrive maps was being added in Metadrive. Is it preferred to convert OpenDrive data to scenarionet or to directly add support for OpenDrive in Metadrive?

We are going to directly support OpenDrive in MetaDrive with SUMO's net converter.

Is there any way in which I could help with development?

@mimi89999 Thank you so much. That feature is almost finished and will be released with the SUMO x MetaDrive bridge soon.