主要内容

convertToStruct

Convert RoadRunner HD Map into MATLAB structure

Since R2026a

    Description

    rrHDMapStruct = convertToStruct(rrHDMap) converts the RoadRunner HD Map rrHDMap into a MATLAB® structure, rrHDMapStruct.

    example

    Examples

    collapse all

    Create an empty RoadRunner HD Map object.

    rrHDMap = roadrunnerHDMap;

    Specify the path to a RoadRunner HD Map binary file, and use the read function to populate the empty RoadRunner HD Map object with the map data.

    Note: Replace the file path specified in this code block with the absolute path to an .rrhd file on your system.

    filename = "C:\RR\MyProject\Exports\FourWaySignal.rrhd";
    read(rrHDMap,filename);

    Convert the RoadRunner HD Map object into a MATLAB structure.

    rrHDMapStruct = convertToStruct(rrHDMap)
    rrHDMapStruct = struct with fields:
                 Lanes: [109×1 struct]
        LaneBoundaries: [134×1 struct]
             Junctions: [1×1 struct]
           SpeedLimits: [61×1 struct]
    
    

    Input Arguments

    collapse all

    RoadRunner HD Map to convert to structure, specified as a roadrunnerHDMap object.

    Output Arguments

    collapse all

    RoadRunner HD Map structure, returned as a structure. The fields of this structure correspond to the Lanes, LaneBoundaries, Junctions, and SpeedLimits properties of the rrHDMap object. Because the values of these properties are also objects, the corresponding structure fields contain structures. For more information about these properties, see roadrunnerHDMap.

    Version History

    Introduced in R2026a