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

run-openscenario

Validate and run OpenSCENARIO traffic scenarios through ScenarioRunner. Check file structure, maps, vehicle definitions, and supported features before simulation. Run both .xosc and .osc files, with global parameter overrides available for OpenSCENARIO 1.x.

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

원문원문 설명 보기

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.

설치 방법 보기

이럴 때 유용합니다

  • Validate and run an .xosc file from another tool
  • Compare runs with different speed parameters
  • Explore bundled OpenSCENARIO 2.0 examples
  • Investigate scenario actions that never occur

포함된 파일(5)

  • SKILL.md7.0 KB
  • references/openscenario.md5.1 KB
  • scripts/check_env.sh6.4 KB
  • scripts/env.sh5.3 KB
  • scripts/run_openscenario.sh8.5 KB

SKILL.md(원문)

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

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.xOpenSCENARIO 2.0
Extension.xosc.osc
FormatXML (<Storyboard>, <Act>, <Maneuver>)a domain-specific language
Flag--openscenario--openscenario2
Implementationsrunner/tools/openscenario_parser.pysrunner/osc2/ (ANTLR grammar)
Maturitybroad, partialexperimental

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

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 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 against your CWD, not $SCENARIO_RUNNER_ROOT. Solution: use an absolute path.

Problem: xmlschema.validators.exceptions.XMLSchemaValidationError Cause: the file targets a newer OpenSCENARIO revision than the bundled schema (srunner/openscenario/0.9.x/*.xsd + xmlschema==1.0.18). Solution: validate reports the offending element. Remove or downgrade it; there is no schema switch.

Problem: the scenario loads but an action never happens Cause: an unimplemented OSC feature. openscenario_parser.py silently skips some actions/conditions rather than failing. Solution: check the support matrix in references/openscenario.md.

Problem: --openscenarioparams ignored, with WARN: Ignoring --openscenarioparams Cause: it was passed without --openscenario (e.g. with --openscenario2, which has no parameter override). Solution: put the values in the file for OSC 2.0.

Problem: ModuleNotFoundError: No module named 'antlr4' Cause: OSC 2.0 needs the ANTLR runtime. Solution: pip install antlr4-python3-runtime==4.10. The version matters — the generated parser in srunner/osc2/osc2_parser/ is pinned to 4.10.

Problem: catalog references fail to resolve Cause: <CatalogLocation> paths are relative to the .xosc file. Solution: keep the file next to its catalogs/ directory, as the bundled examples do.

Outputs

The scenario executed on the server, with the same criteria report as any other ScenarioRunner run (OUTPUT=1, JSON=1, OUTPUT_DIR all work the same way). validate prints a schema verdict, the map required, the entities and the overridable parameters, and exits non-zero if the file cannot run.

Feature support and the OSC 2.0 pipeline are covered in references/openscenario.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월 18일 업데이트

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월 18일 업데이트

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월 18일 업데이트

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월 18일 업데이트

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월 18일 업데이트

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월 18일 업데이트

carla-simulator의 스킬 모두 보기

이 스킬의 문제 신고