Repository Summary
Description | MetaDrive: Lightweight driving simulator for everyone |
Checkout URI | https://github.com/metadriverse/metadrive.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-05-12 |
Dev Status | UNKNOWN |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
Name | Version |
---|---|
metadrive_example_bridge | 0.0.0 |
README
MetaDrive: an Open-source Driving Simulator for AI and Autonomy Research
MetaDrive is a driving simulator with the following key features:
- Compositional: It supports synthesising infinite scenes with various road maps and traffic settings or loading real-world driving logs for the research of generalizable RL.
- Lightweight: It is easy to install and run on Linux/Windows/MacOS with sensor simulation support. It can run up to +1000 FPS on a standard PC.
- Realistic: Accurate physics simulation and multiple sensory input including point cloud, RGB/Depth/Semantic images, top-down semantic map and first-person view images.
🛠Quick Start
Install MetaDrive via:
git clone https://github.com/metadriverse/metadrive.git
cd metadrive
pip install -e .
You can verify the installation of MetaDrive via running the testing script:
# Go to a folder where no sub-folder calls metadrive
python -m metadrive.examples.profile_metadrive
Note that please do not run the above command in a folder that has a sub-folder called ./metadrive
.
🚕 Examples
We provide examples to demonstrate features and basic usages of MetaDrive after the local installation.
There is an .ipynb
example which can be directly opened in Colab.
Also, you can try examples in the documentation directly in Colab! See more details in Documentations.
Single Agent Environment
Run the following command to launch a simple driving scenario with auto-drive mode on. Press W, A, S, D to drive the vehicle manually.
python -m metadrive.examples.drive_in_single_agent_env
Run the following command to launch a safe driving scenario, which includes more complex obstacles and cost to be yielded.
python -m metadrive.examples.drive_in_safe_metadrive_env
Multi-Agent Environment
You can also launch an instance of Multi-Agent scenario as follows
python -m metadrive.examples.drive_in_multi_agent_env --env roundabout
``` accepts following parmeters: `roundabout` (default), `intersection`, `tollgate`, `bottleneck`, `parkinglot`, `pgmap`.
Adding
```--top_down
``` can launch top-down pygame renderer.
### Real Environment
Running the following script enables driving in a scenario constructed from nuScenes dataset or Waymo dataset.
```bash
python -m metadrive.examples.drive_in_real_env
The default real-world dataset is nuScenes.
Use
--waymo
to visualize Waymo scenarios.
Traffic vehicles can not response to surrounding vchicles if directly replaying them.
Add argument
--reactive_traffic
to use an IDM policy control them and make them reactive.
File truncated at 100 lines see the full file