metadriverse / metadrive-scenario

This repo contains scenarios from different source for training and testing autonomous vehicles.
Apache License 2.0
20 stars 2 forks source link

Metadrive-Scenario

This repo contains diverse traffic scenarios for evaluating autonomous vehicles in simulation. All scenarios are reactive and can be ran in MetaDrive Simulator.

teaser

Currently we provide three sources of traffic scenarios:

🛠 Quick Start

Prerequisite: Install MetaDrive first via:

git clone https://github.com/metadriverse/metadrive.git
cd metadrive
pip install -e .

MetaDrive-Scenario Installation:

git clone git@github.com:metadriverse/metadrive-scenario.git
cd metadrive-scenario
pip install -e .

Download Dataset:

  1. Download data from https://github.com/metadriverse/metadrive-scenario/releases.
  2. Place data under metadrive-scenario/metadrive_scenario/dataset

🚕 Examples

We provide an example script:metadrive_scenario/examples/run_scenarios.py, where basic usage and APIs are described. For driving in the synthetic scenarios, run:

python metadrive_scenario/examples/run_scenarios.py  --dataset env_num_3000_start_seed_0_synthetic --scenario_start=0 --scenario_end=3000 

For driving in the real-world Waymo scenarios, run:

python metadrive_scenario/examples/run_scenarios.py  --dataset env_num_1165_waymo --scenario_start=0 --scenario_end=1000 

The scenarios will be built by replaying collected surrounding vehicles' trajectories, while you can add argument --idm_traffic to turn these vehicles into reactive ones.

For both scenario types, you can add the optional argument --manual_control to control the vehicle via w, a, s, d. Also, you can add another argumane --topdown to use 2-D birdeye-view renderer, which is built with pygame.

🏫 Documentation

Refer to Documentation of MetaDrive for detail.

📎 References

If you use MetaDrive in your own work, please cite:

@article{li2022metadrive,
  title={Metadrive: Composing diverse driving scenarios for generalizable reinforcement learning},
  author={Li, Quanyi and Peng, Zhenghao and Feng, Lan and Zhang, Qihang and Xue, Zhenghai and Zhou, Bolei},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
  year={2022}
}