본문으로 건너뛰기
cccskills
무료GitHub에 공개

run-route-scenario

Run CARLA routes with a driving agent through ScenarioRunner, including scenarios available only in route mode. Inspect route contents, execute one or all routes, and obtain reports on completion, collisions, traffic lights, and other criteria.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Runs a route through ScenarioRunner's RouteScenario mode (--route / --route-id) with an autonomous agent driving the ego — the same mechanism the CARLA Leaderboard uses, and the only way to reach the ~34 route-only scenario classes (Accident, ParkedObstacle, HazardAtSideLane, InvadingTurn, HardBreakRoute, YieldToEmergencyVehicle, junction and actor-flow scenarios). Inspects route files, lists route ids and their scenarios, and runs one or all of them. Use when the user asks to "run a route", "drive a route with my agent", "run leaderboard scenarios without the leaderboard", or names a route-only scenario type.

설치 방법 보기

이럴 때 유용합니다

  • Test a driving agent on a specific route
  • Find routes containing accident or obstacle scenarios
  • Run Leaderboard scenarios without its scoring
  • Export evaluation reports for all routes

포함된 파일(5)

  • SKILL.md8.5 KB
  • references/routes.md6.1 KB
  • scripts/check_env.sh6.4 KB
  • scripts/env.sh5.3 KB
  • scripts/run_route.sh7.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Run a route

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 route is a list of waypoints plus a set of scenarios pinned to trigger points along it. RouteScenario builds one behaviour tree containing every scenario on the route, plus background traffic, and evaluates route-level criteria (completion, deviation, red lights, collisions, blocked).

This is the mode that matters for autonomous-driving work, for three reasons:

  • An agent drives. --agent only works here; with --scenario it is refused.
  • Most of the scenario library is only reachable here. ~34 classes have no standalone config.
  • It is what the Leaderboard runs. Same RouteScenario, same criteria. The Leaderboard adds scoring, sensor limits and result bookkeeping on top.

Instructions

Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh)
- [ ] Step 2: Inspect the route file — ids, towns, scenarios
- [ ] Step 3: Pick or write the agent
- [ ] Step 4: Run one route id first, then the file
- [ ] Step 5: Read the criteria; reset the world to async

Step 2: Inspect

source scripts/env.sh

bash scripts/run_route.sh list "$LEADERBOARD_ROOT/data/routes_devtest.xml"
bash scripts/run_route.sh show "$LEADERBOARD_ROOT/data/routes_devtest.xml" 0

list prints each route id, its town, waypoint count and scenario histogram, and flags whether the towns it needs exist on the running server. show dumps one route's scenarios in trigger order.

Route files come from two places: the Leaderboard's data/*.xml, or your own (see [[create-leaderboard-route]] for the authoring tools). ScenarioRunner itself ships no route files on master — the old srunner/data/routes_*.xml referenced by the docs was removed.

Step 3: The agent

Route mode needs something to drive. srunner/autoagents/ has three:

AgentUse
npc_agent.pyTraffic-Manager autopilot following the route — the reference "it works" agent
human_agent.pypygame window, keyboard control
dummy_agent.pyreturns zero control; the template to copy

ScenarioRunner derives the class name from the file name: npc_agent.py → NpcAgent, my_cool_agent.py → MyCoolAgent (os.path.basename(agent).split('.')[0].title().replace('_','')). A mismatch is an AttributeError at load, not a helpful message. Writing one is [[write-leaderboard-agent]] — the same AutonomousAgent interface applies here.

Step 4: Run

source scripts/env.sh

# one route, the NPC agent — the canonical check that routes work at all
AGENT="$SCENARIO_RUNNER_ROOT/srunner/autoagents/npc_agent.py" \
    bash scripts/run_route.sh run "$LEADERBOARD_ROOT/data/routes_devtest.xml" 0

# every route in the file, results as JSON
AGENT=.../npc_agent.py OUTPUT=1 JSON=1 OUTPUT_DIR=./results \
    bash scripts/run_route.sh run routes.xml

# your own agent with a config file, recorded for later replay
AGENT=~/team_code/my_agent.py AGENT_CONFIG=~/team_code/config.json RECORD=recordings \
    bash scripts/run_route.sh run routes.xml 3

Direct equivalent:

python3 "$SCENARIO_RUNNER_ROOT/scenario_runner.py" \
    --route routes.xml --route-id 0 --agent .../npc_agent.py --agentConfig cfg.json

--route-id is one id, not a range. Unlike the Leaderboard's --routes-subset, there is no 0-4 or 1,6 syntax here: omit it to run every route in the file, or loop.

Route mode forces two things regardless of what you pass: --reloadWorld (the route names its town) and --sync when --agent is given (arguments.sync = True). So the world will be reloaded and will be in synchronous mode — plan the aftermath accordingly.

Step 5: Aftermath

Same trap as any sync run, worse here because it is unconditional: an interrupted route leaves the world synchronous, which every other client sees as a hang. run_route.sh resets it on exit including Ctrl-C. Otherwise: [[set-world-settings]] async.

Examples

Example 1: "check that routes work"

AGENT="$SCENARIO_RUNNER_ROOT/srunner/autoagents/npc_agent.py" \
    bash scripts/run_route.sh run "$LEADERBOARD_ROOT/data/routes_devtest.xml" 0

The NPC agent completes the route with the Traffic Manager; criteria print at the end. If this fails, the problem is the setup, not your agent.

Example 2: "test my agent on the Accident scenario"

Accident is route-only in the Leaderboard 2.x sense. list a route file, find a route whose histogram includes Accident, then run that id. Or write a minimal one-scenario route with [[create-leaderboard-route]].

Example 3: "I want the leaderboard scenarios but not the scoring"

Exactly this skill. Point --route at routes_training.xml, drive with your agent, and read the criteria. You lose the driving score and infraction penalty — use [[run-leaderboard-evaluation]] when you want those numbers.

Troubleshooting

Problem: Agents are currently only compatible with route scenarios Cause: --agent passed together with --scenario or --openscenario. Solution: use --route. There is no way to attach an agent to a standalone scenario.

Problem: AttributeError: module 'my_agent' has no attribute 'MyAgent' Cause: the class name must be the file name in TitleCase with underscores removed. Solution: rename the class or the file — my_agent.py → class MyAgent.

Problem: Configuration for scenario ... cannot be found / no routes parsed Cause: a 1.0-format route file (flat <waypoint> elements, scenarios in a separate JSON) fed to a 2.x parser, or vice versa. Solution: list reports which format it detected. LB 1.0 files need a leaderboard-1.0 checkout and a --scenarios JSON, which scenario_runner.py on master does not accept.

Problem: The CARLA server uses the wrong map even though reload is forced Cause: the town the route names is not installed — usually Town12/Town13 without AdditionalMaps. Solution: list flags missing towns; install AdditionalMaps ([[download-carla]]) or pick a route in a town you have.

Problem: the route starts and the ego immediately fails InRouteTest Cause: the first waypoint is off the drivable surface, or the ego spawned facing the wrong way. Solution: show the route and check the first positions; visualise with [[create-leaderboard-route]]'s route_displayer.

Problem: scenarios never trigger, the ego just drives the route Cause: usually a branch mismatch — the route names scenario types that this checkout does not implement. RouteScenario skips unknown types. Solution: list cross-checks every scenario type in the file against the classes in the checkout and names the ones that will be skipped.

Problem: very slow, or the watchdog fires on large maps Cause: Town12/Town13 tile streaming with default distances. Solution: raise TIMEOUT; the Leaderboard sets tile_stream_distance and actor_active_distance to 650 — do the same with [[set-world-settings]].

Outputs

The route driven by the agent, a criteria report (OUTPUT=1, JSON=1, OUTPUT_DIR), and optionally a recorder log plus criteria JSON under $SCENARIO_RUNNER_ROOT/$RECORD/. list/show print route structure without touching the simulator.

Route file formats, the criteria route mode adds, and how this differs from the Leaderboard are in references/routes.md.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Add a message type to CARLA's native ROS 2 interface. Create its C++ data structure, serialization code for transmission, type identity hash, registration, and tests, with Docker-based hash calculation and build checks.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Adding a standard ROS 2 message type missing from CARLA
  • Defining a custom carla_msgs message
  • Investigating type-hash warnings
carla-simulator/carla1.5만2026년 10월 23일 업데이트

Extend CARLA’s native ROS 2 interface to publish sensor data or receive vehicle commands. Covers topic implementation, registration, data connections, and verification, plus adding middleware, the communication layer used to exchange messages.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Publish obstacle sensor data to ROS 2
  • Add a topic for vehicle speed commands
  • Integrate another communication middleware
carla-simulator/carla1.5만2026년 10월 23일 업데이트

Summarize ScenarioRunner results to see which scenarios passed and which checks failed. Compare runs before and after changes, or analyze recorded driving to produce measurements and plots of vehicle distance and deviation from the lane center.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Checking scenario pass and fail results
  • Comparing results before and after controller changes
  • Plotting vehicle distances from a recorded run
carla-simulator/carla1.5만2026년 10월 23일 업데이트

Checks a local CARLA checkout for missing API documentation, outdated references, broken links, and pages absent from navigation. Produces a grouped Markdown report without building the project or running the simulator.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Reviewing documentation before a release
  • Finding missing or outdated API references
  • Checking broken links and navigation gaps
carla-simulator/carla1.5만2026년 10월 23일 업데이트

Read and display CARLA object bounding boxes, then project them onto a camera image as 2D rectangles. Export an annotated PNG and box coordinates in JSON for object detection annotation work.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Adding vehicle boxes to a camera image
  • Exporting box coordinates for detection annotations
  • Checking vehicle dimensions
carla-simulator/carla1.5만2026년 10월 23일 업데이트

Builds CARLA's ue4-dev branch on Linux, producing the Unreal Engine 4.26 editor, server modules, and an installed Python client package. Fetches required content, optionally compiles native ROS 2 support, and verifies the build against a source-built server.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Building CARLA ue4-dev from source
  • Compiling CARLA with native ROS 2 support
  • Building the Python client for an existing environment
carla-simulator/carla1.5만2026년 10월 23일 업데이트

carla-simulator의 스킬 모두 보기

이 스킬의 문제 신고