Ingesting Maps in CARLA Built From Source
This section describes the process of ingesting maps into CARLA that has been built from source. If you are using a package (binary) version of CARLA to ingest maps then follow the guidelines here instead.
The ingestion process involves importing the relevant map files by compiling them into a package. This package can then be opened in the Unreal Engine editor and customized before generating the pedestrian navigation file and finally adding it to the package.
Before you begin
- Ensure you are using a version of CARLA that has been built from source. If you are using a packaged (binary) version of CARLA then follow the tutorial here.
- You should have at least two files,
<mapName>.fbxthat have been generated from a map editor such as RoadRunner.
- These files should have the same value for
<mapName>in order to be recognised as the same map.
- You can ingest multiple maps into the same package. Each map should have a unique name.
1. Place the map files to be imported in the
Import folder found in the CARLA root directory.
2. Run the command below to ingest the files:
make import ARGS="--package <package_name> --no-carla-materials"
Note that there are two parameter flags that can be set:
--package <package_name>specifies the name of the package. By default, this is set to
map_package. Two packages cannot have the same name, so using the default value will lead to errors on a subsequent ingestion. It is highly recommended to change the name of the package.
--no-carla-materialsspecifies that you do not want to use the default CARLA materials (road textures etc). You will use the RoadRunner materials instead. This flag is only required if you are not providing your own
.jsonfile. Any value in the
.jsonfile will override this flag.
Customize the map
Before generating the pedestrian navigation, you may want to customize the map in the editor. Props such as trees, streetlights or grass zones can be added. Customization should be completed before generating the pedestrian navigation in order to avoid interference or collisions between the two, resulting in the need to generate the pedestrian navigation a second time.
- Create new spawning points. These spawning points will be used in scripts such as
- In the editor, go to the
Modespanel and search for "spawn" in the
Search Classessearch bar.
- Choose the type of spawning point you would like to create and drag it on to the map.
- Place the spawn point about 0.5-1m above the ground to prevent collisions with the road.
- In the editor, go to the
- Generate new crosswalks. Avoid doing this if the crosswalk is already defined the
.xodrfile as this will lead to duplication:
- Create a plane mesh that extends a bit over two sidewalks that you want to connect.
- Place the mesh overlapping the ground and disable it's physics and rendering.
- Change the name of the mesh to
Generate pedestrian navigation
1. To prevent the map being too large to export, select the BP_Sky object and add a tag
NoExport to it. If you have any other particularly large meshes that are not involved in the pedestrian navigation, add the
NoExport tag to them as well.
2. Double check your mesh names. Mesh names should start with any of the appropriate formats listed below in order to be recognized as areas where pedestrians can walk. By default, pedestrians will be able to walk over sidewalks, crosswalks, and grass (with minor influence over the rest):
- Sidewalk =
- Crosswalk =
- Grass =
ctrl + A to select everything and export the map by selecting
Carla Exporter. A
<mapName>.obj file will be created in
4. Move the
<mapName>.obj and the
5. Run the following command to generate the navigation file:
build.bat <mapName> # <mapName> has no extension
./build.sh <mapName> # <mapName> has no extension
<mapName>.bin file will be created. This file contains the information for pedestrian navigation on your map. Move this file to the
Nav folder of the package that contains the map.
Your map is now ready to run simulations in CARLA. If you have any questions about the process then you can ask in the forum or you can try running some of our example scripts on your new map to test it out.