Skip to content

zrwangems/dsh-zrwang-plugin / skills/engineering/matlab/automotive/roadrunner-convert-lanelet2-to-rrhd

roadrunner-convert-lanelet2-to-rrhd

Verified

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.

references/detectGeoReference.md

View on GitHub
# Reference: Detect GeoReference

## Description
Auto-detects a geographic reference point from the centroid of all node lat/lon values in the parsed OSM struct.

## Inputs
| Parameter | Type | Description |
|-----------|------|-------------|
| `ll2` | struct | Output from `readOSM` with `.nodes` containers.Map |

## Output
`geoRef` — `[lat, lon]` centroid of all nodes.

## Algorithm
```matlab
nodeKeys = keys(ll2.nodes);
latSum = 0; lonSum = 0;
for i = 1:numel(nodeKeys)
    nd = ll2.nodes(nodeKeys{i});
    latSum = latSum + nd.lat;
    lonSum = lonSum + nd.lon;
end
geoRef = [latSum/numel(nodeKeys), lonSum/numel(nodeKeys)];

% CRITICAL: Ensure geoRef is double before any math (cosd, sind, etc.)
geoRef = double(geoRef);
```

**WARNING:** Values retrieved from `containers.Map` may not retain their numeric type. Always cast `geoRef = double(geoRef)` before passing to trigonometric functions (`cosd`, `sind`). Without this cast, `cosd(geoRef(1))` will error with "Invalid data type. Argument must be double or single."

## Example
```matlab
% After parsing nodes, compute centroid:
% geoRef = [meanLat, meanLon];  e.g. [42.300750, -83.698304]
```

----

Copyright 2026 The MathWorks, Inc.
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall