Skip to main content

Tactics2D: A Reinforcement Learning Environment Library with Generative Scenarios for Driving Decision-making

Project description

Tactics2D LOGO

Tactics2D: A Reinforcement Learning Environment Library for Driving Decision-making

Codacy Codecov Test Modules Read the Docs

Downloads Discord

python-version Code style: black Github license

About

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.

For further information on tactics2d, please refer to our comprehensive documentation, and a detailed comparison with other similar libraries is available here.

Community

We have a Discord Community for support. Feel free to ask questions. Posting in Github Issues and PRs are also welcome.

Installation

0. System Requirements

We have conducted testing for the execution and construction of tactics2d on the following platforms:

System 3.8 3.9 3.10 3.11
Ubuntu 18.04 :white_check_mark: - - -
Ubuntu 20.04 :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
Ubuntu 22.04 :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
Windows :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
MacOS :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:

1. Installation

We strongly recommend using conda to manage the Python environment. If you don't have conda installed, you can download it from here.

# create a new conda environment
conda create -n tactics2d python=3.9

1.1 Install from PyPI

You can simply install tactics2d from PyPI with the following command.

pip install tactics2d

1.2 Install from Github

You can also install tactics2d from from its source on GitHub. This way is recommended if you want to run the sample code or contribute to the development of tactics2d.

# clone the repository with submodules but ignore the large files (mainly the NuPlan's map data)
# please download NuPlan's map data from its official website and put it in the `tactics2d/data/map/NuPlan` directory
git clone --recurse-submodules git@github.com:WoodOxen/tactics2d.git
cd tactics2d
pip install -v .

If no errors occurs, you should have installed tactics2d successfully.

2. Dataset Preparation

According to the licenses of the trajectory datasets, we cannot distribute the original datasets with tactics2d. You need to download the datasets from their official websites. Currently, tactics2d supports the following datasets:

You can put the downloaded files at whatever location you like. In the parser, you can specify the path to the dataset.

3. Run the Tutorial

Demo

tactics2d supports the parsing 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). For more demos, please refer to the documentation.

Highway cases (HighD, ExiD)

HighD Location 3

ExiD Location 6

Intersection cases (InD, Argoverse, INTERACTION, NuPlan, WOMD)

InD Argoverse
INTERACTION WOMD

Roundabout cases (RounD, INTERACTION, )

RounD INTERACTION

Parking cases (DLP, Self-generated)

DLP Self-generated

Racing cases (Self-generated)

Citation

If you find tactics2d useful, please cite this in your publication.

@article{li2023tactics2d,
  title={Tactics2D: A Reinforcement Learning Environment Library with Generative Scenarios for Driving Decision-making},
  author={Li, Yueyuan and Zhang, Songan and Jiang, Mingyang and Chen, Xingyuan and Yang, Ming},
  journal={arXiv preprint arXiv:2311.11058},
  year={2023}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tactics2d-0.1.7.tar.gz (204.9 kB view details)

Uploaded Source

Built Distribution

tactics2d-0.1.7-py3-none-any.whl (238.0 kB view details)

Uploaded Python 3

File details

Details for the file tactics2d-0.1.7.tar.gz.

File metadata

  • Download URL: tactics2d-0.1.7.tar.gz
  • Upload date:
  • Size: 204.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for tactics2d-0.1.7.tar.gz
Algorithm Hash digest
SHA256 5b40de133da215751c3ba7e374b65c4ce2212411c7907659fafb17f3fd89daf9
MD5 4e9739f95444d0ebd99e6e5d11ddbd25
BLAKE2b-256 23413f9bd8f447510a424de58d3c7a38cd8a58291d43503061519352ecef717f

See more details on using hashes here.

File details

Details for the file tactics2d-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: tactics2d-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 238.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for tactics2d-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b50af05b62bd8809806352c662a782d5675c7294757649a65b53790424fb1123
MD5 843a0a90c1b874052162ad3d704f4458
BLAKE2b-256 d1d1a10410e088bc4e7c7c11e58e3bbd54b86c002dbc19fd9542c901f4c5cd3e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page