run-scenario
Qué hace
Esta skill inicia una de las pruebas de escenario de conducción preparadas en el simulador CARLA, y puede listar lo que tu versión de CARLA puede ejecutar. Está pensada para personas que prueban cómo su software de conducción autónoma maneja situaciones definidas.
Cuándo usarla
- ✓Cuando quieres ejecutar una prueba estándar, como un coche que sigue a un vehículo que va delante.
- ✓Cuando necesitas ver qué escenarios admite tu versión instalada antes de elegir uno.
- ✓Cuando quieres que la prueba tome el control del coche principal o que lo conduzca tu propio programa.
Link de la skill
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/scenario-runner/run-scenario/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Ejecuta la prueba FollowLeadingVehicle en CARLA y muéstrame si mi coche la superó.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente elige el escenario por su nombre de configuración, comprueba que el mapa coincide y después inicia la ejecución. Si hace falta, recarga el mapa y muestra el resultado cuando termina la prueba.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de 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
Preguntas frecuentes
¿Por qué a veces un escenario no arranca?
Normalmente el simulador está en un mapa distinto al que necesita el escenario, o el escenario no está en esta versión del software.
¿Puedo grabar la ejecución?
Sí. La ejecución se puede guardar para reproducirla más tarde.
¿El coche principal necesita un conductor?
Algunos escenarios lo necesitan, así que puedes elegir control manual o un agente automático.
Detalles
Descripción original del autor
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
Popularidad
- Estrellas en GitHub
- 15 mil
- Posición en el ranking
- #11112
- Licencia
- MIT
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
create-leaderboard-route
15 milAyuda a tu agente a crear rutas para el Leaderboard de CARLA, colocando puntos de paso y disparadores de escenario desde la cámara del simulador.
package-leaderboard-agent
15 milAyuda a tu agente a empaquetar un agente de conducción en una imagen de Docker para el Leaderboard de CARLA, y comprueba que la imagen lo carga.
read-leaderboard-results
15 milAyuda a tu agente a leer los resultados del Leaderboard de CARLA, explicar la puntuación e infracciones de cada ruta y recalcular la ejecución con otra versión de las reglas.
run-leaderboard-evaluation
15 milAyuda a tu agente a ejecutar el evaluador del Leaderboard de CARLA en un conjunto de rutas, revisando antes la configuración y guardando puntos de control.
Skills parecidas
test-driven-development
311 milEnseña a tu agente a escribir primero una prueba que falle, verla fallar y después escribir el código más pequeño que la hace pasar, antes de construir cualquier función o corrección.
verification-before-completion
311 milEnseña a tu agente a ejecutar comprobaciones reales y leer su resultado antes de afirmar que una tarea, una corrección o una compilación está completa o en buen estado.
migrate-to-shoehorn
310 milSustituye los casts de tipo arriesgados de tus archivos de prueba por la librería shoehorn, para que las pruebas usen datos parciales y sigan pasando las comprobaciones de tipos.