本文へ移動
cccskills
無料GitHub で公開

load-map

Loads, reloads, and reshapes the map on a running CARLA server via the Python API — get_available_maps, load_world and reload_world (with or without resetting world settings), generate a world from an OpenDRIVE .xodr, and load/unload map layers. Use when the user asks to "load a map", "change the town", "reload the world", "list available maps", "load an xodr/opendrive map", or "load/unload map layers", and when settings (sync mode, fixed delta) must survive the switch.

インストール方法を見る

含まれるファイル(5)

  • SKILL.md9.7 KB
  • references/map-loading.md6.9 KB
  • scripts/check_env.sh2.3 KB
  • scripts/env.sh1.9 KB
  • scripts/load_map.py11.8 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Load a CARLA map

Paths. scripts/… and references/… below are relative to the directory holding this SKILL.md. Your working directory is the user's project, not that directory, so prefix them with its absolute path or the command is not found.

Change what map a running server hosts, from a client. The deliverable is a verified world: after any load the map name and the sync/rendering settings are read back, because a load can quietly land on a different map or reset settings.

The one decision that governs every load: reset settings, or keep them? reset_settings=True (the API default) drops the new world to async/default rendering; reset_settings=False carries your current synchronous_mode, fixed_delta_seconds, and no_rendering_mode across. In this skill that is the --keep flag. Full semantics: references/map-loading.md.

Instructions

Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh), clear FAILs
- [ ] Step 2: List maps if the target name is unknown
- [ ] Step 3: Do the operation (load / reload / opendrive / layer), keep-settings if a sync pipeline is live
- [ ] Step 4: Verify the printed map name + settings match what was asked

All commands need CARLA_HOST/CARLA_PORT from scripts/env.sh (defaults 127.0.0.1:2000). Prefix any command with source scripts/env.sh or export them.

Step 1: Check prerequisites

bash scripts/check_env.sh

FAILs only on a missing carla module or an unreachable server — both are hard blockers for a client operation. Start a server first if it FAILs (no server is launched by this skill).

Step 2: List available maps

source scripts/env.sh
python3 scripts/load_map.py list

Names are returned stripped of the /Game/Carla/Maps/ prefix, so Town03, Town10HD_Opt, etc. — pass those straight to load.

Friendly names resolve, but not uniformly — load maps a bare town name to the map actually used: Town2 → Town02 (non-opt, like every numbered town except one), but Town10 → Town10HD_Opt (Town10's canonical map is the layered HD one; plain Town10HD exists but is effectively unused). An explicit exact name (Town02_Opt, Town10HD) is always honoured as typed; load prints what it resolved to.

Step 3: Do the operation

# load a map, resetting settings to default (the plain case)
python3 scripts/load_map.py load --map Town03

# load a map but KEEP current settings — use inside a sync-mode pipeline
python3 scripts/load_map.py load --map Town03 --keep

# reload the current map (fresh actors), reset vs keep settings
python3 scripts/load_map.py reload
python3 scripts/load_map.py reload --keep

# build a world from an OpenDRIVE file (road network only, no props)
python3 scripts/load_map.py opendrive --xodr /path/to/road.xodr

# build a world from an OpenStreetMap export (.osm -> xodr -> world)
python3 scripts/load_map.py osm --osm /path/to/city.osm

# stream layers in/out on a layered ('_Opt') map already loaded
python3 scripts/load_map.py load --map Town10HD_Opt --layers Ground,Buildings
python3 scripts/load_map.py layer --load Foliage,ParkedVehicles
python3 scripts/load_map.py layer --unload ParkedVehicles

Low freedom on the two fragile points — --keep when a sync pipeline is live, and layers only on _Opt/large maps; otherwise choose maps/params freely.

Step 4: Verify

Every mutating command prints a VERIFY block (map name + synchronous_mode, fixed_delta_seconds, no_rendering_mode). Do not trust that a call returned — confirm the block: the map name is the one you asked for, and the settings are default (plain) or unchanged (--keep). An OpenDRIVE world reports its name as Carla/Maps/OpenDriveMap.

On a ROS 2 server

A map switch is an episode switch, so on a server started with --ros2 ([[run-carla-server]] ROS2=1):

  • rt/carla/map re-publishes automatically — the new map's full OpenDRIVE, as a latched (transient_local) std_msgs/String. Verified: the sample content changes with the map. It carries no header, so there is no stamp or episode id to correlate with; reading it needs an explicit --qos-durability transient_local request (plus --full-length, or it truncates at 128 chars).
  • Every actor is destroyed — but its topics do NOT go away. Verified: after a switch the old sensor topic is still listed with Publisher count: 1 and publishes nothing, because the ROS 2 layer does not unregister publishers on episode teardown. Re-spawning with the same ros_name then gives Publisher count: 2 — one live, one zombie — and it accumulates per switch. A subscriber can match the dead endpoint and wait forever.
  • Re-spawn and re-enable after the switch ([[spawn-vehicles]], [[create-sensor]] --ros): ros_names and enable_for_ros() state are gone with the actors even though the topics linger.
  • rt/clock keeps ticking. Restart the server if the zombie publishers matter for what you are measuring.

Verifying it needs a ROS 2 consumer ([[visualize-ros-rviz]]); from the RPC side, [[world-data]] ros-topics shows what the new episode should be publishing — and disagreement with ros2 topic list after a map change is expected, for the reason above.

On CARLA 0.10.0 (the UE5 line: 5.5 and 5.8)

Map layers are a silent no-op on 0.10.0. The calls succeed, return without error, and change nothing. Measured on Town10HD_Opt with a 40-ray sweep at 3 m height: Buildings geometry was hit 9 times before unload_map_layer( MapLayer.Buildings), 9 times after, and 9 times again after reloading — and the server log records no streaming activity at all.

The cause is content, not the API. ACarlaGameModeBase::UnLoadMapLayer still streams sublevels, and ConvertMapLayerMaskToMapNames matches layer names against World->GetStreamingLevels() — but the UE5 conversion flattened the layers into the persistent level. Town10HD_Opt.umap is 32.9 MB with zero LevelStreaming references on 0.10.0, against 158 KB with two on 0.9.x, where it streamed T10HD_Buildings, T10HD_Props, T10HD_Foliage and friends. The sublevel .umap files still sit in Content/Carla/Maps/Sublevels/Town10HD_Opt/ as orphans, so nothing matches and nothing happens.

To hide geometry on 0.10.0 use enable_environment_objects instead ([[toggle-env-objects]]). load_world, reload_world, get_available_maps, generate_opendrive_world and the settings-preservation behaviour are all unchanged.

get_ego_spawn_points() is new, and UE 5.8 only — spawn points the map author marked for the hero vehicle, a subset of get_spawn_points(). On 5.5 it raises AttributeError ([[check-ue5-limitations]]).

Examples

Example 1: just switch town

User says: "load Town05"

python3 scripts/load_map.py load --map Town05. VERIFY shows map = Carla/Maps/Town05, synchronous_mode = False (reset to default). Done.

Example 2: switch town without breaking a sync-mode data run

User says: "I'm recording in sync mode at 20 fps — switch to Town02 but keep my settings"

python3 scripts/load_map.py load --map Town02 --keep. VERIFY must still show synchronous_mode = True, fixed_delta_seconds = 0.05. Because sync mode is preserved, tick the world to advance it (the command prints this note).

Example 3: load a custom road

User says: "load this opendrive file as the world"

python3 scripts/load_map.py opendrive --xodr ./my_road.xodr. VERIFY shows Carla/Maps/OpenDriveMap. It is a road network only — no buildings or props.

Example 4: minimal map, then add buildings

User says: "load Town10 with just the ground, then bring buildings in"

load --map Town10HD_Opt --layers Ground then layer --load Buildings.

Troubleshooting

Error: FAIL no CARLA server at 127.0.0.1:2000 Cause: no server running, or wrong host/port. Solution: start a CARLA server, or set CARLA_HOST/CARLA_PORT to the right one.

Error: FAIL cannot import carla Cause: the active interpreter has no carla module. Solution: activate the env with the PythonAPI wheel, or set PYTHON to it.

Problem: sync mode "lost" after loading a new map Cause: load_world/reload_world default to reset_settings=True. Solution: pass --keep (reset_settings=False). See the reference.

Problem: layer --load/--unload does nothing Cause: the current map is fully baked (not an _Opt/large map); it has no toggleable layers. Solution: load an _Opt map first (Town01_Opt … Town10HD_Opt) or a large map.

Outputs

This skill produces server state, not a file: the running server now hosts the requested map, with settings reset or preserved as asked. The VERIFY block is the confirmation of that state.

Deeper detail — the exact reset_settings behaviour, the full MapLayer list, OpenDRIVE generation parameters, and the sync/Traffic-Manager gotchas — is in references/map-loading.md.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Adds a new ROS 2 message type to CARLA's native ROS 2 interface — the hand-written POD struct under LibCarla/source/carla/ros2/types/msg, its Fast-CDR serialize/deserialize pair, the RIHS01 type hash computed in Docker, the CdrTopicInfo registration and the type-hash test. Use when the user asks to "add a ROS message type", "support sensor_msgs/X in CARLA", "add a carla_msgs type", "why is my type hash warning appearing", or needs a message CARLA does not publish yet. There is no IDL codegen — every step is manual.

日本語の概要は準備中です。原文の説明を表示しています。

carla-simulator/carla-agentic-tools42026年9月12日 更新

Adds a new topic to CARLA's native ROS 2 interface — a publisher (BasePublisher + PublisherImpl, topic suffix, QoS, registration in ROS2::GetOrCreateSensor, a ProcessDataFrom* entry point and its call site in the UE4 plugin) or a subscriber that lets ROS drive an actor. Also covers adding a middleware (RMW) behind IPublisherMiddleware. Use when the user asks to "publish X to ROS from CARLA", "add a ROS topic/publisher/subscriber", "make the obstacle/lane-invasion sensor publish", "add odometry to ROS", or "add another RMW".

日本語の概要は準備中です。原文の説明を表示しています。

carla-simulator/carla-agentic-tools42026年9月12日 更新

Reads and summarises ScenarioRunner output — the criteria pass/fail tables from --output/--file, the machine-readable --json and --junit result files, and the criteria JSON written alongside a --record recording — and runs the metrics module (metrics_manager.py) to compute custom measurements over a recorded run offline, without the simulator. Use when the user asks "did the scenario pass", "why did it fail", "summarise these results", "compare these runs", or wants distance/speed/lane metrics from a recording.

日本語の概要は準備中です。原文の説明を表示しています。

carla-simulator/carla-agentic-tools42026年9月12日 更新

Gets actor and level 3D bounding boxes and projects them into a camera image as 2D boxes — the dataset-annotation workflow. Lists box geometry, draws 3D boxes in the world via debug, or captures one camera frame and writes an annotated PNG plus a JSON of 2D boxes for matching actors. Use when the user asks to "get bounding boxes", "draw boxes around the cars", "project boxes onto the camera", or "generate a detection dataset / annotations".

日本語の概要は準備中です。原文の説明を表示しています。

carla-simulator/carla-agentic-tools42026年9月12日 更新

Builds CARLA (branch ue4-dev, Unreal Engine 4.26) from source on Linux end-to-end — UE4 fork, the Carla server (editor C++ modules), the LibCarla Python client wheel, and content — then verifies them against a from-source server. Optionally builds the native ROS 2 interface in (ROS2=1 → --ros2, Fast-DDS/CycloneDDS/Zenoh), which is compile-time only and cannot be enabled later. Use when the user asks to "build CARLA from source", "compile CARLA ue4-dev", "set up CARLA on Ubuntu (incl. 24.04)", "build CARLA with ROS2 support", or "produce a CARLA server + client wheel". Cooking a distributable Dist/ package is a separate skill (package-carla-ue4); running the build is run-carla-server.

日本語の概要は準備中です。原文の説明を表示しています。

carla-simulator/carla-agentic-tools42026年9月12日 更新

Builds CARLA on Unreal Engine 5.8 from the ue58-dev branch using its CMake build system — configure a preset, then build the carla-unreal / carla-unreal-editor / carla-python-api-install / launch targets — with ROS 2, DLSS, RSS and cook-scope options, and the engine-side build of the CarlaUnreal UE 5.8 fork. There is no Makefile and no Util/BuildTools in this tree, so every UE4 `make` recipe is invalid here. Use when the user asks to "build CARLA UE5", "build ue58-dev", "compile CARLA with cmake", "rebuild the Python API", or hits a CMake configure or target failure.

日本語の概要は準備中です。原文の説明を表示しています。

carla-simulator/carla-agentic-tools42026年9月12日 更新

carla-simulator のスキルをすべて見る

このスキルの問題を報告する