roadrunnerHDMap
Description
A roadrunnerHDMap
object enables you to create a RoadRunner HD Map using MATLAB®. You can also populate the map with lanes, lane boundaries, lane markings,
and junctions.
RoadRunner HD Map is a road data model for representing high-definition (HD) map data in a RoadRunner scene. This model defines a simple data structure to represent road layouts using lanes, lane boundaries, lane markings, and junctions. You can use the RoadRunner HD Map to create a binary file for your custom HD map data, import the binary file into RoadRunner, and build scenes.
Creation
Description
creates an
empty RoadRunner HD Map. You can populate the map with lanes, lane boundaries, lane
markings, and junctions using rrMap
= roadrunnerHDMap()roadrunnerHDMap
object
properties. The data in the map is serialized using protocol buffers and saved
in a binary format with the .rrhd
extension using the write
method. You can use the read method to read a file with .rrhd
extension and populate an empty roadrunnerHDMap
object.
sets the properties using name-value pairs.rrMap
= roadrunnerHDMap(Name=Value
)
Properties
Author
— Name of map author
character vector | string scalar
Name of the map author, specified as a string scalar.
Example: rrMap
=
roadrunnerHDMap
(Author
="Map
Author"
) creates a RoadRunner HD Map owned by "Map Author"
.
Data Types: char
| string
GeoReference
— Geographic coordinates of road network origin
row vector
Geographic coordinates of road network origin, specified as a row vector
of the form [lat
, lon
] with two
elements. lat
represents the latitude of the coordinates
in degrees and lon
represents the longitude of the
coordinates in degrees. These values are with respect to the WGS84 reference
ellipsoid, which is a standard ellipsoid used by GPS data. For more details,
see Coordinate Space and Georeferencing.
Data Types: double
GeographicBoundary
— Spatial bounds of geometric data
matrix
Spatial bounds of the geometric data represented in the 3D coordinate space of the RoadRunner HD Map projection, specified as a 2-by-3 matrix of double precision. The elements in the matrix represent the minimum and the maximum position of a 3D axis-aligned box.
Example: rrMap
=
roadrunnerHDMap
(Author
="Map
Author"
,
GeographicBoundary
=[-0.782 -3.13 0;101.565
50 0
]) creates a RoadRunner HD Map owned by "Map Author"
. The spatial
bounds of the geometric data in the 3D coordinate space of the map
projection is specified by the double precision values of the parameter
GeographicBoundary
.
Data Types: double
Lanes
— Lane properties of road
array of roadrunner.hdmap.Lane
objects
Lane properties of a road, specified as an array of roadrunner.hdmap.Lane
objects.
Example: rrMap.Lanes(1)
=
roadrunner.hdmap.Lane
(ID
="Lane1"
,
Geometry
=[-0.782 -1.56;50.78
23.43
], LaneType
="Driving"
,
TravelDirection
="Forward"
) adds
this information about the lanes for the map: lane id, coordinates defining
lane geometry, lane type, and driving direction.
SpeedLimits
— Speed limits of lanes
array of roadrunner.hdmap.SpeedLimit
objects
Speed limits of lanes in the map, specified as an array of roadrunner.hdmap.SpeedLimit
(Automated Driving Toolbox) objects.
Example: rrMap.SpeedLimits
=
roadrunner.hdmap.SpeedLimit
(ID
="SpeedLimit1"
)
adds a speed limit with ID "SpeedLimit1"
to the map.
LaneBoundaries
— Boundaries of lane
array of roadrunner.hdmap.LaneBoundary
objects
Boundaries of the lane, specified as an array of roadrunner.hdmap.LaneBoundary
objects.
Example: rrMap.LaneBoundaries(1)
=
roadrunner.hdmap.LaneBoundary
(ID
="LaneBoundary1"
,
Geometry
=[0 0;50 25
]) adds the
lane boundaries to the lane and defines the geometry for each lane
boundary.
LaneGroups
— Group of lanes with similar geometry
array of roadrunner.hdmap.LaneGroup
objects
Group of lanes with similar geometry, specified as an array of roadrunner.hdmap.LaneGroup
objects.
Example: rrMap.LaneGroups
=
roadrunner.hdmap.LaneGroup
(ID
="LaneGroup1"
)
adds a lane group with an id "LaneGroup1"
to the map.
LaneMarkings
— Lane marking definitions
array of roadrunner.hdmap.LaneMarking
objects
Lane marking definitions, specified as an array of roadrunner.hdmap.LaneMarking
objects.
Example: rrMap.LaneMarkings
=
roadrunner.hdmap.LaneMarking
(ID
="Dashed1"
,
AssetPath
="Assets/Markings/DashedSingleWhite.rrlms"
)
adds the "Dashed1"
lane marking asset from its relative
location to the lane.
Junctions
— Road junction
array of roadrunner.hdmap.Junction
objects
Road junctions in the map, specified as an array of roadrunner.hdmap.Junction
objects.
Example: rrMap.Junctions
=
roadrunner.hdmap.Junction
(ID
="Junction1"
)
adds a junction with id "Junction1"
to the
map.
BarrierTypes
— Barrier types for barrier extrusion and type information
array of roadrunner.hdmap.BarrierType
objects
Barrier types for barrier extrusion and type information, specified as an
array of roadrunner.hdmap.BarrierType
objects.
Example: rrMap.BarrierTypes
=
roadrunner.hdmap.BarrierType
(ID
="BarrierType1"
,
ExtrusionPath
=path
) adds a barrier
type with id "BarrierType1"
for a barrier extrusion with
the asset path, path
, pointing to the extrusion
information of this barrier type.
Barrier
— Barriers in map
array of roadrunner.hdmap.Barrier
objects
Barriers in the map, specified as an array of roadrunner.hdmap.Barrier
objects.
Example: rrMap.Barrier
=
roadrunner.hdmap.Barrier
(ID
="Barrier1"
)
adds a barrier with id "Barrier1"
to the
map.
SignTypes
— Sign types of sign features and type information
array of roadrunner.hdmap.SignType
objects
Sign types of sign features and type information, specified as an array of
roadrunner.hdmap.SignType
objects.
Example: rrMap.SignTypes
=
roadrunner.hdmap.SignType
(ID
="SignType1"
,
ExtrusionPath
=AssetPath="Assets/Signs/UK/Sign_Parking.svg"
)
adds a sign type with id "SignType1"
for a parking sign
located on the relative path
"Assets/Signs/UK/Sign_Parking.svg"
.
Signs
— Signs in map
array of roadrunner.hdmap.Sign
objects
Signs in the map, specified as an array of roadrunner.hdmap.Sign
objects.
Example: rrMap.Sign
=
roadrunner.hdmap.Sign
(ID
="Sign1"
)
adds a sign with id "Sign1"
to the map.
StaticObjectType
— Attributes of physical objects
array of roadrunner.hdmap.StaticObjectType
objects
Attributes of physical objects (includes road furniture and props),
specified as an array of roadrunner.hdmap.StaticObjectType
objects.
Example: rrMap.StaticObjectType
=
roadrunner.hdmap.StaticObjectType
(ID
="StaticObjectType1"
)
adds a static object type with id "StaticObjectType1"
to
the map.
StaticObject
— Static objects in map
array of roadrunner.hdmap.StaticObject
objects
Attributes of physical objects (includes road furniture and props),
specified as an array of roadrunner.hdmap.StaticObject
objects.
Example: rrMap.StaticObject
=
roadrunner.hdmap.StaticObject
(ID
="StaticObject1"
)
adds a static object with id "StaticObject1"
to the map.
StencilMarkingTypes
— Types and type information of stencil marking features
array of roadrunner.hdmap.StencilMarkingType
objects
Types and type information of stencil marking features, specified as an
array of roadrunner.hdmap.StencilMarkingType
(Automated Driving Toolbox) objects.
Example: rrMap.StencilMarkingTypes
=
roadrunner.hdmap.StencilMarkingType
(ID
="StencilMarkingType1"
,
AssetPath
="path"
) adds a stencil
marking type with ID "StencilMarkingType1"
for a stencil
marking located on the relative path
"path"
.
StencilMarkings
— Stencil markings in map
array of roadrunner.hdmap.StencilMarking
objects
Stencil markings in the map, specified as an array of roadrunner.hdmap.StencilMarking
(Automated Driving Toolbox) objects.
Example: rrMap.StencilMarkings
=
roadrunner.hdmap.StencilMarking
(ID
="StencilMarking1"
)
adds a stencil marking with ID "StencilMarking1"
to the
map.
CurveMarkingTypes
— Types and type information of curve marking features
array of roadrunner.hdmap.CurveMarkingType
objects
Types and type information of curve marking features, specified as an
array of roadrunner.hdmap.CurveMarkingType
(Automated Driving Toolbox) objects.
Example: rrMap.CurveMarkingTypes
=
roadrunner.hdmap.CurveMarkingType
(ID
="CurveMarkingType1"
,
AssetPath
="path"
) adds a curve
marking type with id "CurveMarkingType1"
for a curve
marking located on the relative path "path"
.
CurveMarkings
— Curve markings in map
array of roadrunner.hdmap.CurveMarking
objects
Curve markings in the map, specified as an array of roadrunner.hdmap.CurveMarking
(Automated Driving Toolbox) objects.
Example: rrMap.CurveMarkings
=
roadrunner.hdmap.CurveMarking
(ID
="CurveMarking1"
)
adds a curve marking with ID "CurveMarking1"
to the map.
Object Functions
Examples
Build a RoadRunner HD Map using Synthetic Data
Create a RoadRunner HD Map by calling the roadrunnerHDMap
object. The object returns a map with an author and spatial bounds of geometric data attributes.
rrMap = roadrunnerHDMap(Author="Map Author",GeographicBoundary=[-0.782 -3.13 0;101.565 50 0]);
Create the road lanes using the roadrunner.hdmap.Lane
object. Specify the lane information for the lane id, coordinates defining the lane geometry, driving direction, and lane type.
rrMap.Lanes(2) = roadrunner.hdmap.Lane(ID="Lane2",Geometry=[50.78 23.43;100.78 48.43],LaneType="Driving", TravelDirection="Forward"); rrMap.Lanes(1) = roadrunner.hdmap.Lane(ID="Lane1",Geometry=[0.782 -1.56;50.78 23.43],LaneType="Driving", TravelDirection="Forward");
Add connectivity information for Lane1
and Lane2
. Specify alignment between the lanes by defining information about their predecessor and successor relationship.
addPredecessor(rrMap.Lanes(2),"Lane1",Alignment="Forward"); addSuccessor(rrMap.Lanes(1),"Lane2",Alignment="Forward");
Create the lane boundaries of the road using the roadrunner.hdmap.LaneBoundary
object. Specify the lane boundary information for the lane id and the coordinates defining the lane geometry.
rrMap.LaneBoundaries(4) = roadrunner.hdmap.LaneBoundary(ID="LaneBoundary4",Geometry=[50 25; 100 50]); rrMap.LaneBoundaries(3) = roadrunner.hdmap.LaneBoundary(ID="LaneBoundary3",Geometry=[51.565 21.864; 101.565 46.869]); rrMap.LaneBoundaries(2) = roadrunner.hdmap.LaneBoundary(ID="LaneBoundary2",Geometry=[1.565 -3.13; 51.565 21.864]); rrMap.LaneBoundaries(1) = roadrunner.hdmap.LaneBoundary(ID="LaneBoundary1",Geometry=[0 0; 50 25]);
Link the lane boundaries to the lanes. Define the left and the right lane boundaries for each lane, and specify alignment between lanes and lane boundaries.
leftBoundary(rrMap.Lanes(1),"LaneBoundary1",Alignment="Forward"); rightBoundary(rrMap.Lanes(1),"LaneBoundary2",Alignment="Forward"); leftBoundary(rrMap.Lanes(2),"LaneBoundary4",Alignment="Forward"); rightBoundary(rrMap.Lanes(2),"LaneBoundary3",Alignment="Forward");
Version History
Introduced in R2022bR2024b: Specify speed limits for lanes
The roadrunnerHDMap
object now has the
SpeedLimits
property, which enables you to specify the
speed limit for a lane to a RoadRunner HD Map scene model.
R2024b: Add curve markings to RoadRunner HD Map scene model
The roadrunnerHDMap
object now has the
CurveMarkings
and CurveMarkingTypes
properties, which enable you to add curve marking objects to a RoadRunner HD Map scene model.
R2024b: Add stencil markings to RoadRunner HD Map scene model
The roadrunnerHDMap
object now has the
StencilMarkings
and
StencilMarkingTypes
properties, which enable you to add
stencil marking 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.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- 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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)