Skip to content

matlab/matlab-agentic-toolkit / skills-catalog/automotive/roadrunner-build-rrhd-map

roadrunner-build-rrhd-map

Verified

Build, convert, and import RoadRunner HD Maps (.rrhd) in MATLAB. Author lanes, lane boundaries, markings, junctions, signs, barriers, and speed limits with roadrunnerHDMap; convert Lanelet2 (.osm, Autoware) maps to RRHD; resolve RoadRunner road asset paths for markings, crosswalks, signs, signals, and barriers; and import or build .rrhd or OpenDRIVE (.xodr) files into a RoadRunner scene. Use when creating road networks for driving simulation, converting Lanelet2 or other HD map sources to RRHD, looking up road asset paths, or loading and verifying a map in RoadRunner or RoadRunner Scene Builder. Not for building scenes from recorded sensor data, running simulations, or recreating OpenSCENARIO (.xosc) scenarios.

FileKindSize
SKILL.mdskill md15.5 KB
manifest.yamlconfig557 B
references/assets/assetCatalog.mdmarkdown7.4 KB
references/assets/barriers.mdmarkdown3.6 KB
references/assets/laneMarkings.mdmarkdown5.8 KB
references/assets/laneTypes.mdmarkdown2.2 KB
references/assets/signs.mdmarkdown5.0 KB
references/assets/staticObjects.mdmarkdown5.1 KB
references/authoring/alignmentRules.mdmarkdown10.3 KB
references/authoring/apiReference.mdmarkdown9.0 KB
references/authoring/authoringWorkflow.mdmarkdown20.4 KB
references/authoring/deduplicateBoundaries.mdmarkdown4.9 KB
references/authoring/junctionPolygon.mdmarkdown6.8 KB
references/authoring/leftGapFilter.mdmarkdown6.5 KB
references/authoring/orthogonalSplit.mdmarkdown7.7 KB
references/authoring/resolveHeights.mdmarkdown2.4 KB
references/authoring/snapEndpoints.mdmarkdown4.0 KB
references/authoring/splitClosedGeometry.mdmarkdown3.8 KB
references/authoring/synthesizeCenterLine.mdmarkdown4.6 KB
references/authoring/validateMap.mdmarkdown1.1 KB
references/import/buildOptions.mdmarkdown4.0 KB
references/import/importScene.mdmarkdown12.9 KB
references/lanelet2/buildRRHD.mdmarkdown14.2 KB
references/lanelet2/conversionPipeline.mdmarkdown13.3 KB
references/lanelet2/coordinates.mdmarkdown4.9 KB
references/lanelet2/discoverRelations.mdmarkdown2.4 KB
references/lanelet2/enforcementGate.mdmarkdown3.3 KB
references/lanelet2/extractGeometry.mdmarkdown3.4 KB
references/lanelet2/extractJunctions.mdmarkdown5.0 KB
references/lanelet2/extractLanelets.mdmarkdown2.6 KB
references/lanelet2/extractNonLaneElements.mdmarkdown14.4 KB
references/lanelet2/extractSemantics.mdmarkdown4.4 KB
references/lanelet2/extractTopology.mdmarkdown5.4 KB
references/lanelet2/placedObjects.mdmarkdown4.4 KB
references/lanelet2/readOSM.mdmarkdown4.0 KB
references/lanelet2/splitClosedRoads.mdmarkdown3.0 KB
scripts/detectAlignment.mother3.3 KB
scripts/detectClosedLoop.mother5.8 KB
scripts/detectJunctions.mother12.4 KB
scripts/discoverWayTypes.mother4.8 KB
scripts/parseOSM.mother4.0 KB
scripts/resolveHeightConflicts.mother6.8 KB
scripts/resolveSignAsset.mother7.2 KB
scripts/snapConnectedEndpoints.mother4.0 KB
scripts/validateRRHD.mother6.3 KB

scripts/resolveSignAsset.m

View on GitHub
function [assetPath, objectType, code, isFallback] = resolveSignAsset(rawCode, region, options)
%resolveSignAsset Map a source sign code to a RoadRunner sign or signal asset path.
%   [assetPath, objectType, code, isFallback] = resolveSignAsset(rawCode, region)
%   normalizes a sign code from a Lanelet2 or HD map source and returns the
%   region-appropriate RoadRunner asset path. Accepts Lanelet2 way subtypes
%   ("stop_sign"), regulatory-element sign_type values ("de274-30",
%   "jp_323-40"), Autoware traffic_sign_id values ("jp_330-A"), prefixed
%   RoadSign:Type values ("DE-2017/274-70"), and US MUTCD codes ("us_r1_1").
%
%   [...] = resolveSignAsset(..., ProjectFolder=folder) also verifies the
%   asset exists under the RoadRunner project folder (trying both .svg and
%   .svg_rrx) and falls back to the blank sign when it does not.
%
%   Inputs:
%     rawCode        - Source sign code (string)
%     region         - "Japan", "Germany", or "US" (detect from GeoReference)
%     ProjectFolder  - Optional RoadRunner project folder for existence checks
%
%   Outputs:
%     assetPath      - Asset path starting with "Assets/" (string)
%     objectType     - "sign" or "signal"
%     code           - Normalized code, safe for SignType IDs (string)
%     isFallback     - true when the code was not recognized (or the asset is missing) and the blank sign was used
%
%   Example:
%     [p, t] = resolveSignAsset("jp_330-A", "Japan")
%     % p = "Assets/Signs/Japan/Regulatory Signs/Stop_JP_01.svg_rrx", t = "sign"

% Copyright 2026 The MathWorks, Inc.

    arguments
        rawCode (1,1) string
        region (1,1) string {mustBeMember(region, ["Japan", "Germany", "US"])}
        options.ProjectFolder (1,1) string = ""
    end

    code = lower(strtrim(rawCode));
    code = regexprep(code, "^traffic_sign/", "");
    code = regexprep(code, "^(de-?\d{4}/|de[_-]?|us[_-]|jp[_-])", "");
    num = regexp(code, "^\d+", "match", "once");
    valTok = regexp(code, "-(\d+)$", "tokens", "once");
    speedVal = "";
    if ~isempty(valTok), speedVal = valTok{1}; end

    % Paths verified against the RoadRunner_Asset_Library (R2026a). Note the mixed .svg / .svg_rrx extensions.
    stopPath = struct("Japan", "Signs/Japan/Regulatory Signs/Stop_JP_01.svg_rrx", ...
        "Germany", "Signs/Germany/Regulatory Signs/Stop_DE.svg_rrx", "US", "Signs/US/Regulatory Signs/Stop_US.svg");
    yieldPath = struct("Japan", "Signs/Japan/Auxiliary Signs/Yield_JP.svg_rrx", ...
        "Germany", "Signs/Germany/Regulatory Signs/Yield_DE.svg_rrx", "US", "Signs/US/Regulatory Signs/Yield_US.svg");
    speedPattern = struct("Japan", "Signs/Japan/Regulatory Signs/MaxSpeedLimit_%s_JP.svg_rrx", ...
        "Germany", "Signs/Germany/Regulatory Signs/MaxSpeed_%s_DE.svg_rrx", ...
        "US", "Signs/US/Regulatory Signs/SpeedLimit_%s_US.svg_rrx");
    blankPath = "Signs/US/White_Blank_US.svg";   % neutral fallback for unrecognized codes in every region
    japanKeyword = ["no_entry", "NoEntryForVehicles_JP"; "no_parking", "NoParking_JP"; ...
        "no_stopping", "NoStopping_JP"; "one_way", "OneWay_JP_01"; "no_overtaking", "NoOvertaking_JP"; ...
        "no_u_turn", "NoUTurns_JP"; "slow", "SlowDown_JP_01"];

    % German StVO numbers with an exact asset (folder/name, extension .svg_rrx)
    germanCode = ["267", "Regulatory Signs/DoNotEnter_DE"; "272", "Regulatory Signs/NoUTurns_DE"; ...
        "276", "Regulatory Signs/NoPassing_DE"; "277", "Regulatory Signs/NoPassing_HeavyVehicles_DE"; ...
        "278", "Regulatory Signs/MaxSpeed_End_DE"; "280", "Regulatory Signs/NoPassing_End_DE"; ...
        "281", "Regulatory Signs/NoPassing_HeavyVehicles_End_DE"; "282", "Regulatory Signs/AllRestrictions_DE"; ...
        "283", "Regulatory Signs/NoParkingOrStopping_DE"; "286", "Regulatory Signs/NoParking_DE"; ...
        "264", "Regulatory Signs/MaxWidth_DE"; "265", "Regulatory Signs/MaxHeight_DE"; "266", "Regulatory Signs/MaxLength_DE"; ...
        "215", "Regulatory Signs/Roundabout_DE"; "220", "Regulatory Signs/OneWayStreet_DE_01"; ...
        "237", "Regulatory Signs/BicycleLane_DE"; "239", "Regulatory Signs/PedWalkway_DE"; ...
        "301", "Directional Signs/PriorityRoad_Intersection_DE"; "306", "Directional Signs/PriorityRoad_DE"; ...
        "307", "Directional Signs/PriorityRoad_End_DE"; "308", "Directional Signs/PriorityOverOncomingTraffic_DE"];

    objectType = "sign";
    isFallback = false;
    path = "";
    isStop = (contains(code, "stop") && ~contains(code, ["no_stop", "nostop", "stopping"])) || ...
        startsWith(code, ["r1_1", "r1-1"]) || ...
        (region == "Japan" && num == "330") || (region == "Germany" && num == "206");
    isYield = contains(code, ["yield", "give_way"]) || startsWith(code, ["r1_2", "r1-2"]) || ...
        (region == "Germany" && num == "205");
    isSpeed = contains(code, ["speed", "maxspeed"]) || startsWith(code, ["r2_1", "r2-1"]) || ...
        (region == "Germany" && num == "274") || (region == "Japan" && num == "323");

    if contains(code, ["traffic_light", "signal"])
        objectType = "signal";
        path = "Props/Signals/Signal_3Light_Post01.fbx";
    elseif region == "Germany" && startsWith(code, "274.1")
        path = "Signs/Germany/Regulatory Signs/MaxSpeedZone_30_DE.svg_rrx";      % zone begin (Tempo-30-Zone)
    elseif region == "Germany" && startsWith(code, "274.2")
        path = "Signs/Germany/Regulatory Signs/MaxSpeedZone_End_30_DE.svg_rrx";  % zone end
    elseif isStop
        path = stopPath.(region);
    elseif isYield
        path = yieldPath.(region);
    elseif isSpeed
        if speedVal == "", speedVal = regexp(code, "(\d+)$", "match", "once"); end
        v = str2double(speedVal);
        if speedVal ~= "" && v >= 5 && v <= 160 && mod(v, 5) == 0
            path = sprintf(speedPattern.(region), speedVal);
        end
    elseif region == "Germany" && any(germanCode(:, 1) == num)
        path = "Signs/Germany/" + germanCode(germanCode(:, 1) == num, 2) + ".svg_rrx";
    elseif region == "Japan" && num == "329"
        path = "Signs/Japan/Regulatory Signs/SlowDown_JP_01.svg_rrx";
    elseif region == "Japan"
        hit = find(arrayfun(@(k) contains(code, k), japanKeyword(:, 1)), 1);
        if ~isempty(hit), path = "Signs/Japan/Regulatory Signs/" + japanKeyword(hit, 2) + ".svg_rrx"; end
    elseif contains(code, "no_u_turn") && region == "US"
        path = "Signs/US/Regulatory Signs/NoUTurns_US.svg";
    end

    if path == ""
        path = blankPath;
        isFallback = true;
    end
    assetPath = "Assets/" + string(path);

    if options.ProjectFolder ~= ""
        exists = @(a) isfile(fullfile(options.ProjectFolder, a)) || isfile(fullfile(options.ProjectFolder, a + ".rrmeta"));
        if ~exists(assetPath)
            alt = regexprep(assetPath, "\.svg_rrx$", ".svg");
            if alt == assetPath, alt = regexprep(assetPath, "\.svg$", ".svg_rrx"); end
            if exists(alt)
                assetPath = alt;
            else
                warning("resolveSignAsset:AssetMissing", "Asset not found in project: %s — using blank sign.", assetPath);
                assetPath = "Assets/" + blankPath;
                isFallback = true;
            end
        end
    end
    code = string(regexprep(code, "[^a-z0-9]+", "_"));

    if nargout == 0, clear assetPath objectType code isFallback; end
end
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