run-scenario
하는 일
이 스킬은 CARLA 시뮬레이터의 기본 제공 주행 테스트 시나리오 중 하나를 시작하며, 설치된 버전이 실행할 수 있는 시나리오 목록도 보여 줄 수 있습니다. 정해진 상황에서 자율주행 소프트웨어가 어떻게 대응하는지 테스트하는 사람을 위한 스킬입니다.
사용하는 경우
- ✓앞차를 따라가는 것 같은 표준 테스트를 실행하고 싶을 때.
- ✓고르기 전에 설치된 버전이 어떤 시나리오를 지원하는지 보고 싶을 때.
- ✓테스트가 메인 차량을 제어하게 하거나 내 프로그램이 운전하게 하고 싶을 때.
스킬 링크
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/scenario-runner/run-scenario/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“CARLA에서 FollowLeadingVehicle 테스트를 실행하고, 내 차가 통과했는지 보여 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 설정 이름으로 시나리오를 고르고, 지도가 시나리오와 맞는지 확인한 뒤 실행을 시작합니다. 필요하면 지도를 다시 불러오고, 테스트가 끝나면 결과를 보고합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Run a scenario
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.
A "scenario" here is a Python class in srunner/scenarios/ plus an XML config in
srunner/examples/ that gives it a town, an ego spawn point and parameters. You
select it by the config name (FollowLeadingVehicle_1), not the class name.
Two things decide whether a run works, and both are silent when wrong:
- the branch — which scenarios and which towns exist at all,
- the map — a scenario declares its town, and ScenarioRunner refuses to run if the server is on a different one unless you let it reload.
Instructions
Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh), clear FAILs
- [ ] Step 2: List what this checkout can run
- [ ] Step 3: Run it, with --reloadWorld unless the map already matches
- [ ] Step 4: Give the ego a driver (manual_control or an agent) if it needs one
- [ ] Step 5: Read the result; reset the world to async when done
Step 1-2: What can I run
source scripts/env.sh
bash scripts/check_env.sh
python3 scripts/list_scenarios.py # every config, its type and town
python3 scripts/list_scenarios.py --town Town04_Opt # only what fits the loaded map
python3 scripts/list_scenarios.py --check # configs whose type or town does not resolve
python3 scripts/list_scenarios.py --here # only what fits the *running* server's map
python3 scripts/list_scenarios.py --types # class -> configs, incl. route-only classes
list_scenarios.py parses the XML directly, so it works with no server and no
carla import — unlike scenario_runner.py --list, which constructs a client
first.
Step 3: Run
source scripts/env.sh
# the canonical smoke test
bash scripts/run_scenario.sh FollowLeadingVehicle_1
# every config of one class, in sequence
bash scripts/run_scenario.sh group:FollowLeadingVehicle
# deterministic: 20 Hz synchronous, results printed and written as JSON
SYNC=1 FRAME_RATE=20 OUTPUT=1 JSON=1 OUTPUT_DIR=./results \
bash scripts/run_scenario.sh ControlLoss_1
# repeat with randomised parameters, and record for later analysis
REPETITIONS=3 RANDOMIZE=1 RECORD=recordings bash scripts/run_scenario.sh DynamicObjectCrossing_1
Or call ScenarioRunner directly — the wrapper only adds the env, the map check and the async reset:
python3 "$SCENARIO_RUNNER_ROOT/scenario_runner.py" --scenario FollowLeadingVehicle_1 --reloadWorld
Knobs (all env vars on run_scenario.sh):
| Var | Effect |
|---|---|
RELOAD=0 |
do not reload the world (default reloads; needed when the map differs) |
SYNC=1 |
synchronous mode at FRAME_RATE Hz — required for reproducibility |
FRAME_RATE |
sync tick rate, default 20 |
OUTPUT=1 / FILE=1 / JSON=1 / JUNIT=1 |
result to stdout / .txt / .json / .xml |
OUTPUT_DIR |
where those files land |
REPETITIONS / RANDOMIZE=1 |
repeat count / randomise scenario parameters |
AGENT / AGENT_CONFIG |
drive the ego with an agent (route mode only — see below) |
RECORD=dir |
CARLA recorder log + a criteria JSON, relative to $SCENARIO_RUNNER_ROOT |
WAIT_FOR_EGO=1 |
attach to an ego someone else spawned instead of spawning one |
DEBUG=1 |
print the behaviour tree every tick |
TIMEOUT |
client timeout, default 120 s — an editor map switch needs it |
MAX_WALL |
wall-clock guard, default 1800 s; 0 disables. ScenarioRunner can print its verdict and never exit |
Step 4: Somebody has to drive
Most scenarios spawn the ego and then wait for it to move. Nothing drives it by itself. If you see
Preparing scenario: FollowLeadingVehicle_1
ScenarioManager: Running scenario FollowVehicle
No more scenarios .... Exiting
with nothing happening, that is the symptom. Options:
# keyboard control, in a second terminal
python3 "$SCENARIO_RUNNER_ROOT/manual_control.py"
# or hand the ego to the autopilot instead of driving it
python3 "$SCENARIO_RUNNER_ROOT/manual_control.py" -a
manual_control.py attaches to the vehicle whose role_name equals --rolename,
default hero, which is the ego role ScenarioRunner uses, so no flag is needed to
find the ego. -a/--autopilot only switches on the autopilot. It needs
pygame, which `requirement
자주 묻는 질문
시나리오가 시작되지 않는 이유는 무엇인가요?
보통 시뮬레이터가 시나리오에 필요한 지도와 다른 지도에 있거나, 이 버전의 소프트웨어에 그 시나리오가 없기 때문입니다.
실행을 녹화할 수 있나요?
네. 실행을 저장해 나중에 재생할 수 있습니다.
메인 차량에 운전자가 필요한가요?
일부 시나리오는 필요하므로, 수동 제어 또는 자동 에이전트 중에서 고를 수 있습니다.
상세 정보
작성자의 원본 설명
Runs a single ScenarioRunner Python scenario (or a whole group) against a running CARLA server — FollowLeadingVehicle, ControlLoss, DynamicObjectCrossing, SignalizedJunctionLeftTurn and the rest of srunner/examples — in sync or async mode, with result output, recording and manual/agent control of the ego. Lists what is runnable on the checked-out branch and on the loaded map. Use when the user asks to "run a scenario", "test FollowLeadingVehicle", "list scenarios", "run a CARLA traffic scenario", or reports a scenario that is "not supported".
repo: carla-simulator/carla
인기도
- GitHub 스타
- 15k
- 순위
- #11112
- 라이선스
- 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 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.