Aller au contenu
Skillpedia
Tests15k · #11110

run-openscenario

Ce qu’il fait

Cette compétence exécute des fichiers de scénario écrits selon le standard OpenSCENARIO, utilisé par de nombreux outils de conduite, dans le simulateur CARLA. Elle s'adresse aux ingénieurs qui testent des logiciels de conduite autonome avec des fichiers de scénario partagés.

Quand l’utiliser

  • ✓Quand vous avez un fichier OpenSCENARIO issu d'un autre outil et voulez le lancer dans CARLA.
  • ✓Quand vous voulez vérifier un fichier de scénario pour détecter les erreurs avant de l'exécuter.
  • ✓Quand vous devez savoir quelles parties du standard CARLA prend en charge.

Lien du skill

https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/scenario-runner/run-openscenario/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/scenario-runner/run-openscenario/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Peux-tu exécuter ce fichier OpenSCENARIO dans CARLA, le vérifier d'abord et me dire si certaines fonctions ne sont pas prises en charge ?”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent vérifie le fichier selon les règles du standard, puis lance l'exécution avec l'option correspondante. Beaucoup de ces fichiers contiennent leur propre carte et leurs propres voitures, donc aucun nom de carte séparé n'est nécessaire.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

Run an OpenSCENARIO file

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.

ScenarioRunner speaks two unrelated standards that happen to share a name:

OpenSCENARIO 1.x OpenSCENARIO 2.0
Extension .xosc .osc
Format XML (<Storyboard>, <Act>, <Maneuver>) a domain-specific language
Flag --openscenario --openscenario2
Implementation srunner/tools/openscenario_parser.py srunner/osc2/ (ANTLR grammar)
Maturity broad, partial experimental

They are not versions of each other and no file works with both flags.

Unlike Python scenarios, an OSC file carries its own map, entities and ego — so there is no --scenario name, no town lookup, and --reloadWorld is implied by whatever <RoadNetwork> says.

Instructions

Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh)
- [ ] Step 2: Find or validate the file (list / validate)
- [ ] Step 3: Run it with the right flag
- [ ] Step 4: Drive or observe the ego if the file expects an external controller

Step 2: Find and validate

source scripts/env.sh

bash scripts/run_openscenario.sh list                  # bundled .xosc and .osc, per branch
bash scripts/run_openscenario.sh validate path/to.xosc # schema + map + entity check, no server

validate is worth running first: it resolves the <RoadNetwork><LogicFile> map against the server's map list, checks catalog references, and reports the ParameterDeclarations you can override — all of which otherwise fail several seconds into a run, after the world has already been reloaded.

Step 3: Run

source scripts/env.sh

# OpenSCENARIO 1.x
bash scripts/run_openscenario.sh run "$SCENARIO_RUNNER_ROOT/srunner/examples/FollowLeadingVehicle.xosc"

# with global parameter overrides — note the 'key: value' comma-separated form
PARAMS='leadingSpeed: 8.0, egoSpeed: 12.0' \
    bash scripts/run_openscenario.sh run .../FollowLeadingVehicle.xosc

# OpenSCENARIO 2.0
bash scripts/run_openscenario.sh run2 "$SCENARIO_RUNNER_ROOT/srunner/examples/cut_in_and_slow_right.osc"

Direct equivalents:

python3 "$SCENARIO_RUNNER_ROOT/scenario_runner.py" --openscenario  file.xosc --openscenarioparams 'k: v'
python3 "$SCENARIO_RUNNER_ROOT/scenario_runner.py" --openscenario2 file.osc

--openscenarioparams overrides only entries in the global ParameterDeclarations; per-story parameters are not reachable. The format is 'name: value, name2: value2' — it is split on , then on : and both sides are stripped, so a value containing either character breaks the parse.

The OSC timeout is hard-coded to 100000 seconds for both flags. A stuck OSC run does not time out on its own; interrupt it.

Step 4: Who drives the ego

An .xosc that assigns a controller (<ObjectController> with the CARLA NpcVehicleDriving / simple_vehicle_control controllers) drives itself. One that declares the ego with an external controller does not — same silent "nothing happens" as with Python scenarios:

python3 "$SCENARIO_RUNNER_ROOT/manual_control.py" -a --rolename=hero

--rolename picks the actor (default hero); -a hands it to the autopilot. Drop -a to drive it by keyboard.

OscControllerExample.xosc is the file to read for how controllers are wired.

Examples

Example 1: "run this xosc I got from another tool"

validate first. The two usual rejections are a map name the server does not have (<LogicFile filepath="Town04"> needs Town04 loaded/available) and OSC features ScenarioRunner does not implement — validate names both. Then run.

Example 2: "sweep a parameter"

for v in 4 8 12; do
  PARAMS="leadingSpeed: $v" bash scripts/run_openscenario.sh run .../FollowLeadingVehicle.xosc
done

Example 3: "try OpenSCENARIO 2.0"

list shows the .osc corpus (cut_in_and_slow_right.osc, overtake1.osc, follow_trajectory.osc, …). On ue5-master and ue58-dev they live in srunner/osc_examples/, not srunner/examples/. Expect gaps: the osc2 pipeline parses a subset of the language and raises from srunner/osc2/ on the rest.

Troubleshooting

Problem: File does not exist Cause: ScenarioRunner checks the path before anything else, and relative paths resolve agains

Questions fréquentes

Quelle est la différence entre les deux types de fichiers ?

Les fichiers se terminant par .xosc suivent le standard 1.x, tandis que ceux se terminant par .osc utilisent le langage 2.0, encore expérimental.

Le fichier a-t-il besoin d'un réglage de carte séparé ?

En général non. Ces fichiers incluent leur propre réseau routier, donc la carte provient du fichier.

Peut-elle lancer un fichier qui attend un contrôleur pour la voiture ?

Oui. La compétence peut conduire ou observer la voiture principale si le fichier attend un contrôleur externe.

Détails

Description originale de l’auteur

Runs standard-format scenarios through ScenarioRunner — ASAM OpenSCENARIO 1.x (.xosc, via --openscenario, with catalogs and ParameterDeclaration overrides) and OpenSCENARIO 2.0 (.osc, via --openscenario2, the ANTLR/osc2 pipeline). Validates a file against the schema before running, lists the bundled examples, and reports which OSC features ScenarioRunner actually implements. Use when the user asks to "run an xosc", "run an OpenSCENARIO file", "use the OpenSCENARIO standard", "run a .osc / OSC2 scenario", or hands over a scenario file from another tool.

repo: carla-simulator/carla

Popularité

Étoiles GitHub
15k
Position au classement
#11110
Licence
MIT
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires