run-carla-server
Skill này làm gì
Skill khởi động simulator CARLA để chương trình Python của bạn có thể kết nối và điều khiển nó. Skill dành cho bất kỳ ai cần simulator chạy để kiểm thử hoặc thí nghiệm.
Khi nào nên dùng
- ✓Khi bạn muốn khởi động CARLA để code kiểm thử của bạn có thể kết nối.
- ✓Khi bạn muốn chạy simulator không có cửa sổ, để làm việc nhanh hơn hoặc từ xa.
- ✓Khi bạn cần simulator chạy với tùy chọn ROS 2 được bật.
Liên kết skill
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/ue4/run-carla-server/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể khởi động simulator CARLA của tôi từ thư mục đã tải về, không có cửa sổ, và cho tôi biết khi nào nó sẵn sàng để kết nối không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent xác định thư mục của bạn chứa bản phát hành đã tải về, gói đã đóng gói hay thư mục mã nguồn, rồi khởi động chương trình đúng. Nó tắt server một cách sạch sẽ khi bạn xong việc.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Run a CARLA server
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.
Starts a CARLA server a carla.Client can connect to. Use it to verify authored
content ([[add-carla-vehicle]]), run traffic scenarios, or feed the MCP's
live-simulator tools. It is NOT for asset editing — that is [[ue4-editor-python]]
(editor commandlet, no RPC).
Point it at a CARLA; it works out the rest
You name one path, the skill detects which of the three shapes it is and launches accordingly:
| Detected | What it found | Rendering | Needs UE4_ROOT |
|---|---|---|---|
package |
<path>/CarlaUE4.sh — a downloaded/extracted release |
real | no |
dist |
<path>/Dist/CARLA_*/LinuxNoEditor/CarlaUE4.sh — cooked in a checkout |
real | no |
editor |
<path>/Unreal/CarlaUE4/CarlaUE4.uproject — a source checkout |
none (-nullrhi) or windowed |
yes |
CARLA_TARGET=~/CARLA_0.9.16 bash scripts/run_server.sh # a download
CARLA_UE4_ROOT=~/carla bash scripts/run_server.sh # a checkout
DETECT=1 CARLA_TARGET=~/CARLA_0.9.16 bash scripts/run_server.sh # report, launch nothing
Resolution order is CARLA_TARGET → CARLA_PACKAGE_ROOT → CARLA_UE4_ROOT →
$PWD, and a path you name explicitly that holds no CARLA is an error, never
a silent fallback to a different install.
A checkout that has cooked a package can be run either way, so detection prefers
the cooked build (it renders properly and boots faster). Force the choice with
RUN_MODE:
| Knob | Effect |
|---|---|
RUN_MODE=auto |
default — cooked build if present, else editor |
RUN_MODE=package |
only a cooked build; error if there is none (PACKAGED=1 is the old spelling) |
RUN_MODE=editor |
run the source checkout through UE4Editor even if a package exists |
WINDOW=1 |
windowed instead of headless — works for both cooked builds and the editor |
The editor caveat (build-carla-ue4 L17): uncooked content has no mesh distance
fields, so the real renderer crashes headless. That is why editor mode defaults
to -nullrhi (no images at all) and WINDOW=1 disables DF generation. For camera
and lidar images, run a cooked build.
Boot time is tens of seconds, not a fixed number — measured here on Town02
headless: ~38 s cold (32 s of it LoadMap), less when warm; heavy maps and a
cold shader cache are slower. Always poll the port (S4), never sleep a guess.
RPC + physics + Traffic Manager work in all modes; pick the cheapest one that covers what you're testing. (PACKAGED mode is encoded from build docs + L17; the uncooked modes are live-verified.)
Gotchas live in
references/lessons.md— read before debugging.S#citations below point at it.
Instructions
Run Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh), clear FAILs
- [ ] Step 2: Pick a mode and launch (backgrounded), poll the RPC port
- [ ] Step 3: Verify a client round-trips
- [ ] Step 4: Stop the server cleanly (see S3 — never pkill -f the uproject)
Prerequisites
- Roots resolve via
scripts/env.sh(both overridable):UE4_ROOT(uncooked modes launch the editor) andCARLA_UE4_ROOT(the checkout to serve). Export them, or run from inside the checkout. editormode only: UE4 built + content fetched ([[build-carla-ue4]] steps 03, 05).- A cooked build: either an extracted release (
CARLA_TARGET) orDist/CARLA_*from [[package-carla-ue4]]. Needs no UE4_ROOT and no content checkout. - Verify client: any active CARLA client env (the wheel installed by build step 04); no manager is assumed.
Quick start
cd Skills/ue4/run-carla-server
bash scripts/check_env.sh
# headless smoke-test server, backgrounded DETACHED (see the note below)
setsid nohup bash scripts/run_server.sh </dev/null >/tmp/carla_server.log 2>&1 &
until nc -z 127.0.0.1 2000; do sleep 1; done # poll, don't sleep blindly
# ... use it (spawn_test.py, MCP tools, any carla.Client) ...
pkill -x UE4Editor # clean stop (see S3!)
ROS 2 native interface (ROS2=1, opt-in)
Orthogonal to the three modes above — it composes with all of them:
ROS2=1 bash scripts/run_server.sh # fastdds, domain 0
ROS2=1 RMW=zenoh ROS_DOMAIN_ID=5 bash scripts/run_ser
Câu hỏi thường gặp
Nó có chạy không có cửa sổ không?
Có. Server có thể chạy không có cửa sổ hiển thị.
Nếu tôi đưa vào một thư mục mã nguồn thì sao?
Nó chạy mã nguồn qua trình soạn thảo Unreal và cần đường dẫn engine được đặt.
Tôi có thể chỉ xem nó sẽ làm gì không?
Có. Chế độ phát hiện báo cáo những gì nó tìm thấy mà không khởi chạy gì.
Chi tiết
Mô tả gốc của tác giả
Launches a CARLA RPC server a carla.Client can connect to, working out for itself what you pointed it at — a downloaded/extracted release, a package cooked inside a checkout, or a source checkout run through the UE4 editor — headless or windowed, and shuts it down cleanly. ROS2=1 starts it with the native ROS 2 interface active (--ros2, --rmw=fastdds/cyclonedds/zenoh, --ros-domain-id). Use when the user asks to "run/start the CARLA server", "boot CARLA headless", "launch CARLA with a window", "run the CARLA I downloaded", "start CARLA with ROS2 enabled", or "serve a packaged CARLA build".
repo: carla-simulator/carla
Độ phổ biến
- Sao GitHub
- 15k
- Vị trí xếp hạng
- #11127
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
create-leaderboard-route
15kGiúp agent của bạn tạo file tuyến đường CARLA Leaderboard bằng cách đặt các điểm waypoint và trigger kịch bản từ camera của simulator, rồi kiểm tra và sắp xếp chúng.
package-leaderboard-agent
15kGiúp agent của bạn đóng gói một agent lái xe thành image Docker để nộp lên CARLA Leaderboard, kiểm tra cấu trúc thư mục và thử rằng image nạp được agent.
read-leaderboard-results
15kGiúp agent của bạn đọc file kết quả CARLA Leaderboard, giải thích điểm và vi phạm của từng tuyến, và chấm lại một lần chạy theo phiên bản luật khác.
run-leaderboard-evaluation
15kGiúp agent của bạn chạy bộ đánh giá CARLA Leaderboard trên một tập tuyến với agent lái xe, kiểm tra thiết lập trước và lưu checkpoint để có thể tiếp tục.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.