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/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.tar.gz (105.4 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-py3-none-any.whl (132.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for commonroad_sumo-2025.1.tar.gz
Algorithm Hash digest
SHA256 4f8dc0244eff7b83d60b9405709af6b09cc8f824296f99a58a6210d8cb3849c0
MD5 fbcd0ad470a4d052ed85809707a0161e
BLAKE2b-256 9b8404603e3863417ee89a2dc45e93d51052a939ca7404fbf75ba71ce38cc976

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for commonroad_sumo-2025.1-py3-none-any.whl
Algorithm Hash digest
SHA256 57b00e6a91af8414d334b0a91f3824d47a9a86175e4b52742f3b3301ba3e3377
MD5 1b62f70ce69749afca12032034fee13f
BLAKE2b-256 c2c0becf34f43386558b2a6501aa46a7fe6318c82bbff749a25fd3e334f23b16

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