run-route-scenario
What it does
This skill drives a planned route through CARLA with a self-driving program controlling the car, along with traffic and scenario events along the way. It is for teams benchmarking their autonomous driving software.
When to use it
- βWhen you want to test your self-driving program on a full route rather than a single situation.
- βWhen you need to run one route from a list to see how the car performs on it.
- βWhen you want results that match the official CARLA Leaderboard setup.
Skill link
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/scenario-runner/run-route-scenario/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βCan you run route 5 in CARLA with my self-driving program at the wheel and tell me how it did?β
5 new skills a week. 1 minute to read.
How it works
The agent reads the route file to find its towns and events, then runs the car along it with your driving program. It reports the route checks such as completion, deviation, red lights, collisions and whether the car got blocked.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Run a route
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 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.
--agentonly works here; with--scenarioit 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:
| Agent | Use |
|---|---|
npc_agent.py |
a BasicAgent at 30 km/h following the route (not the Traffic Manager); the reference "it works" agent |
human_agent.py |
pygame window, keyboard control |
dummy_agent.py |
returns 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 drives the route with a BasicAgent at 30 km/h; criteria print at the
end. If this fails,
FAQ
Do I need a driving program to use it?
Yes. A route run needs an agent that drives the car, which is what makes this mode different from single scenarios.
Can I try one route before running the whole file?
Yes. The skill can run a single route ID first, and then the whole file.
Which checks are reported?
Route completion, deviation from the path, running red lights, collisions and whether the car got blocked.
Details
Original description by the author
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-on
repo: carla-simulator/carla
Popularity
- GitHub stars
- 15k
- Ranking position
- #11111
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
create-leaderboard-route
15kHelps your agent build CARLA Leaderboard route files by placing waypoints and scenario triggers from the simulator camera, then checking and ordering them.
package-leaderboard-agent
15kHelps your agent package a driving agent into a Docker image for CARLA Leaderboard submission, checking the folder layout and testing that the image loads it.
read-leaderboard-results
15kHelps your agent read a CARLA Leaderboard results file, explain each route's score and infractions, and rescore a run under the other rule version.
run-leaderboard-evaluation
15kHelps your agent run the CARLA Leaderboard evaluator on a set of routes with your driving agent, checking the setup first and saving checkpoints you can resume.
Similar skills
test-driven-development
311kTeaches your agent to write a failing test first, watch it fail, then write the smallest code that passes, before building any feature or fix.
verification-before-completion
311kTeaches your agent to run real checks and read their output before claiming that a task, fix, or build is complete or passing.
migrate-to-shoehorn
310kReplaces risky type casts in your test files with the shoehorn library, so tests can use partial data and still pass type checks.