# CommonRoad-CARLA Interface
[](https://pypi.python.org/pypi/commonroad-carla-interface/)
[](https://pypi.python.org/pypi/commonroad-carla-interface/)\
[](https://pypi.python.org/pypi/commonroad-carla-interface/)
[](https://pypi.python.org/pypi/commonroad-carla-interface/)
[](https://pypi.python.org/pypi/commonroad-carla-interface/) \

The CommonRoad-CARLA Interface provides APIs to use CommonRoad-based tools together with the 3D simulator [CARLA](https://carla.org).
## Installation
### Carla
Install Carla 9.15 via as described in the
[CARLA documentation](https://carla.readthedocs.io/en/latest/start_quickstart/#b-package-installation)
(either use the system installation or download a release from their GitHub repository).
Also add the additional maps if you want to use them.
You can test the successful download/usage of CARLA via running ./CarlaEU4.sh within the CARLA installation.
### CommonRoad-CARLA Interface
#### Usage in other projects
We provide an PyPI package which can be installed with the following command
```shell
pip install commonroad-carla-interface
```
#### License
The CommonRoad-CARLA-Interface is published under GNU3 license (since this is the most restrictive license
of a Python package we import).
We base some parts of our code on CARLA's
example scripts ([MIT license](https://github.com/carla-simulator/carla/blob/dev/LICENSE)): https://github.com/carla-simulator/carla/tree/dev/PythonAPI/examples, e.g. the head-up display.
#### Development
It is recommended to use [poetry](https://python-poetry.org/) as an environment manager.
Clone the repository and install it with poetry.
```shell
git clone git@github.com:commonroad/commonroad-carla-interface.git
poetry shell
poetry install
```
We recommend to use PyCharm (Professional) as IDE.
## Getting started
We provide [tutorial script](https://github.com/commonroad/commonroad-carla-interface/tutorials/)
for different features we support.
A deployed version of the documentation can be found
[here](https://cps.pages.gitlab.lrz.de/commonroad/commonroad-carla-interface/).
You can use these tutorial scripts as the starting point.
The code for converting a map from CommonRoad to OpenDRIVE is located in
the [CommonRoad Scenario Designer](https://commonroad.in.tum.de/tools/scenario-designer).
### Supported Features
We support five ways of interacting with CARLA:
- **CommonRoad scenario replay**: 2D/3D visualization of CommonRoad scenarios together with solutions.
- **Keyboard control**: Controlling an ego vehicle via keyboard in a 2D/3D visualization.
- **Scenario Generation**: Generation of CommonRoad scenarios with different configurations.
- **Motion planning**: Driving in a CARLA simulation with a CommonRoad-based motion planner.
- **Wheel control**: Controlling an ego vehicle via steering wheel and pedals in a 2D/3D visualization.
The default configuration can be found under `crcarla.helper.config` and in our documentation.
The CARLA interface can take care of starting the CARLA server.
The path to CARLA can either be provided manually via the config parameters or the CARLA release folder path corresponds
to one of our default locations: /opt/carla-simulator/, /~/CARLA_0.9.14_RSS/, /~/CARLA_0.9.15/ (default paths work only
for Ubuntu; for a complete list of default paths, see our configuration options).
## Documentation
A deployed version of the documentation can be found
[here](https://cps.pages.gitlab.lrz.de/commonroad/commonroad-carla-interface/).
You can also generate the documentation within your activated Poetry environment using.
```bash
poetry shell
mkdocs build
```
The documentation will be located under site, where you can open `index.html` in your browser to view it.
For updating the documentation you can also use the live preview:
```bash
poetry shell
mkdocs serve
```
## Authors
Responsible: Sebastian Maierhofer
Contributors (in alphabetic order by last name): Linge Ai, Yassine El Alami, Rupert Bauernfeind, Vy Hong,
Miguel Marcano, Valentin Merle, Fen Shi, Dávid Tokár Zhihao Yang
## Citation
**If you use our code for research, please consider to cite our papers and the CARLA publication:**
```
@inproceedings{Maierhofer2024a,
author = {Maierhofer, Sebastian and Althoff, Matthias},
title = {CommonRoad-CARLA Interface: Bridging the Gap between Motion Planning and 3D Simulation},
booktitle = {2024 IEEE Intelligent Vehicles Symposium (IV)},
year = {2024},
pages = {tbd},
abstract = {Motion planning algorithms should be tested on a large, diverse, and realistic set of scenarios before
deploying them in real vehicles. However, existing 3D simulators usually focus on perception and
end-to-end learning, lacking specific interfaces for motion planning. We present an interface for the
CARLA simulator focusing on motion planning, e.g., to create configurable test scenarios and execute
motion planners in interactive environments. Additionally, we introduce a converter from lanelet-based maps
to OpenDRIVE, making it possible to use CommonRoad and Lanelet2 maps in CARLA. Our evaluation shows that
our interface is easy to use, creates new scenarios efficiently, and can successfully integrate motion
planners to solve CommonRoad scenarios. Our tool is published as an open-source toolbox 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.},
}
@InProceedings{Dosovitskiy2017,
author = {Alexey Dosovitskiy and German Ros and Felipe Codevilla and Antonio Lopez and Vladlen Koltun},
booktitle = {Proc. of the 1st Annual Conference on Robot Learning},
title = {{CARLA}: {An} Open Urban Driving Simulator},
year = {2017},
pages = {1--16},
abstract = {We introduce CARLA, an open-source simulator for autonomous driving research.
CARLA has been developed from the ground up to support development, training,
and validation of autonomous urban driving systems. In addition to open-source
code and protocols, CARLA provides open digital assets (urban layouts, buildings,
vehicles) that were created for this purpose and can be used freely.
The simulation platform supports flexible specification of sensor suites and
environmental conditions. We use CARLA to study the performance of three
approaches to autonomous driving: a classic modular pipeline, an end-to-end model
trained via imitation learning, and an end-to-end model trained via reinforcement learning.
The approaches are evaluated in controlled scenarios of increasing difficulty,
and their performance is examined via metrics provided by CARLA, illustrating the platform’s utility for autonomous driving research.},
}
```
Raw data
{
"_id": null,
"home_page": "https://commonroad.in.tum.de",
"name": "commonroad-carla-interface",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.11,>=3.9",
"maintainer_email": null,
"keywords": "autonomous, automated, vehicles, driving, motion, planning, simulation",
"author": "Cyber-Physical Systems Group, Technical University of Munich",
"author_email": "commonroad@lists.lrz.de",
"download_url": "https://files.pythonhosted.org/packages/f0/a5/0e2e87318f47e08b85aa533635b49994a34fa3a6905839043e0a3b58b134/commonroad_carla_interface-1.0.0.tar.gz",
"platform": null,
"description": "# CommonRoad-CARLA Interface\n[](https://pypi.python.org/pypi/commonroad-carla-interface/)\n[](https://pypi.python.org/pypi/commonroad-carla-interface/)\\\n[](https://pypi.python.org/pypi/commonroad-carla-interface/)\n[](https://pypi.python.org/pypi/commonroad-carla-interface/)\n[](https://pypi.python.org/pypi/commonroad-carla-interface/) \\\n\n\nThe CommonRoad-CARLA Interface provides APIs to use CommonRoad-based tools together with the 3D simulator [CARLA](https://carla.org).\n\n\n## Installation\n### Carla\nInstall Carla 9.15 via as described in the\n[CARLA documentation](https://carla.readthedocs.io/en/latest/start_quickstart/#b-package-installation)\n(either use the system installation or download a release from their GitHub repository).\nAlso add the additional maps if you want to use them.\nYou can test the successful download/usage of CARLA via running ./CarlaEU4.sh within the CARLA installation.\n\n### CommonRoad-CARLA Interface\n\n#### Usage in other projects\nWe provide an PyPI package which can be installed with the following command\n```shell\npip install commonroad-carla-interface\n```\n\n#### License\nThe CommonRoad-CARLA-Interface is published under GNU3 license (since this is the most restrictive license\nof a Python package we import).\nWe base some parts of our code on CARLA's\nexample scripts ([MIT license](https://github.com/carla-simulator/carla/blob/dev/LICENSE)): https://github.com/carla-simulator/carla/tree/dev/PythonAPI/examples, e.g. the head-up display.\n\n#### Development\nIt is recommended to use [poetry](https://python-poetry.org/) as an environment manager.\nClone the repository and install it with poetry.\n```shell\ngit clone git@github.com:commonroad/commonroad-carla-interface.git\npoetry shell\npoetry install\n```\nWe recommend to use PyCharm (Professional) as IDE.\n\n\n## Getting started\nWe provide [tutorial script](https://github.com/commonroad/commonroad-carla-interface/tutorials/)\nfor different features we support.\nA deployed version of the documentation can be found\n[here](https://cps.pages.gitlab.lrz.de/commonroad/commonroad-carla-interface/).\nYou can use these tutorial scripts as the starting point.\nThe code for converting a map from CommonRoad to OpenDRIVE is located in\nthe [CommonRoad Scenario Designer](https://commonroad.in.tum.de/tools/scenario-designer).\n\n### Supported Features\nWe support five ways of interacting with CARLA:\n\n- **CommonRoad scenario replay**: 2D/3D visualization of CommonRoad scenarios together with solutions.\n- **Keyboard control**: Controlling an ego vehicle via keyboard in a 2D/3D visualization.\n- **Scenario Generation**: Generation of CommonRoad scenarios with different configurations.\n- **Motion planning**: Driving in a CARLA simulation with a CommonRoad-based motion planner.\n- **Wheel control**: Controlling an ego vehicle via steering wheel and pedals in a 2D/3D visualization.\n\n\nThe default configuration can be found under `crcarla.helper.config` and in our documentation.\nThe CARLA interface can take care of starting the CARLA server.\nThe path to CARLA can either be provided manually via the config parameters or the CARLA release folder path corresponds\nto one of our default locations: /opt/carla-simulator/, /~/CARLA_0.9.14_RSS/, /~/CARLA_0.9.15/ (default paths work only\nfor Ubuntu; for a complete list of default paths, see our configuration options).\n\n\n## Documentation\nA deployed version of the documentation can be found\n[here](https://cps.pages.gitlab.lrz.de/commonroad/commonroad-carla-interface/).\nYou can also generate the documentation within your activated Poetry environment using.\n```bash\npoetry shell\nmkdocs build\n```\nThe documentation will be located under site, where you can open `index.html` in your browser to view it.\nFor updating the documentation you can also use the live preview:\n```bash\npoetry shell\nmkdocs serve\n```\n\n## Authors\nResponsible: Sebastian Maierhofer\nContributors (in alphabetic order by last name): Linge Ai, Yassine El Alami, Rupert Bauernfeind, Vy Hong,\nMiguel Marcano, Valentin Merle, Fen Shi, D\u00e1vid Tok\u00e1r Zhihao Yang\n\n## Citation\n**If you use our code for research, please consider to cite our papers and the CARLA publication:**\n```\n@inproceedings{Maierhofer2024a,\n\tauthor = {Maierhofer, Sebastian and Althoff, Matthias},\n\ttitle = {CommonRoad-CARLA Interface: Bridging the Gap between Motion Planning and 3D Simulation},\n\tbooktitle = {2024 IEEE Intelligent Vehicles Symposium (IV)},\n\tyear = {2024},\n\tpages = {tbd},\n\tabstract = {Motion planning algorithms should be tested on a large, diverse, and realistic set of scenarios before\n\t deploying them in real vehicles. However, existing 3D simulators usually focus on perception and\n\t end-to-end learning, lacking specific interfaces for motion planning. We present an interface for the\n\t CARLA simulator focusing on motion planning, e.g., to create configurable test scenarios and execute\n\t motion planners in interactive environments. Additionally, we introduce a converter from lanelet-based maps\n\t to OpenDRIVE, making it possible to use CommonRoad and Lanelet2 maps in CARLA. Our evaluation shows that\n\t our interface is easy to use, creates new scenarios efficiently, and can successfully integrate motion\n\t planners to solve CommonRoad scenarios. Our tool is published as an open-source toolbox at commonroad.in.tum.de.},\n}\n```\n```\n@inproceedings{Maierhofer2021,\n\tauthor = {Sebastian Maierhofer, Moritz Klischat, and Matthias Althoff},\n\ttitle = {CommonRoad Scenario Designer: An Open-Source Toolbox for Map Conversion and Scenario Creation for Autonomous Vehicles},\n\tbooktitle = {Proc. of the IEEE Int. Conf. on Intelligent Transportation Systems },\n\tyear = {2021},\n\tpages = {3176-3182},\n\tabstract = {Maps are essential for testing autonomous driving functions. Several map and scenario formats are\n available. However, they are usually not compatible with each other, limiting their usability.\n In this paper, we address this problem using our open-source toolbox that provides map converters\n from different formats to the well-known CommonRoad format. Our toolbox provides converters for\n OpenStreetMap, Lanelet/Lanelet2, OpenDRIVE, and SUMO. Additionally, a graphical user interface is\n included, which allows one to efficiently create and manipulate CommonRoad maps and scenarios.\n We demonstrate the functionality of the toolbox by creating CommonRoad maps and scenarios based on\n other map formats and manually-created map data.},\n}\n\n@InProceedings{Dosovitskiy2017,\n author = {Alexey Dosovitskiy and German Ros and Felipe Codevilla and Antonio Lopez and Vladlen Koltun},\n booktitle = {Proc. of the 1st Annual Conference on Robot Learning},\n title = {{CARLA}: {An} Open Urban Driving Simulator},\n year = {2017},\n pages = {1--16},\n abstract = {We introduce CARLA, an open-source simulator for autonomous driving research.\n CARLA has been developed from the ground up to support development, training,\n and validation of autonomous urban driving systems. In addition to open-source\n code and protocols, CARLA provides open digital assets (urban layouts, buildings,\n vehicles) that were created for this purpose and can be used freely.\n The simulation platform supports flexible specification of sensor suites and\n environmental conditions. We use CARLA to study the performance of three\n approaches to autonomous driving: a classic modular pipeline, an end-to-end model\n trained via imitation learning, and an end-to-end model trained via reinforcement learning.\n The approaches are evaluated in controlled scenarios of increasing difficulty,\n and their performance is examined via metrics provided by CARLA, illustrating the platform\u2019s utility for autonomous driving research.},\n}\n\n\n```\n",
"bugtrack_url": null,
"license": "GPL-3.0",
"summary": "Interface between CommonRoad and the traffic simulator CARLA.",
"version": "1.0.0",
"project_urls": {
"Documentation": "https://cps.pages.gitlab.lrz.de/commonroad/commonroad-carla-interface/",
"Forum": "https://github.com/CommonRoad/commonroad-carla-interface/discussions",
"Homepage": "https://commonroad.in.tum.de",
"Source": "https://github.com/CommonRoad/commonroad-carla-interface"
},
"split_keywords": [
"autonomous",
" automated",
" vehicles",
" driving",
" motion",
" planning",
" simulation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "526d2434528a9bda7aae159992dc1edf68b53e319a3d144803c045f3e5f2bc6c",
"md5": "b7dd72158e776cef07c4069bb9d22953",
"sha256": "6941f0b148608cc71ec5ca0966c8bd70409952c3648e2afb6defa4f6f7a16b2e"
},
"downloads": -1,
"filename": "commonroad_carla_interface-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b7dd72158e776cef07c4069bb9d22953",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.11,>=3.9",
"size": 108560,
"upload_time": "2024-12-21T08:58:18",
"upload_time_iso_8601": "2024-12-21T08:58:18.221834Z",
"url": "https://files.pythonhosted.org/packages/52/6d/2434528a9bda7aae159992dc1edf68b53e319a3d144803c045f3e5f2bc6c/commonroad_carla_interface-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f0a50e2e87318f47e08b85aa533635b49994a34fa3a6905839043e0a3b58b134",
"md5": "ae23aae5e34296a61258d5918c994732",
"sha256": "395d5779ab45b4a05ac90227603f3993929b96421c217b6f577d19e3082de50a"
},
"downloads": -1,
"filename": "commonroad_carla_interface-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "ae23aae5e34296a61258d5918c994732",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.11,>=3.9",
"size": 90485,
"upload_time": "2024-12-21T08:58:21",
"upload_time_iso_8601": "2024-12-21T08:58:21.307359Z",
"url": "https://files.pythonhosted.org/packages/f0/a5/0e2e87318f47e08b85aa533635b49994a34fa3a6905839043e0a3b58b134/commonroad_carla_interface-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-21 08:58:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "CommonRoad",
"github_project": "commonroad-carla-interface",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "commonroad-carla-interface"
}