본문으로 건너뛰기
Skillpedia
테스트15k · #11112

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/scenario-runner/run-scenario/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“CARLA에서 FollowLeadingVehicle 테스트를 실행하고, 내 차가 통과했는지 보여 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 설정 이름으로 시나리오를 고르고, 지도가 시나리오와 맞는지 확인한 뒤 실행을 시작합니다. 필요하면 지도를 다시 불러오고, 테스트가 끝나면 결과를 보고합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Run a scenario

Paths. scripts/… and references/… 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬