metadriverse/scenarionet

Example databases

Closed this issue ยท 4 comments

Hi!

Thank you for your amazing work! I am looking forward to testing your platform but I had a question regarding the data.
Are you planning to make the databases you built from open source datasets available? As you may know, these datasets are very large and it would be amazing if we can bypass the conversion part.

Thank you! :)

Sorry for the late reply. I didn't find this question until just now :)

Yes, we have such a plan to release some converted data directly, but we have to make sure we don't violate some license terms. Once we finish the check for rules/licenses, we are going to release some of them. Besides, we are figuring out how and where to store these data. There are too many scenarios...

@QuanyiLi Thank you for your response!

For now, I have created the 10,000 PG scenarios using python -m scenarionet.scripts.convert_pg -d pg --num_workers=16 --num_scenarios=10000 and I can visualized them in RGB using python -m scenarionet.run_simulation -d /path/to/database --render --scenario_index. I was wondering if we can also visualize the scenarios in top view?

Another question is is it possible to create specific scenarios with your tool? From what I understand, scenarionet.scripts.convert_pg creates random scenarios and we don't have control over what the scenario is. Can we for example create 10 cut-in scenarios with random speed and distance values?

For enabling top-down view, use the following code after calling env.step():

# render
ret = env.render(mode="topdown", screen_size=(1600, 900), film_size=(10000, 10000), target_vehicle_heading_up=True)
# save image
pygame.image.save(ret, "top_down_{}_{}.png".format(env.current_seed, env.episode_step))

As our scenario description is not like Scenic or OpenScenario, it would be difficult to specify a parameter space for meaningful variables, like the distance to the lead vehicle and so on. In other words, ScenarioNet aims at interacting with scenarios that are collected or recorded instead of being configured by a set of rules. Combined with OpenScenario, I believe CARLA and esmini can do what you want easily. If you are still interested in doing this in MetaDrive, I would suggest you create a scenario (a new Env class) with MetaDrive's API following these steps:

  1. Create an environment inherited from MetaDriveEnv without registering any manager. A map with straight roads and ego cars should be shown when launching this env.
  2. In the env.reset(), create some new cars with obj=engine.spawn_object() and set their velocity by obj.set_velocity
  3. Edit their trajectory for each vehicle and replay the trajectory by setting the cut-in vehicle's position/heading at each frame.
    In this process, a lot of parameters can be edited and specified.

This process is a bit bothering, especially for people who are new to MetaDrive. We are going to provide OpenScenario/Scenic support in the near future.

In addition, if you would like to investigate some new methods for generating safety-critical scenarios, like cut-in scenarios. I think you can try connecting STRIVE and ScenarioNet. That allows you to edit these real-world scenarios, which can not be achieved by CARLA or other simulators.

Thank you for your elaborate explanation @QuanyiLi!

As you mentioned, I'm currently using OSC, CARLA and esmini for my use case but I was investigating new methods and that's how I came across ScenarioNet. Connecting STRIVE and ScenarioNet is a really interesting idea! Thank you for your suggestion!