zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

Carla使用OpenStretMap自动生成地图与制作用于插件的全新存储库

存储自动插件 生成 制作 地图 用于 全新
2023-09-14 09:09:14 时间

OpenStreetMap integration


Warning! This feature is still in experimental phase.

OpenStreetMap is an open license map of the world developed by contributors. Sections of these map can be exported to an XML file in .osm format. CARLA can convert this file to OpenDRIVE format, and ingest it as any other OpenDRIVE map using the OpenDRIVE Standalone Mode. The process is detailed in the documentation, but here is a summary.

1. Obtain a map with OpenStreetMap — Go to OpenStreetMap, and export the XML file containing the map information.

2. Convert to OpenDRIVE format — To do the conversion from .osm to .xodr format, two classes have been added to the Python API.

  • carla.Osm2Odr – The class that does the conversion. It takes the content of the .osm parsed as string, and returns a string containing the resulting .xodr.
    • osm_file — The content of the initial .osm file parsed as string.
    • settings — A carla.Osm2OdrSettings object containing the settings for the conversion.
  • carla.Osm2OdrSettings – Helper class that contains different parameters used during the conversion.
    • use_offsets (default False) — Determines whereas the map should be generated with an offset, thus moving the origin from the center according to that offset.
    • offset_x (default 0.0) — Offset in the X axis.
    • offset_y (default 0.0) — Offset in the Y axis.
    • default_lane_width (default 4.0) — Determines the width that lanes should have in the resulting XODR file.
    • elevation_layer_height (default 0.0) — Determines the height separating elements in different layers, used for overlapping elements. Read more on layers for a better understanding of this.

3. Import into CARLA – The OpenDRIVE file can be automatically ingested in CARLA using the OpenDRIVE Standalone Mode. Use either a customized script or the config.py example provided in CARLA.

Here is an example of the feature at work. The image on the left belongs to the OpenStreetMap page. The image on the right is a fragment of that map area ingested in CARLA.

在这里插入图片描述

Warning! The roads generated end abruptly in the borders of the map. This will cause the TM to crash when vehicles are not able to find the next waypoint. To avoid this, the OSM mode is set to True by default. This will show a warning, and destroy vehicles when necessary.

http://carla.org/