Skip to content

This repo contains scenarios from different source for training and testing autonomous vehicles.

License

Notifications You must be signed in to change notification settings

metadriverse/metadrive-scenario

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

  • Synthetic Scenarios: Maps are generated via Procedural Generation (PG). Traffic vehicles are generated and controlled according to rules
    Synthetic Dataset Statistics:
      Number of scenarios: 3000
      Number of traffic vehicles per scene: 8.9±3.1
      Block Distrubution:
        Curve: 0.156
        Straight: 0.331
        Roundabout: 0.077
        T-intersection: 0.074
        Intersection: 0.077
        Ramp (merge): 0.081
        Ramp (diverge): 0.076
        Bottleneck (merge): 0.065
        Bottleneck (diverge): 0.068
    
  • Real-world Scenarios: These scenarios are built from Waymo motion dataset. Maps and surrounding vehicles are collected and recorded in real world.
    Real-world Dataset Statistics:
      Number of scenarios: 1165
      Number of traffic vehicles per scene: 26.1±21.5
    
  • Generated Scenarios: Empowered by our generative model TrafficGen, new traffic flow can be generated and resembles the real-world data given a HD map.

🛠 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}
}

About

This repo contains scenarios from different source for training and testing autonomous vehicles.

Resources

License

Stars

Watchers

Forks

Packages

No packages published