control-traffic
하는 일
스킬은 시뮬레이터에서 자동 교통이 어떻게 달릴지 정합니다. 시험 장면에서 더 빠르거나, 더 느리거나, 더 무작위적인 교통을 원하는 사람을 위한 스킬입니다.
사용하는 경우
- ✓자동 주행 차량을 더 빠르거나 느리게 달리게 하고 싶을 때.
- ✓차들이 거리를 더 띄우거나 좁히거나, 빨간불을 무시하게 하고 싶을 때.
- ✓고정된 시드로 교통을 반복 가능하게 만들고 싶은 경우.
스킬 링크
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/python-api/control-traffic/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“모든 교통의 속도를 30퍼센트 빠르게, 거리는 3미터로 유지하고, 반복 실행을 위해 고정 시드를 써 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 차량이 생성된 Traffic Manager 포트에 있는 모든 자동 주행 차량이나 한 대에 설정을 적용합니다. 반복 실행을 위해 시드를 정할 수도 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Control the Traffic Manager
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.
Shape how autopilot vehicles drive — globally (all cars on a TM port) or
per-vehicle. This is the counterpart to control-vehicle:
that skill drives one car manually; this one tunes the autonomous traffic. It
affects cars enrolled in autopilot (see spawn-vehicles),
on the matching --tm-port.
Instructions
Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh), clear FAILs
- [ ] Step 2: Have autopilot vehicles on the TM port (spawn-vehicles)
- [ ] Step 3: Apply global and/or per-vehicle settings
- [ ] Step 4: Watch the change on a rendered server
Commands need CARLA_HOST/CARLA_PORT/TM_PORT from scripts/env.sh. Use the
same --tm-port the vehicles were spawned on (default 8000).
Step 1: Check prerequisites
bash scripts/check_env.sh
Step 3: Tune
source scripts/env.sh
# GLOBAL: all traffic 30% faster than the limit, keep 3 m, deterministic
python3 scripts/traffic.py global --speed-diff -30 --distance 3 --seed 42
# EVERY car: run 50% of red lights, allow lane changes
python3 scripts/traffic.py all --ignore-lights 50 --auto-lane-change on
# ONE car (the ego's neighbour): crawl, hug the right, TM manages its lights
python3 scripts/traffic.py vehicle --id 42 --speed-diff 60 --lane-offset 0.5 --lights on
# make the ego's autopilot reckless
python3 scripts/traffic.py vehicle --role hero --ignore-vehicles 40 --ignore-signs 100
# TM sync (only alongside a synchronous world — see set-world-settings)
python3 scripts/traffic.py sync on
Step 4: Verify
Watch the traffic on a rendered server. Settings are write-only on the TM (no read-back), so the command reports what it set and to how many vehicles.
Examples
Example 1: faster traffic
User says: "make the traffic move faster"
global --speed-diff -40 (40% above the limit). Negative = faster.
Example 2: chaos for testing
User says: "make cars run lights and ignore each other"
all --ignore-lights 100 --ignore-vehicles 60 — expect collisions (that's the
point of the test).
Example 3: deterministic traffic run
User says: "same traffic behaviour every run"
global --seed 42, in synchronous mode (sync on + set-world-settings), spawn
with a seed. Seed + sync is what makes it reproducible.
Troubleshooting
Problem: nothing changes
Cause: cars aren't on this TM port, or aren't on autopilot, or you set the ego
(which you're driving manually).
Solution: match --tm-port to the spawn; ensure autopilot is on (spawn-vehicles
default); target autopilot cars.
Problem: cars froze after sync on
Cause: TM sync without a synchronous, ticked world (or vice-versa).
Solution: keep TM sync and world sync in step and tick the world (set-world-settings).
Problem: --speed-diff 30 made them slower, not faster
Cause: the value is % below the limit.
Solution: use a negative value to go faster (-30 = 30% above the limit).
Problem: collisions everywhere
Cause: high --ignore-vehicles / --ignore-lights.
Solution: lower them; 0 restores full caution.
Outputs
Traffic Manager behaviour state (global + per-vehicle). No file, no read-back; the command reports what it applied.
Detail (every setting, the speed-difference sign, hybrid physics, determinism, sync coupling) in references/traffic-manager.md.
자주 묻는 질문
어떤 설정을 바꿀 수 있나요?
속도, 차간 거리, 신호나 표지 무시, 차선 변경, 차선 오프셋, 결정적 시드입니다.
내 차도 제어하나요?
아니요. 자동 주행 차량을 조절하며, 수동 운전은 별도의 스킬이 다룹니다.
어떤 포트를 써야 하나요?
차량을 생성할 때 쓴 Traffic Manager 포트이며, 기본값은 8000입니다.
상세 정보
작성자의 원본 설명
Tunes the CARLA Traffic Manager that drives autopilot vehicles — global and per-vehicle speed, following distance, running lights/signs, lane-change behaviour, lane offset, TM-managed lights, deterministic seed, hybrid physics, and TM sync mode. Use when the user asks to "make the traffic faster/slower", "let cars run red lights", "keep more distance", "stop lane changes", "make traffic deterministic", or otherwise change how autopilot cars behave. For manually driving one car, use control-vehicle.
repo: carla-simulator/carla
인기도
- GitHub 스타
- 15k
- 순위
- #11088
- 라이선스
- 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 평가를 실행하도록 돕습니다. 먼저 설정을 확인하고, 재개할 수 있는 체크포인트를 저장합니다.