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.1.tar.gz (107.0 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.1-py3-none-any.whl (134.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: commonroad_sumo-2025.1.1.tar.gz
  • Upload date:
  • Size: 107.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.10.18 Linux/5.15.0-87-generic

File hashes

Hashes for commonroad_sumo-2025.1.1.tar.gz
Algorithm Hash digest
SHA256 cca652d5871c241bb8e32b64322c6f68cb7d48471f4353d25e1a23e4b86ca1d7
MD5 27838afc854649645cefc711ea421ed2
BLAKE2b-256 2bf3e59aa93d838630967d454ee0f12db77107219b975d7b3c79c804df71c1ed

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for commonroad_sumo-2025.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e8109a1b23f433ed75a12b70bbdc909a25348961eb151ae0bb5d18603a9ca3c
MD5 3f80cedbbc13cfad4f6b9cec1fa0fdf9
BLAKE2b-256 7862e4f1eb9df509b7756889383a9d0dbb9110388f0311bed6b384a12774984b

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