CommonRoad-OpenTrafficSim Interface

The coupling of CommonRoad and OpenTrafficSim utilizes real-world recordings of traffic scenarios as blueprints to generate synthetic ones. For setting up simulations, we convert traffic information from the recorded scenarios using different abstraction levels, so-called simulation modes. These simulation modes range from resimulation, aiming at accurately reflecting the real-world recording, over origin-destination demand abstraction, up to random traffic generation. As the resulting traffic scenarios are typically applied for testing automated driving systems, low abstraction levels are useful to systematically analyze the behavior of these driving systems using similar scenarios. With high abstraction levels, one can explore the behavior of automated driving systems in deviating traffic situations.

Installation:
For installation instructions, see README of the repository.

Minimal code example

from pathlib import Path
from commonroad.common.file_reader import CommonRoadFileReader
from crots.conversion.main import Conversion
from crots.abstractions.abstraction_level import AbstractionLevel
from crots.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()