roadrunner-convert-lanelet2-to-rrhd
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.
npx skills add matlab/matlab-agentic-toolkit --skill roadrunner-convert-lanelet2-to-rrhd --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Converts Lanelet2 (.osm) maps to RoadRunner HD Map (.rrhd) format. It enforces a complete pipeline: parse OSM, validate lanelet2 format, extract lanelets, discover all element types (including signs, barriers, markings), and build geometry and RRHD objects for the map using MATLAB. It supports a full conversion flow from Lanelet2 sources to RRHD outputs with automated companion skills to resolve semantics and authoring patterns.
How it works
- Checks for Lanelet2-specific content in the input and errors if the file is not Lanelet2 (requires type=lanelet in at least one relation).
- Parses OSM to obtain nodes, ways, and relations; classifies lanelet-related elements and non-lanelet elements.
- Step 3a: extracts lanelets (left/right ways, subtype, speed limit, turn directions).
- Step 3b: discovers all way types by scanning every way, grouping into categories such as stop_line, pedestrian_marking, zebra_marking, fence, guard_rail, jersey_barrier, wall, curbstone, traffic_sign, traffic_light, etc.
- Step 3c: discovers all relation types and sorts non-lanelet relations into trafficSignRels, speedLimitRels, rightOfWayRels, trafficLightRels, multipolygonRels, unmappedRels, and prints a discovery summary.
- Step 4: builds geometry by resolving node geometry, preferring local_x/local_y when present, otherwise projecting lat/lon to ENU meters using a map origin (from map_projector_info.yaml) or centroid fallback.
- Enforces mandatory center-line synthesis: detects opposing boundaries, resamples to a density-based point count, averages to center line, enforces orthogonal endpoints with tangent blending, and preserves boundary geometry without modification.
- Outputs MATLAB-constructed RRHD objects and runs through the required pipeline steps in a single code block, ensuring all steps execute (lanes, boundaries, junctions, curve markings, barriers, signs, speed limits).
When to use it
- When converting a Lanelet2 .osm file to RoadRunner HD Map .rrhd format.
- When importing Lanelet2 maps into RoadRunner via MATLAB.
- When building RRHD from .osm sources that contain type=lanelet relations.
- When a full conversion pipeline is required (parse, geometry, topology, semantics, junctions, barriers, signs, and speed limits).
What it can touch
- The conversion pipeline touches MATLAB code generated at runtime in a script context (no nested functions). It uses MATLAB data structures and RoadRunner object constructors with Name=Value syntax for assets like RelativeAssetPath and AlignedReference. It relies on companion skills roadrunner-rrhd-authoring and roadrunner-asset-mapping during conversion for API references and asset path resolution.
Caveats
- This skill is limited to Lanelet2 OSM inputs; non-Lanelet OpenStreetMap inputs are rejected with an explicit error.
- Boundary geometry is immutable after initial parsing; do not modify boundary points post-parsing.
- The process requires that all steps (lanes, boundaries, junctions, curve markings, barriers, signs, speed limits) be executed; the completeness gate enforces this.
# 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 li
- When to Use
- When NOT to Use
- Key Rules
- Behavior
- Coordinate System
- Step 1: Check for mapprojectorinfo.yaml
- Step 2: Determine coordinate mode
- Step 3: Project lat/lon to local meters (when needed)
- Geometry Invariants (MUST enforce — violations produce broken RRHD)
- MATLAB Script Constraints
- Pipeline (execute in order)
- Step 1: Parse OSM
- Step 2: Validate Format
- Step 3: Extract Lanelets + Discover ALL Non-Lane Elements
What does the roadrunner-convert-lanelet2-to-rrhd skill do?
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.
How do I install it?
Run `npx skills add matlab/matlab-agentic-toolkit --skill roadrunner-convert-lanelet2-to-rrhd --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From matlab/matlab-agentic-toolkit, a repository with 868 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
