Package: commonroad-scenario-designer
CommonRoad Scenario DesignerThis toolbox provides map converters forOpenStreetMap(OSM),Lanelet/Lanelet2,OpenDRIVE, andSUMOto theCommonRoad(CR) format and for some formats vice versa.Additionally, a graphical user interface (GUI) is included, which allows one to efficiently create and manipulate
CommonRoad maps and scenarios.ToolPathFunctionalityOpenDRIVE => CRcrdesigner/map_conversion/opendriveConversion from OpenDRIVE to CommonRoad.Lanelet/Lanelet2 <=> CRcrdesigner/map_conversion/lanelet2Conversion from Lanelet2 to CommonRoadand from CommonRoad to LaneletOSM => CRcrdesigner/map_conversion/osm2crConversion from OSM to CommonRoad.SUMO <=> CRcrdesigner/map_conversion/sumo_mapConversion from SUMO to CommonRoad and vice versa.Map Verification and Repairingcrdesigner/verification_repairingVerification and Repairing of CommonRoad maps.CR Scenario Designer GUIcrdesigner/ui/guiMulti-functional GUI for map conversion and scenario creation/editing.Prerequisites and InstallationWe have tested the toolbox with Python 3.8, 3.9, and 3.10.
The toolbox should work under Linux, macOS, and Windows.
Below we present two ways of installing the CommonRoad Scenario Designer:Only using the CommonRoad Scenario Designer, e.g.,the GUI or integrating the scenario designer APIs into your codeDeveloping code for the CommonRoad Scenario DesignerIf you want to use the SUMO conversion or to generate traffic using SUMO, please installSUMO:sudoapt-getupdate
sudoapt-getinstallsumosumo-toolssumo-docecho"export SUMO_HOME=/usr/share/sumo">>~/.bashrcecho'export PYTHONPATH="$SUMO_HOME/tools:$PYTHONPATH"'>>~/.bashrcIf you use zsh, replace.bashrcwith.zshrc.Using the CommonRoad Scenario DesignerThe recommended way of installation if you only want to use the scenario designer (i.e., you do not want to work with the code directly) is to use the PyPI package:pipinstallcommonroad-scenario-designerDevelopmentFirst, clone the repository.
The usage ofPoetryis recommended.
Poetry can be installed using:curl-sSLhttps://install.python-poetry.org|python3-Create a new Python environment:poetryshell
poetryinstall--withtests,docs,tutorialsWe recommend to use PyCharm (Professional) as IDE.Common Errors during installationUbuntuCould not load the Qt platform plugin “xcb” in “” even though it was found:Error seems to be a missing package - either libxkbcommon-x11 or libxcb-xinerama0 (both can be installed bysudo apt install [package_name]). See for referencehereUsageWe provide different types of usage for theCommonRoad Scenario Designer. Subsequently, we present for each component
the different usage methods.GUIThe recommended aspect ratio is 16:9 with a scaling of 100%.
Within the GUI, you can also execute the different converters.
The GUI can either be activated via a Python API, command line, or executing a Python script.Python ScriptFirst you need to activate your python environment with the installed dependencies.Afterward, you can start theCommonRoad Scenario Designerand the GUI will open:$pythoncrdesigner/ui/gui/start_gui.pyCommand LineThe GUI can be started from command line via the following two options:$crdesigner
$crdesignerguiNote that you have to activate first the Python environment in which the CommonRoad Scenario Designer is installed.You can also execute a map conversion via the commandline interface, e.g.,crdesigner --input-file /input/path/l2file.osm  --output-file /output/path/crfile.xml lanelet2cr.The output ofcrdesigner --helplooks as follows:Usage:crdesigner[OPTIONS]COMMAND[ARGS]...ToolboxforMapConversionandScenarioCreationforAutonomousVehicles

Options:--input-filePATHPathtoOpenDRIVEmap--output-filePATHPathwhereCommonRoadmapshouldbestored--force-overwrite/--no-force-overwriteOverwriteexistingCommonRoadfile[default:force-overwrite]--authorTEXTYourname--affiliationTEXTYouraffiliation,e.g.,university,researchinstitute,company--tagsTEXTTagsforthecreatedmap--install-completion[bash|zsh|fish|powershell|pwsh]Installcompletionforthespecifiedshell.--show-completion[bash|zsh|fish|powershell|pwsh]Showcompletionforthespecifiedshell,tocopyitorcustomizetheinstallation.--helpShowthismessageandexit.

Commands:crlanelet2crsumoguilanelet2crodrcrosmcrsumocr`Map ConvertersYou can execute the different converters either via command line, calling them within your Python program via an API,
or the GUI.APIThe main APIs to execute the pure conversions are located undercrdesigner/map_conversion/map_conversion_interface.py.For many conversions we provide further APIs, e.g., for downloading a map from OSM.GUIThe GUI provides a toolbox with which contains functionality to load maps given in formats other the CommonRoad formatand to convert CommonRoad maps to other formats or the other formats to the CommonRoad format.Important informationWhen converting OSM maps, missing information such as the course of individual lanes is estimated during the process.These estimations are imperfect (the OSM maps as well) and often it is advisable to edit the
scenarios by hand via the GUI.TutorialsWe also provide tutorials demonstrating how the different map converter APIs can be used.The tutorials include a jupyter notebook and exemplary Python scripts for each conversion.DocumentationTo generate the documentation from source, first install the necessary dependencies with pip:cddocs/source&&sphinx-build-bhtml.../../publicThe documentation can be accessed by openingpublic/index.html.The titles of module pages have to be set manually!The full documentation of the API and introducing examples can also be foundhere.ChangelogA detailed overview about the changes in each version is provided in theChangelog.Bug and feature reportingThis release (v0.8.9) is still a BETA version.In case you detect a bug or you want to suggest a new feature, please report it in ourforum.If you want to contribute to the toolbox, you can also post it in theforumor contactSebastian Maierhofer.AuthorsResponsible: Sebastian Maierhofer, Sebastian MairContribution (in alphabetic order by last name): Daniel Asch, Hamza Begic, Mohamed Bouhali, Florian Braunmiller,
Tim Dang, Behtarin Ferdousi, Maximilian Fruehauf, Marcus Gabler, Fabian Hoeltke, Tom Irion, Aaron Kaefer, Anton Kluge,
David Le, Gustaf Lindgren, Sarra Ben Mohamed, Benjamin Orthen, Luisa Ortner, Louis Pröbstle, Benedikt Reinhard,
Maximilian Rieger, Til Stotz, Stefan Urban, Max WinklhoferCreditsWe gratefully acknowledge partial financial support byDFG (German Research Fundation) Priority Program SPP 1835 Cooperative Interacting AutomobilesBMW Group within the Car@TUM projectCentral Innovation Programme of the German Federal Government under grant no. ZF4086007BZ8CitationIf you use our code for research, please consider to cite our papers:@inproceedings{Maierhofer2023,
	author = {Maierhofer, Sebastian and  Ballnath, Yannick and  Althoff, Matthias},
	title = {Map Verification and Repairing Using Formalized Map Specifications},
	booktitle = {2023 IEEE International Conference on Intelligent Transportation Systems (ITSC)},
	year = {2023},
	pages = {},
	abstract = {Autonomous vehicles benefit from correct maps to participate in traffic safely, but often maps are not verified before their usage. 
                    We address this problem by providing an approach to verify and repair maps automatically based on a formalization of map specifications in higher-order logic. 
                    Unlike previous work, we provide a collection of map specifications. 
                    We can verify and repair all possible map parts, from geometric to semantic elements, e.g., adjacency relationships, lane types, road boundaries, traffic signs, and intersections. 
                    Due to the modular design of our approach, one can integrate additional logics. 
                    We compare ontologies, answer set programming, and satisfiability modulo theories with our higher-order logic verification algorithm. 
                    Our evaluation shows that our approach can efficiently verify and repair maps from several data sources and of different map sizes. 
                    We provide our tool as part of the CommonRoad Scenario Designer toolbox available at commonroad.in.tum.de.},
}@inproceedings{Maierhofer2021,
	author = {Sebastian Maierhofer, Moritz Klischat, and Matthias Althoff},
	title = {CommonRoad Scenario Designer: An Open-Source Toolbox for Map Conversion and Scenario Creation for Autonomous Vehicles},
	booktitle = {Proc. of the IEEE Int. Conf. on Intelligent Transportation Systems },
	year = {2021},
	pages = {3176-3182},
	abstract = {Maps are essential for testing autonomous driving functions. Several map and scenario formats are 
                    available. However, they are usually not compatible with each other, limiting their usability.  
                    In this paper, we address this problem using our open-source toolbox that provides map converters  
                    from different formats to the well-known CommonRoad format. Our toolbox provides converters for 
                    OpenStreetMap, Lanelet/Lanelet2, OpenDRIVE, and SUMO. Additionally, a graphical user interface is 
                    included, which allows one to efficiently create and manipulate CommonRoad maps and scenarios. 
                    We demonstrate the functionality of the toolbox by creating CommonRoad maps and scenarios based on 
                    other map formats and manually-created map data.},
}If you use the OpenDRIVE to CommonRoad conversion for your paper, please consider to additionally cite the corresponding paper:@inproceedings{Althoff2018b,
	author = {Matthias Althoff and Stefan Urban and Markus Koschi},
	title = {Automatic Conversion of Road Networks from OpenDRIVE to Lanelets},
	booktitle = {Proc. of the IEEE International Conference on Service Operations and Logistics, and Informatics},
	year = {2018},
	pages = {157--162},
	abstract = {Detailed road maps are an important building block for autonomous driving. They accelerate creating a 
	            semantic environment model within the vehicle and serve as a backup solution when sensors are occluded 
	            or otherwise impaired. Due to the required detail of maps for autonomous driving and virtual test 
	            drives, creating such maps is quite labor-intensive. While some detailed maps for fairly large regions 
	            already exist, they are often in different formats and thus cannot be exchanged between companies and 
	            research institutions. To address this problem, we present the first publicly available converter from
	            the OpenDRIVE format to lanelets—both representations are among the most popular map formats. 
	            We demonstrate the capabilities of the converter by using publicly available maps.},
}