
roadrunner-import-scene
Import HD Map or OpenDRIVE files into a RoadRunner scene using MATLAB. Use when loading driving scenes in RoadRunner or RoadRunner Scene Builder, importing RRHD, OpenDRIVE, or other RoadRunner-supported formats for simulation, or verifying Lanelet2-to-RRHD conversion results visually. Requires rrApp handle from roadrunner-core.
- Installs
- 78
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill roadrunner-import-scene- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads roadrunner-import-scene automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
RoadRunner Scene Import
Import map files into a RoadRunner scene for visualization, verification, and building.
When to Use
- Importing a
.rrhdfile into RoadRunner for visual verification - Importing an OpenDRIVE
.xodrfile into RoadRunner - Verifying converted maps after Lanelet2-to-RRHD or other conversions
- Configuring build options (asphalt surfaces, bridge detection, junction preservation)
When NOT to Use
- Launching RoadRunner or managing projects — use
roadrunner-core - Building RRHD map content — use
roadrunner-rrhd-authoring - Converting Lanelet2 to RRHD — use
roadrunner-convert-lanelet2-to-rrhd - Looking up asset paths — use
roadrunner-asset-mapping
Key Rules
- Always write to .m files when executing code. Never put multi-line MATLAB code directly in
evaluate_matlab_code. Write to a.mfile, run withrun_matlab_file, edit on error. Exception: if the user asks to "show the pattern" or says "do not execute", show code inline without writing files. - Requires
rrAppfromroadrunner-core. Do not launch or connect to RoadRunner in this skill. IfrrAppdoes not exist, invokeroadrunner-corefirst. - Always copy file to project folder. Use
status(rrApp).Project.Filenameandcopyfile()explicitly in every import workflow — never omit or hide behind a variable. - Always set
bridgeOpts.IsEnabled = trueexplicitly. Never rely on constructor defaults for bridge auto-detection. - Run enforcement gates before
importScene. File location, extension, and build-option checks are mandatory. - Load before Build by default. Use
ImportStep="Load"unless user explicitly requests a full build. - NEVER hardcode
DetectAsphaltSurfaces = truefor converted maps. Always inspect the RRHD for closed-loop topology first. Closed-loop networks (most Lanelet2 conversions) MUST useDetectAsphaltSurfaces = false— asphalt detection fills the interior of loops. - ALWAYS preserve junctions when they exist. If
tempMap.Junctionsis non-empty, you MUST setoverlapOpts.IsEnabled = true,overlapOpts.PreserveJunctionLanes = true, andoverlapOpts.PreserveJunctionShape = true. Never rely on RoadRunner's auto-detection to re-infer junctions — it discards authored geometry.
Prerequisites
- A valid
rrApphandle must exist (produced byroadrunner-coreskill) - A RoadRunner project must be open
- If
rrAppdoes not exist, invokeroadrunner-corefirst to launch and connect
Connection, launching, and project lifecycle are owned by roadrunner-core. This skill assumes rrApp is already available.
Import Workflow
Step 1: Create a Fresh Scene
Always create a new scene before importing to avoid stale data:
newScene(rrApp);
Step 2: Copy File to Project (MANDATORY — always show explicitly)
RoadRunner requires imported files to be inside the project folder. You MUST always include this exact pattern in your generated code — never assume the file is already there or hide it behind a variable:
st = status(rrApp);
projectFolder = st.Project.Filename;
[~, fileName, ext] = fileparts(sourceFile);
destFile = fullfile(projectFolder, fileName + ext);
copyfile(sourceFile, destFile);
NEVER omit the copyfile() call or the status(rrApp).Project.Filename lookup. Even if you define a destFile variable elsewhere, you MUST show both the project path retrieval and the copy operation explicitly in every import workflow.
Step 3: Import the Map
RoadRunner HD Map (.rrhd)
Load only (inspect RRHD view before build):
importOpts = roadrunnerHDMapImportOptions;
importOpts.ImportStep = "Load";
importScene(rrApp, destFile, "RoadRunner HD Map", importOpts);
Full import with build (use conditional logic — NEVER hardcode asphalt/junction settings):
Do NOT copy a fixed template. Always use the "Conditional Build Options" section below to determine the correct settings based on RRHD content. The enforcement gate will reject hardcoded DetectAsphaltSurfaces = true for RRHD files.
IMPORTANT: When enabling bridge auto-detection, you MUST always write bridgeOpts.IsEnabled = true explicitly. Do NOT rely on the constructor default — the line must appear in the generated code.
Conditional Build Options (MANDATORY — apply based on map content)
Inspect the RRHD content before choosing build options. The following rules determine when to enable/disable specific settings:
| Condition | Action | Reason |
|---|---|---|
No Junctions in RRHD (empty or zero) | Set overlapOpts.IsEnabled = false | Without explicit junction definitions, overlap detection uses only geometry and produces incorrect groupings |
| Closed-loop road network (lanes form rings) | Set buildOpts.DetectAsphaltSurfaces = false | Asphalt detection fills interior of closed loops, creating unwanted surface polygons |
Explicit Junctions present in RRHD | Set overlapOpts.PreserveJunctionLanes = true and overlapOpts.PreserveJunctionShape = true | Preserves authored junction geometry and lane connectivity instead of re-inferring from geometry |
Example: Import with junction-aware options:
importOpts = roadrunnerHDMapImportOptions;
buildOpts = roadrunnerHDMapBuildOptions;
buildOpts.ClearSceneOfExistingData = true;
% Read RRHD to inspect content before build
tempMap = roadrunnerHDMap;
read(tempMap, destFile);
% Conditional: asphalt surfaces
hasClosedLoops = false; % Detect from lane topology (any lane chain forming a cycle)
if hasClosedLoops
buildOpts.DetectAsphaltSurfaces = false;
else
buildOpts.DetectAsphaltSurfaces = true;
end
% Conditional: overlap groups / junctions
overlapOpts = enableOverlapGroupsOptions;
if isempty(tempMap.Junctions) || numel(tempMap.Junctions) == 0
overlapOpts.IsEnabled = false;
else
overlapOpts.IsEnabled = true;
overlapOpts.PreserveJunctionLanes = true;
overlapOpts.PreserveJunctionShape = true;
end
buildOpts.EnableOverlapGroupsOptions = overlapOpts;
bridgeOpts = autoDetectBridgesOptions;
bridgeOpts.IsEnabled = true;
buildOpts.AutoDetectBridgesOptions = bridgeOpts;
importOpts.BuildOptions = buildOpts;
importScene(rrApp, destFile, "RoadRunner HD Map", importOpts);
OpenDRIVE (.xodr)
importOpts = openDriveImportOptions;
importOpts.ImportSignals = true;
importOpts.ImportObjects = true;
importScene(rrApp, destFile, "OpenDRIVE", importOpts);
Step 4: Save the Scene
[~, sceneName] = fileparts(sourceFile);
saveScene(rrApp, sceneName);
Import Options Reference
roadrunnerHDMapImportOptions
| Property | Description |
|---|---|
ImportStep | "Load" (RRHD view only) or "Unspecified" (full load+build) |
LoadOptions | roadrunnerHDMapLoadOptions — offset, projection |
BuildOptions | roadrunnerHDMapBuildOptions — build configuration |
roadrunnerHDMapBuildOptions
| Property | Description | Default |
|---|---|---|
ClearSceneOfExistingData | Remove existing scene content | auto |
DetectAsphaltSurfaces | Generate road surfaces | auto |
FitCrossSections | Fit lane cross sections | auto |
CurvatureBlend | Curvature blending factor | auto |
UseLaneGroups | Group lanes for editing (R2024a+) | auto |
CombineTransitionLanes | Merge transition lanes (R2025a+) | auto |
AutoDetectBridgesOptions | autoDetectBridgesOptions object | auto |
EnableOverlapGroupsOptions | enableOverlapGroupsOptions object (junctions) | auto |
FixUnrealisticRoadElevation | Correct elevation jumps from HD sources | auto |
FixInconsistentLaneConnections | Remove physically unrealistic lane links | auto |
enableOverlapGroupsOptions
| Property | Description | Default |
|---|---|---|
IsEnabled | Use junction location info (false = geometric overlaps) | auto |
PreserveJunctionLanes | Keep original junction lanes from imported map | auto |
PreserveJunctionShape | Keep junction polygon geometry from imported map | auto |
GroupName | Name of the overlap group | auto |
openDriveImportOptions
| Property | Description |
|---|---|
ImportSignals | Import traffic signals |
ImportObjects | Import static objects |
LaneOptions | Lane conversion settings |
Offset | Scene position offset |
Projection | Geospatial projection |
ImportRegion | Region filter (R2024a+) |
Supported Formats
| Format Name | File Type | Since |
|---|---|---|
"RoadRunner HD Map" | .rrhd | R2022b |
"OpenDRIVE" | .xodr | R2022a |
"HERE HD Map" | (catalog) | R2024a |
"TomTom HD Map" | (catalog) | R2024b |
Default Behavior
When the user asks to "import a map" or "load into RoadRunner":
- Ensure
rrAppexists (invokeroadrunner-coreif not) - Create a new scene (clean slate)
- Copy file to project Assets folder
- Import with Load only (
ImportStep="Load") so user can verify RRHD view - Save the scene with the filename as scene name
Only perform a full build (with BuildOptions) when the user explicitly asks to build or the RRHD view has been verified.
When building, always inspect the RRHD content first and apply the conditional build options from the "Conditional Build Options" section above. Never use fixed/hardcoded build options without checking map content.
Key Functions
| Function | Purpose |
|---|---|
newScene(rrApp) | Create fresh scene (clean slate) |
status(rrApp) | Get project info (.Project.Filename) |
importScene(rrApp, file, format, opts) | Import map file into scene |
saveScene(rrApp, name) | Save current scene |
roadrunnerHDMapImportOptions | Create import options (set ImportStep, BuildOptions) |
roadrunnerHDMapBuildOptions | Create build options (asphalt, bridges, junctions) |
autoDetectBridgesOptions | Bridge detection settings (IsEnabled) |
enableOverlapGroupsOptions | Junction preservation (PreserveJunctionLanes, PreserveJunctionShape) |
openDriveImportOptions | OpenDRIVE-specific import options |
Enforcement Gate (MANDATORY — run before import)
You MUST execute these checks before calling importScene. Do NOT skip.
%% --- ENFORCEMENT: RoadRunner is connected ---
try
st = status(rrApp);
assert(~isempty(st.Project.Filename), 'No project open');
fprintf('RoadRunner connected, project: %s\n', st.Project.Filename);
catch
error('RoadRunner:NotConnected', ...
'No RoadRunner instance connected. Run the Connection Strategy block first.');
end
%% --- ENFORCEMENT: File is inside project folder ---
projectFolder = st.Project.Filename;
assert(startsWith(destFile, projectFolder) || isfile(destFile), ...
'Import file must be inside the project folder. Copy it first.');
fprintf('File location check: PASS\n');
%% --- ENFORCEMENT: File extension matches format ---
[~, ~, ext] = fileparts(destFile);
if formatName == "RoadRunner HD Map"
assert(ext == ".rrhd", 'Expected .rrhd file for RoadRunner HD Map format');
elseif formatName == "OpenDRIVE"
assert(ext == ".xodr", 'Expected .xodr file for OpenDRIVE format');
end
fprintf('Format check: PASS\n');
%% --- ENFORCEMENT: Build options match RRHD content (MANDATORY for .rrhd) ---
if ext == ".rrhd"
tempMap = roadrunnerHDMap;
read(tempMap, destFile);
% Junction preservation check
if ~isempty(tempMap.Junctions) && numel(tempMap.Junctions) > 0
assert(exist('overlapOpts','var') == 1 && overlapOpts.IsEnabled == true ...
&& overlapOpts.PreserveJunctionLanes == true ...
&& overlapOpts.PreserveJunctionShape == true, ...
'RRHD has %d junctions — you MUST enable PreserveJunctionLanes and PreserveJunctionShape.', ...
numel(tempMap.Junctions));
fprintf('Junction preservation check: PASS (%d junctions preserved)\n', numel(tempMap.Junctions));
end
% Closed-loop / asphalt check — detect topology cycles (multi-lane or self-loop)
hasClosedLoop = false;
lanes = tempMap.Lanes;
nLanes = numel(lanes);
laneIDs = cell(1, nLanes);
for li2 = 1:nLanes, laneIDs{li2} = char(lanes(li2).ID); end
laneIDSet = containers.Map(laneIDs, num2cell(1:nLanes));
% BFS from each lane: if we revisit a lane, there's a cycle
visited = false(1, numel(lanes));
for startIdx = 1:numel(lanes)
if visited(startIdx), continue; end
queue = startIdx; seen = false(1, numel(lanes)); seen(startIdx) = true;
while ~isempty(queue)
ci = queue(1); queue(1) = [];
visited(ci) = true;
succs = lanes(ci).Successors;
for si = 1:numel(succs)
sid = char(succs(si).Reference.ID);
if laneIDSet.isKey(sid)
ni = laneIDSet(sid);
if ni == startIdx
hasClosedLoop = true; break;
end
if ~seen(ni), seen(ni) = true; queue(end+1) = ni; end
end
end
if hasClosedLoop, break; end
end
if hasClosedLoop, break; end
end
if hasClosedLoop
assert(buildOpts.DetectAsphaltSurfaces == false, ...
'DetectAsphaltSurfaces must be false for closed-loop maps (fills interior). Set it explicitly.');
fprintf('Asphalt detection check: PASS (disabled for closed-loop)\n');
else
fprintf('Asphalt detection check: PASS (no closed-loop detected)\n');
end
end
Conventions
- Always specify format name string exactly:
"RoadRunner HD Map","OpenDRIVE" - Use
SOSform for IIR stability (BuildOptions handles this internally) - Show all file-staging code explicitly (
status,fileparts,fullfile,copyfile) - Use
tiledlayout/nexttilefor multi-panel figures (notsubplot) - Pin
destFileto the project folder path — never use temp or relative paths for import
Copyright 2026 The MathWorks, Inc.
FAQ
What does the roadrunner-import-scene skill do?
Import HD Map or OpenDRIVE files into a RoadRunner scene using MATLAB. Use when loading driving scenes in RoadRunner or RoadRunner Scene Builder, importing RRHD, OpenDRIVE, or other RoadRunner-supported formats for simulation, or verifying Lanelet2-to-RRHD conversion results visually. Requires rrApp handle from roadrunner-core.
How do I install roadrunner-import-scene?
Run npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill roadrunner-import-scene in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/roadrunner-import-scene/ (personal) or .claude/skills/roadrunner-import-scene/ (project).
Which AI agents can use roadrunner-import-scene?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is roadrunner-import-scene safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains roadrunner-import-scene?
It is published by matlab in matlab/matlab-agentic-toolkit. It has 78 recorded installs.
More from matlab/matlab-agentic-toolkit
matlab-review-code
matlab/matlab-agentic-toolkit
Review MATLAB code for quality, performance, maintainability, and adherence to MathWorks coding standards. Uses checkmatlabcode and matlabcodingguidelines. Use when reviewing code, checking style, finding code smells, assessing quality, or preparing code for handoff or publication.
matlab-analyze-data
matlab/matlab-agentic-toolkit
Analyze data using MATLAB. Use when the task involves tables, timetables, time-series data, numeric arrays, sensor matrices, or gridded data — including but not limited to exploring, row filtering, sorting, cleaning, transforming, aggregating, smoothing, padding, trimming, and answering questions about data. MATLAB provides extensive, easy-to-use built-in functions for these workflows with no additional products required.
matlab-design-digital-filter
matlab/matlab-agentic-toolkit
Design and validate digital filters in MATLAB. Use when cleaning up noisy signals, removing interference, filtering signals, designing FIR/IIR filters (lowpass/highpass/bandpass/bandstop/notch), or comparing filters in Filter Analyzer.
matlab-modernize-code
matlab/matlab-agentic-toolkit
Modernize removed or discouraged MATLAB functions and patterns. Use when the checkmatlabcode MCP tool reports that a function "is not recommended", "will be removed in a future release", or "has been removed" — at any severity (info, warning, or error) — when migrating legacy code, or when replacing removed or discouraged APIs with current equivalents. Also applies to discouraged patterns Code Analyzer does not flag (containers.Map, bsxfun, str2num, eval, clear all) and to removed or discouraged functions such as trainNetwork, csvread, xlsread, datenum, guide, svmtrain, ltln2val, webmap.
matlab-create-live-script
matlab/matlab-agentic-toolkit
Create, edit, and run plain-text MATLAB live scripts (.m files) with rich text formatting, LaTeX equations, section breaks, and inline figures. Use when generating tutorials, analysis notebooks, reports, documentation, or educational content, when modifying existing live scripts, or when converting existing binary .mlx files to .m for version control. Requires R2025a+.
matlab-agentic-toolkit-setup
matlab/matlab-agentic-toolkit
Install and configure the MATLAB Agentic Toolkit — detect MATLAB, install the MCP server, register with your AI coding agent, and verify the environment. Supports Claude Code, Codex, GitHub Copilot, Amp, and Gemini CLI.
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available