Roadrunner Core
MathWorksOfficialCreated by MathWorks
- Skill
- Tool integration
- Software development
- BSD-2-Clause
- Low risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The roadrunner-core skill serves as the essential bridge between MATLAB and the RoadRunner application. It automates the lifecycle management of RoadRunner instances, including connection handling, project initialization, and scene or scenario operations. By providing a standardized set of patterns for interacting with the RoadRunner API, it ensures consistent and safe execution of commands while maintaining proper handle management and path configuration.
What it does
- Initializes and validates the connection between MATLAB and RoadRunner.
- Manages the lifecycle of projects, scenes, and scenarios.
- Configures world settings such as origin, center, and extents.
- Provides status monitoring for active projects and unsaved changes.
- Handles safe termination of the RoadRunner process.
- Automates path setup and configuration for the RoadRunner API.
When to use it
- When you need to connect to or launch RoadRunner from a MATLAB environment.
- When performing operations on projects, scenes, or scenarios.
- When setting or modifying world origin and scene bounds.
- When you need to check the current status of the RoadRunner application.
- When closing the RoadRunner application safely from within a script.
Advantages
- Ensures idempotent and reliable initialization of the RoadRunner connection.
- Provides a structured, pattern-based approach to API calls to prevent errors.
- Automates complex path and configuration management.
- Supports both interactive GUI and headless operation modes.
- Maintains clear handle management to prevent stale references.
Usage examples
- “Initialize my RoadRunner connection.”
- The agent runs the rrCoreInitialize script to establish a connection, validates the path, and returns the rrApp handle for further use.
- “Open the project located at D:/Projects/HighwayProject.”
- The agent uses the OPEN_PROJECT pattern to load the specified project into the active RoadRunner instance.
- “What is the current status of my RoadRunner scene?”
- The agent executes the STATUS command to retrieve and display information about the current scene, including its filename and whether there are unsaved changes.
- “Set the world origin to 42.3021, -71.3747.”
- The agent applies the CHANGE_WORLD_ORIGIN pattern to update the geospatial coordinates in the active RoadRunner scene.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/matlab/roadrunner-core/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip roadrunner-core.zip -d .agents/skills
Documentation by MathWorks
RoadRunner Core
Foundation skill for all RoadRunner agent workflows. Manages the RoadRunner connection, project/scene/scenario lifecycle, and handle management from MATLAB. Produces the rrApp handle used by all downstream RoadRunner skills.
Execution: all MATLAB code runs via evaluate_matlab_code MCP tool. Never matlab -batch.
When to Use
Connecting to or launching RoadRunner from MATLAB
Creating, opening, or saving projects, scenes, or scenarios
Setting world origin or scene extents
Checking RoadRunner status
Closing RoadRunner safely
Any downstream RoadRunner skill needs
rrAppinitialization
When NOT to Use
RoadRunner is not installed — this skill requires a working RoadRunner installation; it cannot install the product
MATLAB version below R2022a — the
roadrunnerclass and related APIs are not available in earlier releasesrrAppalready exists and is valid — re-runningrrCoreInitializeis safe (it's idempotent) but unnecessary; prefer checkingexist('rrApp','var')first to avoid the overheadUser has not provided installation or project paths when first-time setup is needed — ask the user first, do not guess paths
RoadRunner is intentionally closed — do not reconnect or relaunch without explicit user permission
1. How the Agent Uses This Skill
First-time setup (once per machine — two-tier resolution)
rrCoreInitialize handles setup automatically using a two-tier approach:
| Tier | Condition | What happens |
|---|---|---|
| 1 | Settings valid + roadrunner class on path | Setup skipped — already configured |
| 2 | Agent has installFolder and projectPath variables | Programmatic setup: addpath, savepath, writes MATLAB settings. No GUI. |
Just run rrCoreInitialize. The script automatically:
Connects to a running instance (
roadrunner.connect())If that fails, launches a new instance (
roadrunner()) using saved settingsIf not configured, errors with
PathsRequired— then ask the user forinstallFolderandprojectPath, set them, and re-run
Once setup succeeds, it persists forever (across MATLAB sessions). Never needed again.
No GUI dialogs. This skill never calls roadrunnerSetup. All configuration is done programmatically.
First call in a session
Add the skill scripts to the MATLAB path (required before
rrCoreInitializecan be found):addpath("<absolute-path-to-this-skill>/scripts");Replace
<absolute-path-to-this-skill>with the actual filesystem path to this skill's directory (the folder containing this SKILL.md file).Run
rrCoreInitialize→ it handles everything: connects to a running instance, or launches one using saved settings, or errors with a clear message if not configured.If it errors with
PathsRequired→ ask the user forinstallFolderandprojectPath, set them as variables, re-runrrCoreInitialize.Proceed with the user's request.
Subsequent calls
Check
exist('rrApp','var')— if missing, re-runrrCoreInitializeLook up the operation in the Decision Logic table (Section 3)
Copy the exact pattern from
scripts/rrCoreCommands.munder the matching%%headingSubstitute placeholders with actual values
Execute via
evaluate_matlab_code
Key principle
Never improvise API calls. Before every RoadRunner operation, read the matching %% section from rrCoreCommands.m and reproduce it exactly. Do not guess function names, argument syntax, or parameter orders from memory. This prevents hallucinated function names, missing guard rails, and forgotten handle invalidation.
If you are unsure of the correct syntax for any operation, stop and read the pattern file before attempting the call.
2. Files
| File | Role |
|---|---|
scripts/rrCoreInitialize.m | Runs directly. Bootstraps path + connection + validation. |
scripts/rrCoreCommands.m | Pattern reference. Agent reads %% section, substitutes placeholders, executes. |
Deployment
On first use, the agent ensures the RoadRunner API is on the MATLAB path (one-time savepath). The scripts in this skill are pattern references — the agent reads them and reproduces the patterns via evaluate_matlab_code.
3. Decision Logic
| User Intent | Pattern (%% section) | Placeholders to substitute |
|---|---|---|
| Connect / initialize | INIT | — |
| Connect without launching | CONNECT_ONLY | — (errors if no instance running) |
| Create a new project | NEW_PROJECT or NEW_PROJECT_WITH_ASSETS | projectPath — ask user whether to include base assets (asset library). Always rrCoreInitialize first (RoadRunner must be running with any project before newProject can be called). |
| Open an existing project | OPEN_PROJECT | projectPath |
| Save the project | SAVE_PROJECT | — |
| Create a new scene | NEW_SCENE | — |
| Open a scene | OPEN_SCENE | sceneName — if not found, use LIST_SCENES and present options |
| List available scenes | LIST_SCENES | — |
| Save the scene | SAVE_SCENE or SAVE_SCENE_AS | Ask user: "Save in place, or save with a new name?" If new name → use SAVE_SCENE_AS with sceneName |
| Create a new scenario | NEW_SCENARIO | — |
| Open a scenario | OPEN_SCENARIO | scenarioName — if not found, use LIST_SCENARIOS and present options |
| List available scenarios | LIST_SCENARIOS | — |
| Save the scenario | SAVE_SCENARIO | — |
| Set world origin | CHANGE_WORLD_ORIGIN | lat, lon |
| Set scene center and extents | CHANGE_SCENE_BOUNDS | x, y, w, h |
| Set scene center only | CHANGE_SCENE_CENTER | x, y |
| Set scene extents only | CHANGE_SCENE_EXTENTS | w, h |
| Clear world projection | CLEAR_WORLD_PROJECTION | — |
| Check status | STATUS | — |
| Close RoadRunner | CLOSE | — |
Available From:
changeWorldSettingsrequires R2023b or later. All other operations are available from R2022a.
Launch (handled by rrCoreInitialize)
After first-time setup, rrCoreInitialize automatically launches RoadRunner using saved defaults if no instance is running. Manual launch is only needed for non-default modes:
rrApp = roadrunner(ProjectFolder=projectPath, InstallationFolder=installFolder);| Mode | Add this argument |
|---|---|
| Headless (no UI) | NoDisplay=true |
| No desktop + graphics | NoDesktop=true |
| Custom ports | Ports=[apiPort, cosimPort] |
Manual launch still requires explicit user permission.
4. Placeholders
These are the variable names used in rrCoreCommands.m. The agent substitutes them with actual values before executing.
| Placeholder | Type | Example |
|---|---|---|
SKILL_SCRIPTS_DIR | string | (absolute path to this skill's scripts/ folder) |
rrApp | roadrunner | (from rrCoreInitialize, never reassigned) |
projectPath | string | "D:/Projects/HighwayProject" |
sceneName | string | "FourWaySignal.rrscene" |
scenarioName | string | "CutInScenario" |
lat | double | 42.3021 |
lon | double | -71.3747 |
x, y | double | 1445, 1237 |
w, h | double | 160, 465 |
installFolder | string | "C:/Program Files/RoadRunner R2026a" |
5. Handle Management
This skill produces rrApp via rrCoreInitialize. Operations that change state (NEW_SCENE, OPEN_SCENE, NEW_SCENARIO, OPEN_SCENARIO, OPEN_PROJECT, CLOSE) include clear statements to remove stale handles.
6. Path Setup
RoadRunner API path is added to MATLAB's saved path on first use. No config files or environment variables needed.
The agent runs savepath after adding the API path — this persists across MATLAB sessions. If the user upgrades RoadRunner, the agent detects the failure (roadrunner class missing or version mismatch) and asks for the new installation folder.
7. Critical Rules
Always
rrCoreInitializefirst — never call RoadRunner APIs without a validatedrrAppNever launch without permission — ask the user before
roadrunner(ProjectFolder=...)One
rrAppper session — never create a second connectionRead the pattern before every call — open
rrCoreCommands.m, find the%%section, reproduce it exactly. Do not guess syntax from memory.Never auto-save —
NEW_SCENE,NEW_SCENARIO, andCLOSEpatterns detect unsaved changes but do NOT save automatically. Always ask the user whether to save, save-as, or discard. Saving with the same name overwrites the original and can break backwards compatibility if the file was created with an older version.Verify version after connect — check
rrApp.Versionand report it. If the user requested a specific version, warn if it doesn't match.Ask before save — when saving is needed (new scene/scenario, close, or explicit save request), ask the user whether to save in place, save with a new name, or discard changes
List on not-found — if
openSceneoropenScenariofails because the name doesn't exist, list available scenes/scenarios usingdirand present options to the userRelative scene paths resolve to
<project>/Scenes/Unicode not supported in paths
Handle invalidation is automatic — patterns include
clearstatementsAll execution via MCP — never
matlab -batchclose(rrApp)terminates RoadRunner entirely — the process exits. After close,roadrunner.connect()will fail. A freshroadrunner()launch is required to reconnect.Scene is NOT restored on relaunch — after close + relaunch, RoadRunner opens the project but shows a blank scene. The agent must explicitly reopen the desired scene.
8. Anti-Patterns
Do not launch RoadRunner without user permission
Do not call
roadrunner(ProjectFolder=...)when already connected — this launches a duplicate instanceDo not pass two arguments to
roadrunner.connect(port, port)— use single portDo not call any function on a closed/invalid
rrAppDo not skip
clearstatements from the patternsDo not invent function calls not present in
rrCoreCommands.m(e.g., nosave(rrApp), nosaveSceneAs, noswitchScenario, noLatitude=lat)Do not hardcode installation paths — use the resolution chain in
rrCoreInitializeDo not save a scene without asking the user —
saveScene(rrApp, name)silently overwrites existing filesDo not confuse "close MATLAB" with "close RoadRunner" — they are independent processes
Do not assume scene is restored after relaunch — it is not; always reopen explicitly
9. Project Structure
<RoadRunner Project>/
├── Assets/ 3D models, materials, textures
├── Scenes/ .rrscene files
├── Scenarios/ .rrscenario files
├── Exports/ Exported output
├── Project/ Project metadata
└── Scripts/ User scripts (optional)10. API Behavior Notes
Project
newProjectcreates any missing parent foldersThe folder name becomes the project name
If
openProjecttargets an already-open project, a new blank scene is still created
Scene
Relative paths resolve to
<project>/Scenes/.rrsceneextension is optional — RoadRunner appends it if missingIf the scene belongs to a different project, RoadRunner switches to that project
If modified assets exist during save, the project is also saved
saveScene(rrApp, name)silently overwrites if the name already exists — no confirmationsaveScene(rrApp)on an unnamed (new) scene errors — must provide a nameSubfolder paths work (e.g.,
"Scenarios/subfolder/Name")
Scenario
newScenario,openScenario,saveScenarioavailable since R2022aOpening a new scene automatically closes the active scenario
Scenarios can be opened even on a blank (unsaved) scene
World Settings
| Parameter | Type | Description |
|---|---|---|
WorldOrigin | [lat lon] | Geospatial world origin |
SceneCenter | [x y] | Center of scene workspace |
SceneExtents | [w h] | Scene workspace dimensions |
ClearWorldProjection | logical | Clear current projection |
Available since R2023b.
Status Properties
rrStatus = status(rrApp);
rrStatus.Project.Filename % Current project path
rrStatus.Project.UnsavedChanges % true/false
rrStatus.Scene.Filename % Current scene path
rrStatus.Scene.UnsavedChanges % true/false
rrStatus.Scenario.Filename % Current scenario path
rrStatus.Scenario.UnsavedChanges % true/false| Property | Description |
|---|---|
rrApp.InstallationFolder | RoadRunner install path |
rrApp.Version | Version string |
rrApp.NoDisplay | Console mode flag |
rrApp.NoDesktop | No-desktop mode flag |
Close
close(rrApp)does NOT prompt to save — always save before closingDeletes the associated
roadrunnerobject — do not reuse the variable after closingTerminates the RoadRunner process entirely — it is not just a disconnect
After close,
roadrunner.connect()will fail (nothing to connect to)On relaunch via
roadrunner(), the project is restored but the scene is NOT — a blank scene appearsPort validation enforces range 1024–65535
Connection
rrApp = roadrunner.connect(); % Default port 35707
rrApp = roadrunner.connect(portNumber); % Explicit port| Mode | Syntax | Use case |
|---|---|---|
| GUI (default) | roadrunner(ProjectFolder=...) | Interactive use |
| Headless | roadrunner(ProjectFolder=..., NoDisplay=true) | Batch/CI, no UI |
| No desktop + graphics | roadrunner(ProjectFolder=..., NoDesktop=true) | Export needing render |
| Custom ports | roadrunner(ProjectFolder=..., Ports=[apiPort, cosimPort]) | Multi-instance |
Copyright 2026 The MathWorks, Inc.
Files
- ATTRIBUTION.mdAdded by AutoGineer1019 B
- LICENSELicence file added by AutoGineer1.4 KiB
- SKILL.md14.5 KiB
- manifest.yaml500 B
- scripts/rrCoreCommands.m7.0 KiB
- scripts/rrCoreInitialize.m3.9 KiB
ATTRIBUTION.md
Attribution
This folder is an unmodified copy of the Agent Skill "roadrunner-core", distributed by AutoGineer (https://autogineer.com/agent-skills).
Commit: 2a7f215e965597acf6ed495beb9e7b8aff45a3be
Created by: MathWorks (https://github.com/matlab/matlab-agentic-toolkit/tree/2a7f215e965597acf6ed495beb9e7b8aff45a3be/skills-catalog/automotive/roadrunner-core)
Publisher: MathWorks (https://github.com/matlab)
Licence: BSD 2-Clause License (https://github.com/matlab/matlab-agentic-toolkit/blob/2a7f215e965597acf6ed495beb9e7b8aff45a3be/LICENSE.md)
Licence evidence: repository licence LICENSE.md
Retrieved: 2026-11-07
The skill's own files are unmodified copies. AutoGineer is not affiliated with or endorsed by the author or the publisher.
Files added by AutoGineer
ATTRIBUTION.md: this file, written by AutoGineer
LICENSE: copied from LICENSE.md
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
What our scanner noticed· Low risk
- Phrasing that asks for actions without confirmation
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- MathWorks
- Publisher
- MathWorks (Official)
- Source
- matlab/matlab-agentic-toolkit · skills-catalog/automotive/roadrunner-core · commit 2a7f215
- Licence
- BSD 2-Clause License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE.md)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by MathWorks or MathWorks.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download roadrunner-core.zip