CommonRoad - OpenTrafficSim Interface
Interface between CommonRoad and the traffic simulator OpenTrafficSim (OTS).
It allows you to simulate CommonRoad scenarios with different abstraction levels (i.e. resimulation, delay, demand, infrastructure, random) in OTS and get the results as CommonRoad scenarios.
Quick Start
Installation
The interface is available on PyPI and can easily be installed:
$ pip install commonroad-ots
Additionally, a working java installation is required to execute OTS. For Ubuntu you can use:
$ apt-get update && apt-get install -y default-jdk
OTS itself is distributed as a python package and included as a dependency of this package. Therefore, no separate installation is necessary.
Example Usage
The following example shows how to resimulate a given CommonRoad scenario:
from pathlib import Path
from commonroad.common.file_reader import CommonRoadFileReader
from commonroad_ots.conversion.main import Conversion
from commonroad_ots.abstractions.abstraction_level import AbstractionLevel
from commonroad_ots.abstractions.simulation_execution import SimulationExecutor
# Load recorded scenario
scenario_path = Path("/path/to/commonroad/scenario.xml")
scenario_rec, _ = CommonRoadFileReader(scenario_path).open()
# Setup and execute simulation
executor = SimulationExecutor(scenario_rec, AbstractionLevel.RESIMULATION, False, dict(), 1234, False, False)
scenario_new, _, _, _, _ = executor.execute()
Documentation
The full documentation of the API and introductory examples can be found at cps.pages.gitlab.lrz.de/commonroad/cr-ots-interface.
Metadata
Release files for commonroad-ots 2025.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| commonroad_ots-2025.1.tar.gz | 40.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| commonroad_ots-2025.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 92.8 kB
Release files / commonroad_ots-2025.1.tar.gz
| Download URL | commonroad_ots-2025.1.tar.gz |
|---|---|
| Size | 40.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aaa9a85441824471ca1151a828027c1805cdf2f499d183e1acd3a7693faef171
|
|
BLAKE2b-256 checksum How to use checksums |
f9a8c21b4d489476eb5670295cce26e77c19d4d89a3c3dada15ab76b57c47a06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.10.18 Linux/5.15.0-87-generic
|
Release files / commonroad_ots-2025.1-py3-none-any.whl
| Download URL | commonroad_ots-2025.1-py3-none-any.whl |
|---|---|
| Size | 52.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
34a7c10008c9977d204da0569d06f050703872d9faa1a4a971c73d10a87624cd
|
|
BLAKE2b-256 checksum How to use checksums |
29ea2bb251991330d4196be9f35b0b6b700f8831b25d054382adde0d0d049d52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.10.18 Linux/5.15.0-87-generic
|