run-route-scenario
Was er macht
Dieser Skill fährt eine geplante Strecke in CARLA, wobei ein selbstfahrendes Programm das Auto steuert, mit Verkehr und Szenario-Ereignissen unterwegs. Er richtet sich an Teams, die ihre autonome Fahrsoftware messen wollen.
Wann du ihn nutzt
- ✓Wenn du dein selbstfahrendes Programm auf einer ganzen Strecke statt in einer einzelnen Situation testen willst.
- ✓Wenn du eine Strecke aus einer Liste ausführen willst, um die Leistung darauf zu sehen.
- ✓Wenn du Ergebnisse willst, die dem offiziellen CARLA-Leaderboard-Setup entsprechen.
Link zum Skill
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/scenario-runner/run-route-scenario/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Kannst du Strecke 5 in CARLA mit meinem selbstfahrenden Programm am Steuer ausführen und mir sagen, wie es gelaufen ist?”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Der Agent liest die Streckendatei, um Städte und Ereignisse zu finden, und fährt das Auto mit deinem Fahrprogramm die Strecke ab. Er meldet die Streckenprüfungen, etwa Abschluss, Abweichung, rote Ampeln, Kollisionen und ob das Auto blockiert wurde.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von 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,
Häufige Fragen
Brauche ich ein Fahrprogramm, um ihn zu nutzen?
Ja. Ein Streckenlauf braucht einen Agenten, der das Auto fährt. Genau das unterscheidet diesen Modus von einzelnen Szenarien.
Kann ich eine Strecke testen, bevor ich die ganze Datei laufen lasse?
Ja. Der Skill kann zuerst eine einzelne Routen-ID ausführen und dann die ganze Datei.
Welche Prüfungen werden gemeldet?
Streckenabschluss, Abweichung vom Weg, Überfahren roter Ampeln, Kollisionen und ob das Auto blockiert wurde.
Details
Originalbeschreibung des Autors
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
Beliebtheit
- GitHub-Sterne
- 15k
- Platz im Ranking
- #11111
- Lizenz
- MIT
- Aktualisiert
- 2.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
create-leaderboard-route
15kHilft deinem Agenten, Routendateien für das CARLA Leaderboard zu erstellen, indem er Wegpunkte und Szenarien aus der Simulatorkamera setzt und prüft.
package-leaderboard-agent
15kHilft deinem Agenten, einen Fahragenten für die CARLA-Leaderboard-Einreichung in ein Docker-Image zu packen und zu prüfen, ob es ihn lädt.
read-leaderboard-results
15kHilft deinem Agenten, eine Ergebnisdatei des CARLA Leaderboards zu lesen, Punkte und Verstöße je Route zu erklären und Läufe neu zu bewerten.
run-leaderboard-evaluation
15kHilft deinem Agenten, die CARLA-Leaderboard-Bewertung auf vielen Routen auszuführen, mit vorheriger Prüfung und Checkpoints zum Fortsetzen.
Ähnliche Skills
test-driven-development
311kBringt deinem Agenten bei, vor jedem Feature oder Fix zuerst einen fehlschlagenden Test zu schreiben, ihn fehlschlagen zu sehen und dann den kleinsten passenden Code zu schreiben.
verification-before-completion
311kBringt deinem Agenten bei, echte Prüfungen auszuführen und ihre Ausgabe zu lesen, bevor er behauptet, eine Aufgabe, ein Fix oder ein Build sei fertig oder bestehe.
migrate-to-shoehorn
310kErsetzt riskante Typumwandlungen in deinen Testdateien durch die Bibliothek shoehorn, damit Tests mit unvollständigen Daten arbeiten und trotzdem die Typprüfung bestehen.