Skip to content

Software

MetaDrive

By MetaDriverse, from github.com/metadriverse/metadrive (opens in a new tab)

  • Cars
  • Simulator
  • Apache-2.0

MetaDrive is an open-source driving simulator for AI and autonomy research, built to generate varied driving scenes for training and testing reinforcement learning agents.

Facts

GitHub stars
1,291read on 28 Nov 2026
Last update
16 Oct 2026Newest commit on main
Maintenance
Activea commit in the last 90 days
Difficulty
Intermediate

Checked on GitHub on 28 Nov 2026.

Licenses

Code
Apache-2.0 (opens in a new tab)

Read by Robotheca from LICENSE.txt (opens in a new tab) (Apache-2.0) at commit fe54b03 (opens in a new tab), on 16 Oct 2026.

Commercial use
Yes

At a glance

What it is
  • Synthesises scenes with varied road maps and traffic, or loads real-world driving logs, for research on generalizable RL.
  • Designed to be lightweight and easy to install on Linux, Windows and macOS, with sensor simulation support.
  • Reports running at up to more than 1000 FPS on a standard PC.
  • Provides accurate physics simulation and multiple sensor inputs, including point cloud, RGB, depth and semantic images, a top-down semantic map and first-person images.
  • Offers single-agent and multi-agent environments, including roundabout, intersection, tollgate, bottleneck, parking lot and pgmap scenarios.
  • Can replay scenarios built from the nuScenes or Waymo datasets, with optional reactive traffic driven by an IDM policy.

Robotheca's summary of the project's documents, not the creator's words.

Robots on Robotheca
No robot on Robotheca uses it yet.
Licence
Apache-2.0. Commercial use: Yes. Where it was read
Install
In the creator's words: The project's website (opens in a new tab)
Maintenance
Active, last commit on 16 Oct 2026.

Use it

How to install it, in the creator's words: The project's website (opens in a new tab)

Robotheca doesn't review code. Read it before running it.

Files and versions

Facts read at commit fe54b03

Robotheca never hosts the code: each link goes to the creator's own page.

The README

The creator's own README, copied as written: README.md by MetaDriverse, at commit fe54b03, under Apache-2.0 (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

Picture: logo-horizon.png

MetaDrive: an Open-source Driving Simulator for AI and Autonomy Research

(opens in a new tab) Image: Documentation (opens in a new tab) (opens in a new tab) (opens in a new tab) (opens in a new tab) Image: Downloads (opens in a new tab) (opens in a new tab)

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 (opens in a new tab) to demonstrate features and basic usages of MetaDrive after the local installation. There is an .ipynb example which can be directly opened in Colab. Image: Open In Colab (opens in a new tab) (opens in a new tab)

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

--env 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.

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. Press key r for loading a new scenario, and b or q for switching perspective.

Basic Usage

To build the RL environment in python script, you can simply code in the Farama Gymnasium format as:

from metadrive.envs.metadrive_env import MetaDriveEnv

env = MetaDriveEnv(config={"use_render": True})
obs, info = env.reset()
for i in range(1000):
    obs, reward, terminated, truncated, info = env.step(env.action_space.sample())
    if terminated or truncated:
        env.reset()
env.close()
🏫 Documentations

Please find more details in: https://metadrive-simulator.readthedocs.io (opens in a new tab)

Running Examples in Doc

The documentation is built with .ipynb so every example can run locally or with colab. For Colab running, on the Colab interface, click “GitHub,” enter the URL of MetaDrive: https://github.com/metadriverse/metadrive (opens in a new tab), and hit the search icon. After running examples, you are expected to get the same output and visualization results as the documentation!

For example, hitting the following icon opens the source .ipynb file of the documentation section: Environments (opens in a new tab).

Image: Open In Colab (opens in a new tab) (opens in a new tab)

📎 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}
}
Acknowledgement

The simulator can not be built without the help from Panda3D community and the following open-sourced projects:

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.