roadrunner.hdmap.StaticObject
Description
A roadrunner.hdmap.StaticObject object enables you to define the
static object instances in a RoadRunner HD Map scene model. This object is used for props and road furniture that do not
move.
Creation
Syntax
Description
creates an empty staticObject = roadrunner.hdmap.StaticObject()StaticObject.
sets the properties of the staticObject = roadrunner.hdmap.StaticObject(Name=Value)StaticObject using name-value pairs.
Properties
ID of the StaticObject element, specified as a character vector
or string scalar.
Example: rrMap.StaticObjects=
roadrunner.hdmap.StaticObject(ID="StaticObject1")
creates a StaticObject with id StaticObject1 in a
RoadRunner HD Map.
Data Types: char | string
Geometry of the StaticObject, specified as a GeoOrientedBoundingBox (RoadRunner). Static objects fit within an oriented bounding
box. Objects should be scaled to fit the bound and then rotated. See GeoOrientation3 (RoadRunner) for how to handle rotations of objects.
Data Types: vector
Type of StaticObject , specified as a roadrunner.hdmap.Reference (RoadRunner) object.
User-defined ancillary data, specified as a
roadrunner.hdmap.Metadata object or a vector of
roadrunner.hdmap.Metadata objects. Use a vector of
roadrunner.hdmap.Metadata objects to assign multiple user-defined
parameters to a static object.
Examples
Create an empty RoadRunner HD Map by calling the roadrunnerHDMap object.
rrMap = roadrunnerHDMap()
rrMap =
roadrunnerHDMap with properties:
Author: ""
Projection: ""
GeographicBoundary: [0×3 double]
Lanes: [0×1 roadrunner.hdmap.Lane]
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]
Create a static object using the roadrunner.hdmap.StaticObject object. Specify the static object information for the object id.
rrMap.StaticObjects = roadrunner.hdmap.StaticObject(ID="StaticObject1")rrMap =
roadrunnerHDMap with properties:
Author: ""
Projection: ""
GeographicBoundary: [0×3 double]
Lanes: [0×1 roadrunner.hdmap.Lane]
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: [1×1 roadrunner.hdmap.StaticObject]
Add static objects, such as traffic cones and trees, to 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 50 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],TravelDirection="Forward",LaneType="Driving");
Create the lane boundaries of the road using the roadrunner.hdmap.LaneBoundary object. 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]); rrMap.LaneBoundaries(2) = roadrunner.hdmap.LaneBoundary(ID="Right",Geometry=[3 0; 3 50]);
Link the lane boundaries to the lane. Define the left and the right lane boundaries for the lane, and specify the alignment between lanes and lane boundaries.
leftBoundary(rrMap.Lanes(1),"Left",Alignment="Forward"); rightBoundary(rrMap.Lanes(1),"Right",Alignment="Forward");
To add a static object to the HD Map, first extract the corresponding prop model asset using the roadrunner.hdmap.RelativeAssetPath object. For more information about these assets, see RoadRunner Asset Types (RoadRunner). Extract the assets for a tree and traffic cone asset to add them to the HD map.
pathTree = roadrunner.hdmap.RelativeAssetPath(AssetPath="Assets/Props/Trees/Eucalyptus_Sm01.fbx"); pathCone = roadrunner.hdmap.RelativeAssetPath(AssetPath="Assets/Props/TrafficControl/TrafficCone01.fbx");
Next, create two static object type elements that reference the extracted tree and cone assets using the roadrunner.hdmap.StaticObjectType object. For each static object specify the ID and path to its asset.
rrMap.StaticObjectTypes(1) = roadrunner.hdmap.StaticObjectType(ID="StaticObjectType1",AssetPath=pathTree); rrMap.StaticObjectTypes(2) = roadrunner.hdmap.StaticObjectType(ID="StaticObjectType2",AssetPath=pathCone);
Create references to the static objects using the roadrunner.hdmap.MarkingReference object.
objectRef1 = roadrunner.hdmap.Reference(ID="StaticObjectType1"); objectRef2 = roadrunner.hdmap.Reference(ID="StaticObjectType2");
Define the geometry of the static objects as oriented bounding boxes using the roadrunner.hdmap.GeoOrientedBoundingBox object, and then add the static objects to the HD Map.
GeoOriBBTree = roadrunner.hdmap.GeoOrientedBoundingBox(Center=[3.5 4 3.04],Dimension=[2 2 3.04]); GeoOriBBCone = roadrunner.hdmap.GeoOrientedBoundingBox(Center=[-2 4 0.25],Dimension=[0.27 0.27 0.25]); rrMap.StaticObjects(1) = roadrunner.hdmap.StaticObject(ID="Tree",Geometry=GeoOriBBTree,ObjectTypeReference=objectRef1); rrMap.StaticObjects(2) = roadrunner.hdmap.StaticObject(ID="Cone",Geometry=GeoOriBBCone,ObjectTypeReference=objectRef2);
Plot the lane centers, lane boundaries, and static objects to preview them before importing the HD Map into RoadRunner.
plot(rrMap,ShowStaticObjects=true);

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 R2022bThe object now supports the Metadata property, which enables you to
add user-defined metadata for static objects to a RoadRunner HD Map scene model.
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.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)