# Roadrunner Convert Lanelet2 To Rrhd

Convert Lanelet2 maps (.osm) to RoadRunner HD Map (.rrhd) format using MATLAB.

- Repository: https://github.com/matlab/matlab-agentic-toolkit (1237 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-10-27
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add matlab/matlab-agentic-toolkit --skill roadrunner-convert-lanelet2-to-rrhd -g -a claude-code -y`
Codex: `npx skills add matlab/matlab-agentic-toolkit --skill roadrunner-convert-lanelet2-to-rrhd -g -a codex -y`
Cursor: `npx skills add matlab/matlab-agentic-toolkit --skill roadrunner-convert-lanelet2-to-rrhd -g -a cursor -y`
Gemini CLI: `npx skills add matlab/matlab-agentic-toolkit --skill roadrunner-convert-lanelet2-to-rrhd -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add matlab/matlab-agentic-toolkit`

## Description

Convert Lanelet2 maps (.osm) to RoadRunner HD Map (.rrhd) format using MATLAB. Use when converting Lanelet2 maps into RoadRunner Scene Builder, building driving scenes from open-source map data, or transforming road network definitions for simulation.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Lanelet2 to RRHD Converter

Converts Lanelet2 `.osm` files to RoadRunner HD Map `.rrhd` format.

## When to Use

- Converting a Lanelet2 `.osm` file to RoadRunner HD Map `.rrhd` format
- Importing Lanelet2 maps into RoadRunner via MATLAB
- Building RRHD from `.osm` sources that contain `type=lanelet` relations
- Need full pipeline: parse, geometry, topology, semantics, junctions, barriers, signs, markings

## When NOT to Use

- Input is a standard OpenStreetMap file (highway=* ways without `type=lanelet` relations)
- Input is OpenDRIVE `.xodr`, import directly via `roadrunner-import-scene`
- Building RRHD from scratch without a source file, use `roadrunner-rrhd-authoring`
- Only need asset path lookups, 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 `.m` file, run with `run_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.
- **ALL pipeline steps are mandatory.** Do NOT stop after writing lanes/boundaries, junctions, curve markings, barriers, signs, and speed limits must all be built.
- **Boundary geometry is IMMUTABLE.** Never flip, resample, project, or modify boundary points.
- **One boundary object per way.** Deduplicate via `wayToBndID` map.
- **Detect alignment for EVERY lane.** Never hardcode `"Forward"` for all boundaries.
- **Center line density: 1 point per meter minimum.** Use `max(10, round(avgLen), nLeft, nRight)`.
- **Run enforcement gate before `write()`.** Alignment, spatial, extension, and completeness checks are mandatory.
- **No nested function definitions.** Code runs in script context, all logic inline or anonymous functions.

## Behavior

The rest: https://github.com/matlab/matlab-agentic-toolkit/blob/HEAD/skills-catalog/automotive/roadrunner-convert-lanelet2-to-rrhd/SKILL.md
