roadrunner.hdmap.LaneMarking
Description
A roadrunner.hdmap.LaneMarking object enables you to define the
road lane marking object in a RoadRunner HD Map scene model.
Creation
Syntax
Description
creates an empty lane marking.laneMarking = roadrunner.hdmap.LaneMarking()
sets the properties of the lane marking using name-value pairs.laneMarking = roadrunner.hdmap.LaneMarking(Name=Value)
Properties
ID of the lane marking element, specified as a character vector or string scalar.
The ID can be referenced by the lane elements using roadrunner.hdmap.MarkingReference (RoadRunner) object.
Data Types: char | string
Relative path for lane marking asset, specified as a roadrunner.hdmap.RelativeAssetPath (RoadRunner) object. To define the lane markings on a
span, RelativeAssetPath can be used to reference existing marking
assets in the library.
Examples
Create an empty RoadRunner HD Map by calling the roadrunnerHDMap object.
rrMap = roadrunnerHDMap()
rrMap =
roadrunnerHDMap with properties:
Author: ""
GeoReference: [0 0]
GeographicBoundary: []
Lanes: [0×1 roadrunner.hdmap.Lane]
SpeedLimits: [0×1 roadrunner.hdmap.SpeedLimit]
LaneBoundaries: [0×1 roadrunner.hdmap.LaneBoundary]
LaneGroups: [0×1 roadrunner.hdmap.LaneGroup]
LaneMarkings: [0×1 roadrunner.hdmap.LaneMarking]
Junctions: [0×1 roadrunner.hdmap.Junction]
BarrierTypes: [0×1 roadrunner.hdmap.BarrierType]
Barriers: [0×1 roadrunner.hdmap.Barrier]
SignTypes: [0×1 roadrunner.hdmap.SignType]
Signs: [0×1 roadrunner.hdmap.Sign]
StaticObjectTypes: [0×1 roadrunner.hdmap.StaticObjectType]
StaticObjects: [0×1 roadrunner.hdmap.StaticObject]
StencilMarkingTypes: [0×1 roadrunner.hdmap.StencilMarkingType]
StencilMarkings: [0×1 roadrunner.hdmap.StencilMarking]
CurveMarkingTypes: [0×1 roadrunner.hdmap.CurveMarkingType]
CurveMarkings: [0×1 roadrunner.hdmap.CurveMarking]
SignalTypes: [0×1 roadrunner.hdmap.SignalType]
Signals: [0×1 roadrunner.hdmap.Signal]
Create a relative path to an asset. In this example, we create a relative path to the dashed single white asset. This path is relative to the Assets folder of your RoadRunner project.
path = roadrunner.hdmap.RelativeAssetPath(AssetPath="/Assets/Markings/DashedSingleWhite.rrlms")path =
RelativeAssetPath with properties:
AssetPath: "/Assets/Markings/DashedSingleWhite.rrlms"
Create the road lane marking using the roadrunner.hdmap.LaneMarking object. Specify the lane marking information for the lane marking id and the asset path.
rrMap.LaneMarkings = roadrunner.hdmap.LaneMarking(ID="Dashed1", AssetPath=path)rrMap =
roadrunnerHDMap with properties:
Author: ""
GeoReference: [0 0]
GeographicBoundary: []
Lanes: [0×1 roadrunner.hdmap.Lane]
SpeedLimits: [0×1 roadrunner.hdmap.SpeedLimit]
LaneBoundaries: [0×1 roadrunner.hdmap.LaneBoundary]
LaneGroups: [0×1 roadrunner.hdmap.LaneGroup]
LaneMarkings: [1×1 roadrunner.hdmap.LaneMarking]
Junctions: [0×1 roadrunner.hdmap.Junction]
BarrierTypes: [0×1 roadrunner.hdmap.BarrierType]
Barriers: [0×1 roadrunner.hdmap.Barrier]
SignTypes: [0×1 roadrunner.hdmap.SignType]
Signs: [0×1 roadrunner.hdmap.Sign]
StaticObjectTypes: [0×1 roadrunner.hdmap.StaticObjectType]
StaticObjects: [0×1 roadrunner.hdmap.StaticObject]
StencilMarkingTypes: [0×1 roadrunner.hdmap.StencilMarkingType]
StencilMarkings: [0×1 roadrunner.hdmap.StencilMarking]
CurveMarkingTypes: [0×1 roadrunner.hdmap.CurveMarkingType]
CurveMarkings: [0×1 roadrunner.hdmap.CurveMarking]
SignalTypes: [0×1 roadrunner.hdmap.SignalType]
Signals: [0×1 roadrunner.hdmap.Signal]
Add markings to road boundaries in a RoadRunner HD Map, and build a RoadRunner scene using the HD Map.
Create an empty RoadRunner HD Map by using the roadrunnerHDMap object.
rrMap = roadrunnerHDMap;
Create a road lane 100 meters in length using the roadrunner.hdmap.Lane object. Specify the lane ID, coordinates defining the centerline of the lane, driving direction, and lane type.
rrMap.Lanes(1) = roadrunner.hdmap.Lane(ID="Lane",Geometry=[0 0; 0 50; 0 100],TravelDirection="Forward",LaneType="Driving");
Create the lane boundaries of the road using the roadrunner.hdmap.LaneBoundary object. For each boundary, specify the lane ID and the coordinates that define the points of the lane boundary.
rrMap.LaneBoundaries(1) = roadrunner.hdmap.LaneBoundary(ID="Left",Geometry=[-3 0; -3 50;-3 100]); rrMap.LaneBoundaries(2) = roadrunner.hdmap.LaneBoundary(ID="Right",Geometry=[3 0; 3 50; 3 100]);
Link the lane boundaries to the lane. Define the left and the right lane boundaries for the lane, and specify the alignment between the lane and lane boundaries.
leftBoundary(rrMap.Lanes(1),"Left",Alignment="Forward"); rightBoundary(rrMap.Lanes(1),"Right",Alignment="Forward");
To add solid yellow lane markings to your lane boundaries, first extract the corresponding lane marking asset using the roadrunner.hdmap.RelativeAssetPath object. For more information about these assets, see RoadRunner Asset Types (RoadRunner).
solidYellowAsset = roadrunner.hdmap.RelativeAssetPath(AssetPath="Assets/Markings/SolidSingleYellow.rrlms");Next, create a solid yellow lane marking using the roadrunner.hdmap.LaneMarking object. Specify the lane marking ID and the path to the solid yellow lane marking asset.
rrMap.LaneMarkings = roadrunner.hdmap.LaneMarking(ID="SolidYellow",AssetPath=solidYellowAsset);Create a reference to the solid yellow marking to apply to the lane boundaries using the roadrunner.hdmap.MarkingReference object.
markingRefSY = roadrunner.hdmap.MarkingReference(MarkingID=roadrunner.hdmap.Reference(ID="SolidYellow"));Use parametric attributes to apply this lane marking along the entire lengths of the left and right lane boundaries.
markingSpan = [0 1]; markingAttributeSY = roadrunner.hdmap.ParametricAttribution(MarkingReference=markingRefSY,Span=markingSpan); rrMap.LaneBoundaries(1).ParametricAttributes = markingAttributeSY; rrMap.LaneBoundaries(2).ParametricAttributes = markingAttributeSY;
Plot the lane centers and lane boundaries to preview them before importing the HD Map into RoadRunner.
plot(rrMap);

Write the modified HD Map to a binary file.
filename = "MyMap.rrhd";
write(rrMap,filename)To open RoadRunner using MATLAB®, first specify the path to your RoadRunner project. This code shows the path for a sample project folder location in Windows®. If you are using RoadRunner for the first time, you must install RoadRunner and activate your RoadRunner license. For more information, see Install and Activate RoadRunner (RoadRunner).
rrProjectPath = "C:\RR\MyProject";Specify the path to your local RoadRunner installation folder. This code shows the path for the default installation location in Windows.
rrAppPath = "C:\Program Files\RoadRunner R2025b\bin\win64";Open RoadRunner using the roadrunner object from the MATLAB command line. Alternatively, you can start the RoadRunner application interactively, using the roadrunnerSetup (RoadRunner) function. This function opens a dialog box to specify the project folder and installation folder to use when opening RoadRunner.
rrApp = roadrunner(rrProjectPath,InstallationFolder=rrAppPath);
Import the RoadRunner HD Map file MyMap.rrhd into your RoadRunner scene, and build the RoadRunner HD Map data. Before you build the scene, you must activate your RoadRunner Scene Builder license. RoadRunner Scene Builder is an add-on product that requires an addition to your RoadRunner license. For more details, see RoadRunner Scene Builder.
file = fullfile(pwd,"MyMap.rrhd"); importScene(rrApp,file,"RoadRunner HD Map");
This figure shows the built scene in the RoadRunner canvas.

Version History
Introduced in R2022b
See Also
roadrunnerHDMap (RoadRunner) | roadrunner.hdmap.Lane (RoadRunner) | roadrunner.hdmap.LaneBoundary (RoadRunner) | roadrunner.hdmap.LaneGroup (RoadRunner)
Topics
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)