
Roadrunner Build Scenario From Osc
Build a RoadRunner Scenario programmatically from an OpenSCENARIO 1.x (.xosc) file...
Install
npx skills add matlab/matlab-agentic-toolkit --skill roadrunner-build-scenario-from-osc -g -a claude-code -y- Repository
- matlab/matlab-agentic-toolkit1.2k
- Category
- Engineering
- Updated
- 8d ago
- License
- See repository
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- No, instructions only
What it does
Build a RoadRunner Scenario programmatically from an OpenSCENARIO 1.x (.xosc) file using the `roadrunner-scenario-authoring` skill. Use when the user wants to recreate a scenario from a .xosc file, interpret an OpenSCENARIO file and build it programmatically, reconstruct a .xosc as a RoadRunner scenario, generate a MATLAB script from a .xosc file, or convert an OpenSCENARIO file to MATLAB code. Do NOT use when the user says "import" a .xosc file, that means they want RoadRunner's built-in importScenario API, not programmatic reconstruction. Handles position translation (LanePosition and RoadPosition to world coordinates), construct mapping, relative references, trajectory/route handling, parameter expressions, catalog references, and phase logic topology.
Build RoadRunner Scenario from OpenSCENARIO
Interpret an OpenSCENARIO 1.x (.xosc) file and recreate the scenario in
RoadRunner using the roadrunner-scenario-authoring skill. Translates positions,
maps constructs, preserves relative references, and builds correct phase logic.
When to Use
- User has a .xosc file and wants to recreate it in RoadRunner
- User wants to programmatically build a scenario from OpenSCENARIO
- User says "build this .xosc in RoadRunner" or "recreate this scenario"
- User has an OpenSCENARIO file from a partner or standards body (e.g., Euro NCAP, ALKS)
- User wants to generate a MATLAB script from a .xosc file
- User says "convert this xosc to matlab" or "recreate with a matlab script"
When NOT to Use
- User says "import" a .xosc file, they want
importScenario(rrApp, xoscPath), not this skill. Simply call the API directly. - User wants to use RoadRunner's built-in
importScenario(let them, it works for simple cases) - User wants to create a scenario from scratch without a .xosc file (use
roadrunner-scenario-authoring) - User wants to export a scenario TO OpenSCENARIO (use
roadrunner-export-scenario)
Critical Rules
-
Never fabricate actions or conditions not present in the source XOSC. If a construct cannot be mapped, skip it and warn the user.
-
Never propose workarounds. Do not replace DistanceToPointCondition with DurationCondition, do not substitute SimulationTimeCondition for unsupported triggers, do not add any construct not in the source.
-
Never simplify or duplicate trajectory vertices. Extract exactly the polyline vertices present in the source XOSC, no fewer, no more. Do not reduce 90 vertices to 5. Do not duplicate start/end points during extraction.
-
Never guess scenes. Only report the .xodr filename from
<LogicFile>. Import it, do not search for a scene with a similar name.
