spawn-vehicles
하는 일
이 스킬은 실행 중인 CARLA 도로 시뮬레이션에 차량을 추가하고, 작업이 끝나면 제거합니다. 도로에 교통이 필요한 자율주행 소프트웨어 개발 및 테스트 담당자를 위한 스킬입니다.
사용하는 경우
- ✓스스로 주행하는 차량으로 바쁜 도로를 채우고 싶을 때.
- ✓소프트웨어가 제어할 테스트 차량 한 대를 도로에 놓아야 할 때.
- ✓추가한 차량을 정리해 시뮬레이션을 다시 비우고 싶을 때.
스킬 링크
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/python-api/spawn-vehicles/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“CARLA 도로 시뮬레이션에 자율주행 차량 40대를 추가하고, 작업이 끝나면 제거해 줄 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 지도의 스폰 지점에 차량을 배치하고, 각 차량을 교통 시스템에 넘겨 도로를 따라 주행하게 합니다. 제거하면 그 차량이 시뮬레이션에서 삭제됩니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Spawn autopilot vehicles
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.
Populate the roads with self-driving traffic. Vehicles are placed at the map's
predefined spawn points and, by default, handed to the Traffic Manager
autopilot at spawn time so they drive the road network autonomously. destroy
removes them.
spawn and line make the world synchronous. The Traffic Manager is not
reliable driving an asynchronous server: it runs its own loop against a server
advancing at whatever rate it likes. Measured on 0.10.0, async, 50 autopilot
vehicles with the spawning client alive and holding the TM: only 24 were
moving, and the actor count decayed on its own — 50 vehicles down to 39 and 15
walkers down to 5 over a couple of minutes. With a fixed timestep and the TM in
sync, 37 of 50 move and nothing decays. --no-sync keeps the old behaviour.
The TM cannot be driven by another client's tick
The Traffic Manager steps only when the process that created it ticks the world. Measured on 0.10.0: with a camera client owning a 20 Hz clock and this skill attached as an observer, its 40 vehicles never moved at all — no error, just a frozen scene. So a held traffic pool and a lock-step frame capture cannot share a world; record the traffic here and replay it into the capture instead ([[read-sensor]] has the recipe).
The clock rule
The world settings are read before anything else happens:
- asynchronous — this client switches it to synchronous (
--delta, default 0.05 s = 20 Hz), puts the TM in sync, and becomes the ticker. - already synchronous — another client owns the clock. This one never calls
tick(); it observes withwait_for_tick(). Ticking a world you do not own silently drops commands — it is what stoppedspawn-walkers'start()from landing.
The previous settings are restored on release, because a synchronous world with
nothing ticking does not advance and looks exactly like a hung server. Stop a
holder with Ctrl+C, never kill -9: the restore is in a finally.
The Traffic Manager lives in the client process that created it. So a
spawn that exits leaves the vehicles registered with a dead TM: they sit at
throttle 0.00 for ever, in async and sync. Pass --hold to keep the TM
open (Ctrl+C releases it, and the vehicles then coast to a stop). Measured on
0.10.0: without --hold, 0/50 vehicles move; with it, 49/50 move.
The same is true of controller.ai.walker in [[spawn-walkers]] — its
controllers stop when their client exits — so a scene with both wants two
resident processes: this one owning the clock, the walker one held as an
observer.
Instructions
Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh), clear FAILs
- [ ] Step 2: Spawn N vehicles with --hold (the TM dies with the process without it)
- [ ] Step 3: Verify visually / via the world-data skill; spawn reports its count
- [ ] Step 4: Ctrl+C the held process, then destroy when done
Commands need CARLA_HOST/CARLA_PORT/TM_PORT from scripts/env.sh.
Negative coordinates: pass --at with an = (--at=-24,-57,0.6) so the
leading minus isn't parsed as a flag.
Step 1: Check prerequisites
bash scripts/check_env.sh
Step 2-4: Spawn / list / destroy
source scripts/env.sh
# 40 vehicles driving around on autopilot — --hold keeps the TM (and so the
# driving) alive; without it they spawn, then freeze when this command returns.
# The world is put in sync at 20 Hz and this client ticks it.
python3 scripts/vehicles.py spawn --count 40 --hold
# leave the world asynchronous (the old behaviour; the TM misbehaves)
python3 scripts/vehicles.py spawn --count 40 --hold --no-sync
# a different fixed timestep
python3 scripts/vehicles.py spawn --count 40 --hold --delta 0.033
# four-wheeled cars only, reproducible
python3 scripts/vehicles.py spawn --count 30 --safe --seed 42
# only Teslas, parked (no autopilot)
python3 scripts/vehicles.py spawn --count 10 --filter 'vehicle.tesla.*' --no-autopilot
# 5 vehicles in one lane, 15 m apart, starting near (x,y,z)
python3 scripts/vehicles.py line --at 30,20,0 --count 5 --gap 15
# ...as a static queue (no autopilot), laid behind the point
python3 scripts/vehicles.py line --at 30,20,0 --count 5 --gap 15 --
자주 묻는 질문
나타나는 차량 종류를 고를 수 있나요?
네. 사용할 차량 모델을 걸러 낼 수 있으므로, 무작위 대신 특정 종류를 고를 수 있습니다.
느리거나 불안정한 시뮬레이터에서도 작동하나요?
스킬이 시뮬레이터를 단계별 모드로 설정합니다. 교통 시스템이 안정적으로 주행하려면 이 모드가 필요합니다.
교통 대신 특정 차량 한 대만 놓을 수 있나요?
네. hero 또는 ego 차량 한 대를 놓을 수 있으며, ROS 2로 데이터를 발행하도록 이름을 붙일 수도 있습니다.
상세 정보
작성자의 원본 설명
Spawns vehicles on a running CARLA server and destroys them — scattered across the map's spawn points on Traffic Manager autopilot, a row queued in a single lane at a fixed spacing, or a single hero/ego vehicle (optionally named for native ROS 2 publishing with --ros-name). Covers blueprint filtering, the atomic autopilot hand-off, and cleanup. Use when the user asks to "spawn vehicles/cars/traffic", "add N cars driving around", "put cars in a lane 15 m apart", "spawn the ego/hero vehicle", or "remove the vehicles".
repo: carla-simulator/carla
인기도
- GitHub 스타
- 15k
- 순위
- #11102
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
create-leaderboard-route
15k카메라 화면에서 웨이포인트와 시나리오 트리거를 배치하고, 확인하고, 순서를 정해 CARLA 리더보드 경로 파일을 만들도록 에이전트를 돕습니다.
package-leaderboard-agent
15k주행 에이전트를 CARLA Leaderboard 제출용 Docker 이미지로 패키징하고, 폴더 구조를 확인하며 이미지가 에이전트를 로드하는지 테스트하도록 돕습니다.
read-leaderboard-results
15kCARLA Leaderboard 결과 파일을 읽고 경로별 점수와 위반 사항을 설명하며, 다른 규칙 버전에서 실행을 다시 채점하도록 에이전트를 돕습니다.
run-leaderboard-evaluation
15k주행 에이전트로 경로 세트에 대한 CARLA Leaderboard 평가를 실행하도록 돕습니다. 먼저 설정을 확인하고, 재개할 수 있는 체크포인트를 저장합니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.