Skip to main content

Interface between CommonRoad and the SUMO traffic simulator

Project description

CommonRoad - SUMO Interface

PyPI pyversions PyPI version fury.io PyPI download week PyPI download month PyPI license

Interface between CommonRoad and the traffic simulator SUMO.

It allows you to run non-interactive simulations to generate traffic on lanelet networks to create new CommonRoad scenarios. Additionally, you can run interactive simulations where a motion planner is executed in tandem with SUMO. The ego vehicle is controlled by the motion planner, while the behavior of the other vehicles is simulated by SUMO.

More about the interface can be found in the original paper:

Moritz Klischat, Octav Dragoi, Mostafa Eissa, and Matthias Althoff, Coupling SUMO with a Motion Planning Framework for Automated Vehicles, SUMO 2019: Simulating Connected Urban Mobility

Quick Start

Installation

The interface is available on PyPI and can be easily installed:

$ pip install commonroad-sumo

SUMO itself is already included as a dependency, therefore no further steps are required to use the interface.

Example Usage

The following snippet will simulate random traffic on the lanelet network of a given CommonRoad scenario for 100 time steps and write the resulting CommonRoad scenario to /tmp/simulated_scenario.xml:

from commonroad.common.file_reader import CommonRoadFileReader

from commonroad_sumo import NonInteractiveSumoSimulation

scenario, _ = CommonRoadFileReader("<path to CommonRoad scenario>").open()

simulation_result = NonInteractiveSumoSimulation.from_scenario(scenario).run(simulation_steps=100)
simulation_result.write_to_file("/tmp/simulated_scenario.xml")

Documentation

The full documentation can be found at cps.pages.gitlab.lrz.de/commonroad/sumo-interface.

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

commonroad_sumo-2025.1.4.tar.gz (110.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

commonroad_sumo-2025.1.4-py3-none-any.whl (136.7 kB view details)

Uploaded Python 3

File details

Details for the file commonroad_sumo-2025.1.4.tar.gz.

File metadata

  • Download URL: commonroad_sumo-2025.1.4.tar.gz
  • Upload date:
  • Size: 110.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.19 Linux/5.15.0-87-generic

File hashes

Hashes for commonroad_sumo-2025.1.4.tar.gz
Algorithm Hash digest
SHA256 4887fb89999e6815b3985b35734a8289165df812dbf52076c9d6548fc4fd4626
MD5 ddd146909b7b66b41135d197317881cd
BLAKE2b-256 328ef79d6d0d2968825c226ae62260b4d40d37fb4f3a8a3056d04aaf8009e5d7

See more details on using hashes here.

File details

Details for the file commonroad_sumo-2025.1.4-py3-none-any.whl.

File metadata

  • Download URL: commonroad_sumo-2025.1.4-py3-none-any.whl
  • Upload date:
  • Size: 136.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.19 Linux/5.15.0-87-generic

File hashes

Hashes for commonroad_sumo-2025.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0f749209677cdbbf0167bf89562c1c506af8b861956d3a6daab9b7615c43f871
MD5 451b2abd2f475c9d3248bac4acd166df
BLAKE2b-256 fb1fbb72411cce7f3709d06b8d4faba610b956632714127ff921c0cae62dbd81

See more details on using hashes here.

Supported by

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