set-world-settings
它能做什么
这项技能用于修改已经运行的 CARLA 驾驶模拟器的时间和绘制设置。适合测试自动驾驶或机器人软件、需要可重复运行的人。
适用场景
- ✓当你希望模拟器等待每一步,使每次运行都以相同方式进行时。
- ✓当你需要设置固定帧率或关闭绘制以加快测试运行时。
- ✓当你想确认模拟器当前的时间设置与你的要求一致时。
技能链接
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/python-api/set-world-settings/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“你能在我的 CARLA 模拟器中开启逐步模式,设为每秒 20 帧,并确认它已生效吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体把新设置发送给正在运行的模拟器,然后读回设置进行确认。交通系统会自动与时间模式保持一致。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Set CARLA world settings
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 how a running server steps time and renders, from a client, and read
the result back. The deliverable is verified server state: after any change the
WorldSettings are re-read (apply_settings returns a frame id, not the state).
The core switch is synchronous vs asynchronous:
- async (default): the server free-runs on its own clock; the client observes.
- sync: the server advances only when the client calls
world.tick(), at a fixedfixed_delta_secondsstep — required for frame-aligned sensors and reproducible runs.
This skill couples the Traffic Manager to that switch automatically: sync
also sets the TM synchronous, async also sets it asynchronous. A mismatched
pair is a classic source of jittery or frozen traffic. Full semantics:
references/world-settings.md.
Instructions
Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh), clear FAILs
- [ ] Step 2: Show current settings
- [ ] Step 3: Apply sync / async / a field change (TM follows sync|async)
- [ ] Step 4: Verify the VERIFY block matches the intent
- [ ] (on exit) Restore async so the server self-ticks — never leave it stuck in sync
Commands need CARLA_HOST/CARLA_PORT/TM_PORT from scripts/env.sh (defaults
127.0.0.1:2000, TM 8000). Prefix 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. It also warns if
the server is already in sync mode (it will look "frozen" without a ticker).
Step 2: Show current settings
source scripts/env.sh
python3 scripts/world_settings.py show
Step 3: Apply
# synchronous mode at 20 fps (0.05 s step); TM set synchronous too
python3 scripts/world_settings.py sync --fps 20
# give the step directly instead of fps
python3 scripts/world_settings.py sync --delta 0.05
# sync + headless physics (no rendering)
python3 scripts/world_settings.py sync --fps 20 --no-rendering
# restore asynchronous mode; TM set asynchronous too
python3 scripts/world_settings.py async
# change individual fields without touching sync/TM (any WorldSettings field)
python3 scripts/world_settings.py set --no-rendering off
python3 scripts/world_settings.py set --fixed-delta none # back to variable step
python3 scripts/world_settings.py set --deterministic-ragdolls on --max-culling-distance 500
python3 scripts/world_settings.py set --tile-stream-distance 2000 --actor-active-distance 1500
python3 scripts/world_settings.py set --substepping on --substeps 16 --substep-dt 0.0125
Low freedom on two fragile points: fixed_delta_seconds should stay <= 0.1 for
stable physics (the script warns and auto-raises max_substeps to keep the
substep budget), and after enabling sync you must world.tick() to advance.
Step 4: Verify
Each command prints a VERIFY block: synchronous_mode, fixed_delta_seconds
(+ derived fps), no_rendering_mode, substepping fields, and the TM sync state it
set. Confirm they match the request — e.g. sync --fps 20 ⇒ synchronous_mode = True, fixed_delta_seconds = 0.05, traffic_manager sync = True.
On exit: restore async
Leaving the server in sync mode with nothing ticking makes it appear hung to the
next client. When a sync-mode task ends, run async to hand the clock back to the
server. This is the default job's clean-exit step, not an opt-in extra.
Examples
Example 1: set up a deterministic capture loop
User says: "put the sim in sync mode at 20 fps"
python3 scripts/world_settings.py sync --fps 20. VERIFY: synchronous_mode=True,
fixed_delta_seconds=0.05, traffic_manager sync=True. Then tick from your client.
Example 2: tear down cleanly
User says: "I'm done, put it back to normal"
python3 scripts/world_settings.py async. VERIFY: synchronous_mode=False,
fixed_delta_seconds=None, traffic_manager sync=False. Server self-ticks again.
Example 3: keep settings across a map load
User says: "switch to Town02 without dropping my sync settings"
sync --fps 20 here, then the load-map skill with
--keep (`res
常见问题
这会在模拟器运行时更改它吗?
会。它修改的是已经运行的服务器,因此无需重启。
逐步模式是什么意思?
模拟器只有在你的测试程序要求时才前进,因此每次运行都可以精确重复。
它也控制交通吗?
会。时间模式改变时,交通管理器会自动切换以匹配。
详情
作者的原始描述
Reads and changes a running CARLA server's WorldSettings via apply_settings — synchronous vs asynchronous mode, fixed_delta_seconds (fps), physics substepping, and no_rendering_mode — and keeps the Traffic Manager's sync state matched automatically. Use when the user asks to "enable/disable sync mode", "set synchronous mode", "run at a fixed fps/step", "turn off rendering", "make the sim deterministic", or "restore async mode", and as the prerequisite for keeping settings across a map load.
repo: carla-simulator/carla
热度
- GitHub 星标
- 15k
- 排名
- #11101
- 许可证
- 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 评估器,先检查设置,并保存可以恢复的检查点。