Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with OpenDrive and CommonDrive format #54

Open
samueleruffino99 opened this issue Feb 16, 2024 · 11 comments
Open

Compatibility with OpenDrive and CommonDrive format #54

samueleruffino99 opened this issue Feb 16, 2024 · 11 comments

Comments

@samueleruffino99
Copy link

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

@QuanyiLi
Copy link
Member

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.

@samueleruffino99
Copy link
Author

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.

@QuanyiLi
Copy link
Member

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.

@samueleruffino99
Copy link
Author

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?

@QuanyiLi
Copy link
Member

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.

@samueleruffino99
Copy link
Author

samueleruffino99 commented Feb 20, 2024

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?

@QuanyiLi
Copy link
Member

  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

@mimi89999
Copy link

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?

@QuanyiLi
Copy link
Member

QuanyiLi commented Apr 1, 2024

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

@mimi89999
Copy link

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

@QuanyiLi
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants