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.2.tar.gz (109.1 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.2-py3-none-any.whl (137.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: commonroad_sumo-2025.1.2.tar.gz
  • Upload date:
  • Size: 109.1 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.2.tar.gz
Algorithm Hash digest
SHA256 ec6be44b536e8e50e0bf786a5d5e4dd5dd883e77e12eebcd88cd2f5f6a288512
MD5 f1e475200d731a82a8d4d264f261307b
BLAKE2b-256 bbf119e7498ff22f1d79a20119878ff1d76a55b2552ed245121d28314a4bcab1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: commonroad_sumo-2025.1.2-py3-none-any.whl
  • Upload date:
  • Size: 137.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0e93a3fb738ff192db48916fd0ab799150ac2f8867674eadd3ba8d2ad453363e
MD5 c8ea17335d4283037fa747321a597bd3
BLAKE2b-256 27fab6c6664778e74cc6c00ddca8f84e93e6225b840c3e2c850ca90b986dabe7

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