Home
[!note] This is the official codebase for Course AU7043 in Shanghai Jiao Tong University. For those who are taking this course, please download this repository by
git pullcommand!
About
Welcome to the official documentation of Python Library tactics2d!
tactics2d is an open-source Python library that provides diverse and challenging traffic scenarios for the development and evaluation of reinforcement learning-based decision-making models in autonomous driving. tactics2d stands out with the following key features:
- Compatibility
- 📦 Trajectory dataset -- Enables seamless importation of various real-world trajectory datasets, including Argoverse, Dragon Lake Parking (DLP), INTERACTION, LevelX Series (highD, inD, rounD, ExiD), NuPlan, and Waymo Open Motion Dataset (WOMD), encompassing both trajectory parsing and map information.
- 📄 Map format -- Enables parsing and conversion of commonly used open map formats like OpenDRIVE, Lanelet2-style OpenStreetMap (OSM), and SUMO roadnet.
- Customizability
- 🚗 Traffic participants -- Supports the creation of new traffic participant classes with customizable physical attributes, physics dynamics/kinematics models, and behavior models.
- 🚧 Road elements -- Support the definition of new road elements, with a focus on regulatory aspects.
- Diversity
- 🛣️ Traffic scenarios -- Features an extensive range of built-in Gym-style traffic scenarios, including highway, lane-merging, unsignalized/signalized intersection, roundabout, parking, and racing.
- 🚲 Traffic participants -- Features a variety of built-in traffic participants with realistic physics parameters, detailed further here.
- 📷 Sensors -- Provides bird-eye-view (BEV) semantic segmentation RGB image and single-line LiDAR point cloud for model input.
- Visualization -- Offers a user-friendly visualization tool for real-time rendering of traffic scenarios and participants, along with the capability to record and replay traffic scenarios.
- Reliability -- Over 85\% code is covered by unit tests and integration tests.
What can you do with tactics2d?
[Description]
Features
Updated on April 15, 2026.
Corresponds to version 0.1.9rc3.
Dataset Parser
Support parsing maps and trajectories from the following datasets:
- HighD
- InD
- RounD
- ExiD
- Argoverse
- Dragon Lake Parking (DLP)
- DriveInsightD
- INTERACTION
- NuPlan
- WOMD
Map Parser
Support parsing maps in the following formats:
- OpenStreetMap (OSM)
- OpenStreetMap annotated in Lanelet2
- OpenDRIVE (XODR)
Math Interpolation Algorithms
Support the following interpolation algorithms:
- B-Spline
- Bezier
- Cubic
- Spiral
- Dubins
- Reeds Shepp
Traffic Participant
The following traffic participants are implemented:
- Vehicle
- Cyclist
- Pedestrian
For each traffic participants, a set of parameters are available to configure the behavior.
Physics Model
The following physics model of traffic participants are supported:
- Bicycle model (Kinematic): recommended for cyclists and low-speed vehicles
- Bicycle model (Dynamic): recommended for cyclists and high-speed vehicles
- Point mass (Kinematic): recommended for pedestrians
- Single-track drift model (Dynamic): recommended for vehicles
Road Element
The following road elements are implemented:
- Lane
- Area
- Junction
- Road line
- Base class of traffic regulations
Traffic Event Detection
- Static collision detection
- Dynamic collision detection
- Arrival event detection
Routing
- Lane-level route planning on parsed map topology
- Unified
routingmodule with reusable graph building, search adaptation, and route containers - Built-in routing cost presets for distance, time, averaged relation-aware traversal cost, and node/edge traversal cost, all configurable through the unified
Routerinterface; the routing tutorial documents their Lanelet2-style and Apollo-inspired background - Custom routing cost function injection for user-defined experiments and downstream navigation logic
- Notebook demo for end-to-end routing workflow and visualized route output
Sensor
- Bird-eye-view (BEV) semantic segmentation RGB image
- Single-line LiDAR point cloud
Why tactics2d?
Similar Works
tactics2d is crafted to offer a robust and intuitive environment tailored for the development and evaluation of autonomous driving decision-making models. As a third-party library, tactics2d does not cater to any specific dataset; instead, its focus lies in facilitating parsing, visualization, log replaying, and interactive simulation across a diverse array of datasets and map formats. The table below provides a comparative overview of tactics2d alongside other open-source simulators under active maintenance.
These tables are updated on 2024-04-01. Notations:
= Implemented and tested
= Under development
-= Not implemented and not planned
Functionality
| Simulator | Built-in RL Environment | Custom Trajectory | Custom Map | Dataset Compatibility | Interactive NPCs | Multi-agent |
|---|---|---|---|---|---|---|
| SUMO | - | ![]() |
![]() |
- | ![]() |
- |
| CarRacing | ![]() |
- | - | - | - | - |
| CARLA | - | ![]() |
![]() |
- | ![]() |
![]() |
| CommonRoad | ![]() |
![]() |
![]() |
![]() |
![]() |
- |
| highway-env | ![]() |
- | - | - | ![]() |
- |
| SMARTS | ![]() |
- | - | ![]() |
![]() |
![]() |
| MetaDrive | ![]() |
![]() |
![]() |
- | ![]() |
![]() |
| NuPlan | - | - | - | - | ![]() |
- |
| InterSim | - | - | - | ![]() |
![]() |
![]() |
| TBSim | - | - | - | ![]() |
![]() |
![]() |
| Waymax | ![]() |
- | - | - | ![]() |
![]() |
| Tactics2D | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Dataset Compatibility
tactics2d excels in parsing various datasets into unified map and traffic participant data structures, enabling seamless integration for both log replay and interactive simulations.
Below is a comparison of dataset support between tactics2d and other simulators. tactics2d strives to accommodate a wide range of datasets, and we commit to keeping the table updated on a regular basis.
TODO
We have a plan to add support to the following datasets in the future:
- NGSIM
- Lyft 5
Feel free to suggest additional trajectory datasets to be incorporated into our support list by either opening an issue or submitting a pull request. We value community input and are committed to expanding our dataset coverage to better serve our users.
| Simulators | Argoverse | DLP | INTERACTION | LevelX | NuPlan | WOMD |
|---|---|---|---|---|---|---|
| SUMO | - | - | - | - | - | - |
| CarRacing | - | - | - | - | - | - |
| CARLA | - | - | - | - | - | - |
| CommonRoad | - | - | ![]() |
![]() |
- | - |
| highway-env | - | - | - | - | - | - |
| SMARTS | - | - | - | - | - | - |
| MetaDrive | - | - | - | - | - | - |
| NuPlan | - | - | - | - | ![]() |
- |
| InterSim | - | - | - | - | ![]() |
![]() |
| TBSim | - | - | - | - | ![]() |
![]() |
| Waymax | - | - | - | - | - | ![]() |
| Tactics2D | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Map Format Compatibility
| Simulators | OpenDRIVE | OpenStreetMap | SUMO Roadnet |
|---|---|---|---|
| SUMO | ![]() |
![]() |
![]() |
| CarRacing | - | - | - |
| CARLA | ![]() |
![]() |
![]() |
| CommonRoad | ![]() |
![]() |
- |
| highway-env | - | - | - |
| SMARTS | ![]() |
- | ![]() |
| MetaDrive | ![]() |
- | ![]() |
| NuPlan | - | - | - |
| InterSim | - | - | - |
| TBSim | - | - | - |
| Waymax | - | - | - |
| Tactics2D | ![]() |
![]() |
![]() |

= Implemented and tested
= Under development