load-map
它能做什么
这项技能用于更换模拟器正在运行的地图。适合想在其他城镇或道路网络中测试的开发者。
适用场景
- ✓当你想把模拟器切换到其他城镇或地图时。
- ✓当你想重新加载当前世界时。
- ✓当你想加载 OpenDRIVE 道路文件,或开启或关闭地图图层时。
技能链接
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/python-api/load-map/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我在正在运行的服务器上加载 Town10,并保留当前的同步设置。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会列出或指定地图,通过 Python API 加载,然后读取地图名称和设置进行确认。保留设置选项会把当前的同步和渲染模式带入新世界。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Load a CARLA map
Paths.
scripts/…andreferences/…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/mapre-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_localrequest (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: 1and publishes nothing, because
常见问题
保留设置是什么意思?
它会把当前的同步模式、时间步长和渲染模式带入新地图,而不是重置它们。
它会检查地图是否已切换吗?
会。每次加载后,它都会读取地图名称和设置进行核对。
可以加载自定义道路文件吗?
可以。它可以从 OpenDRIVE 的 .xodr 文件生成世界。
详情
作者的原始描述
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.
repo: carla-simulator/carla
热度
- GitHub 星标
- 15k
- 排名
- #11093
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
create-leaderboard-route
15k帮你的智能体通过在模拟器视角中放置路径点和场景触发器,构建 CARLA Leaderboard 路线文件,并对其进行检查和排序。
package-leaderboard-agent
15k帮你的智能体把驾驶智能体打包成 Docker 镜像,用于提交 CARLA Leaderboard,并检查文件夹结构,测试镜像能否加载它。
read-leaderboard-results
15k帮你的智能体阅读 CARLA Leaderboard 结果文件,解释每条路线的得分和违规情况,并按另一规则版本重新计分。
run-leaderboard-evaluation
15k帮你的智能体用你的驾驶智能体在一组路线上运行 CARLA Leaderboard 评估器,先检查设置,并保存可以恢复的检查点。