Main Content

roadrunnerStaticObjectInfo

Generate static object and sign information in RoadRunner HD Map format

Since R2023a

Description

example

staticObjectInfo = roadrunnerStaticObjectInfo(staticObjectCuboids) generates static object, static object type, sign, and sign type information in RoadRunner HD Map format from parametric cuboid models of static objects and signs.

example

staticObjectInfo = roadrunnerStaticObjectInfo(staticObjectCuboids,Params=params) specifies additional parameters, such as the file path of a RoadRunner asset.

Note

This function requires the Scenario Builder for Automated Driving Toolbox™ support package. You can install the Scenario Builder for Automated Driving Toolbox support package from the Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.

Examples

collapse all

Generate static object information in the RoadRunner HD Map format by using the cuboid parameters for trees and buildings extracted from data in the MATLAB® workspace. Load a MAT file containing static object data into the workspace. The data contains cuboid parameters for buildings, trees, cones, and pylons.

load("staticObjectsData.mat")

Extract the parameters for buildings and trees.

staticObjectCuboids.buildings = cuboids{1}; 
staticObjectCuboids.trees = cuboids{2};

Specify the file path to additional RoadRunner building parameter information, and the threshold at which to merge overlapping cuboids into a single cuboid.

params.buildings.AssetPath = ...
fullfile("Assets","Buildings","Downtown_9mX14m_01_1storey.fbx_rrx");
params.buildings.OverlapThreshold = 0.7;

Specify the file path to additional RoadRunner tree asset parameter information.

params.trees.AssetPath = ...
fullfile("Assets","Props","Trees","CalPalm_Trim_Med01.fbx_rrx");

Using cuboid parameters, generate static object information in the RoadRunner HD Map scene format.

objectsInfo = roadrunnerStaticObjectInfo(staticObjectCuboids, ...
    params=params);

Create an empty RoadRunner HD Map by using the roadrunnerHDMap object.

rrMap = roadrunnerHDMap;

Add the generated static object information to the RoadRunner HD Map object.

rrMap.StaticObjectTypes = objectsInfo.staticObjectTypes;
rrMap.StaticObjects = objectsInfo.staticObjects;

Input Arguments

collapse all

Parametric cuboid model of a static object, specified as a structure with one or more of these fields:

  • buildings

  • trees

  • bushes

  • barricades

  • cones

  • pylons

  • electricPoles

  • signs

  • signPosts

  • miscellaneousObjects

The signs field is a structure that contains a field for each type of sign you specify, such as stop, yield, stopHereForPedestrians, yieldHereToPedestrians, pedestrianCrossingAhead and miscellaneousSigns. For a full list of sign fields, see Default Asset Paths for Signs.

Each field of the structure, and of the signs structure, contains an M-by-9 matrix. M is the number of static objects of the type specified by that field. Each row of the matrix specifies a cuboid model of a static object using the form [xctr yctr zctr xlen ylen zlen xrot yrot zrot].

  • xctr, yctr, and zctr specify the center coordinates of the cuboid.

  • xlen, ylen, and zlen specify the length of the cuboid, in meters, along the x-, y-, and z-axes, respectively, before rotation has been applied.

  • xrot, yrot, and zrot specify the rotation angles, in degrees, for the cuboid along the x-, y-, and z-axes, respectively. These angles are clockwise-positive when looking in the forward direction of their corresponding axes.

This figure shows how these values determine the position of a cuboid. All parameters are in the world coordinate system.

Data Types: struct

Additional parameters of a static object, specified as a structure. The fields of the structure must match the fields of the staticObjectCuboids structure.

The value of each field is a structure with these fields:

  • AssetPath — Asset file path relative to RoadRunner project directory, specified as one of these options:

    • String scalar — Specify the same asset file path for all instances of a specific type of static object.

    • M-element cell array of strings — Specify separate asset file paths for M number of static objects of the specified type.

    For more information on default asset paths for static objects, see Default Asset Paths for Static Objects. For more information on default asset paths for signs, see Default Asset Paths for Signs.

  • OverlapThreshold — Threshold at which to merge overlapping cuboids into a single cuboid, specified as a numeric scalar in the range (0, 1], where 1 indicates a complete overlap. The default value is NaN for each static object. The function does not support merging cuboids of static objects with different asset file paths.

    The function computes the overlap ratio as the volume of intersection between two cuboids, divided by the minimum volume of the two cuboids. If the overlap ratio is greater than the specified threshold, then the function merges the two cuboids into a single cuboid.

    Note

    To specify the OverlapThreshold parameter, you must have a license for Lidar Toolbox™.

Data Types: struct

Output Arguments

collapse all

Information of static objects in the RoadRunner HD map format, returned as a structure with these fields:

If you specify cuboid parameters for signs in the input, then the function returns the structure with these additional fields:

More About

collapse all

Default Asset Paths for Static Objects

This table defines the default asset path for each type of static object:

Type of Static ObjectDefault Asset File Path
buildings"Assets/Buildings/Downtown_8mX15m_01_4storey.fbx_rrx"
trees"Assets/Props/Trees/Eucalyptus_Lg03.fbx_rrx"
bushes"Assets/Props/Trees/Bush_Sm06.fbx_rrx"
cones"Assets/Props/TrafficControl/TrafficCone01.fbx"
pylons"Assets/Props/TrafficControl/StripeSign01.fbx_rrx"
barricades"Assets/Props/Construction/Barricade02.fbx_rrx"
electricPoles"Assets/Assemblies/ElectricPoles02.rrpa_rrx"
signPosts"Assets/Props/Signals/SignPost_8ft.fbx_rrx"
miscellaneousObjects

None

Note

You must specify a valid asset file path for miscellaneous static objects.

Default Asset Paths for Signs

This table defines the default asset path for each type of sign:

Type of SignDefault Asset File Path
stop"Assets/Signs/US/Regulatory Signs/Sign_R1-1.svg_rrx"
yield"Assets/Signs/US/Regulatory Signs/Sign_R1-2.svg_rrx"
stopHereForPedestrians"Assets/Signs/US/Regulatory Signs/Sign_R1-5b.svg_rrx"
yieldHereToPedestrians"Assets/Signs/US/Regulatory Signs/Sign_R1-5.svg_rrx"
pedestrianCrossingAhead"Assets/Signs/US/Warning Signs/Sign_PedestrianCrossingAhead.svg_rrx"
schoolZoneAhead"Assets/Signs/US/School Signs/Sign_S1-1.svg_rrx"
leftDiagonalArrow"Assets/Signs/US/Warning Signs/Sign_W16-7P_L_03.svg_rrx"
rightDiagonalArrow"Assets/Signs/US/Warning Signs/Sign_W16-7P_R_03.svg_rrx"
parking"Assets/Signs/UK/Sign_Parking.svg_rrx"
noParking"Assets/Signs/US/Regulatory Signs/Sign_R8-3.svg_rrx"
leftOrUTurn"Assets/Signs/US/Regulatory Signs/Sign_LeftOrUTurn.svg_rrx"
noLeftOrUTurn"Assets/Signs/US/Regulatory Signs/Sign_NoUOrLeftTurn.svg_rrx"
leftTurnAhead"Assets/Signs/Japan/Warning Signs/Sign_TurnLeft.svg_rrx"
noLeftTurn"Assets/Signs/US/Regulatory Signs/Sign_R3-2.svg_rrx"
rightTurnAhead"Assets/Signs/Japan/Warning Signs/Sign_203.svg_rrx"
noRightTurn"Assets/Signs/US/Regulatory Signs/Sign_R3-1.svg_rrx"
noUTurn"Assets/Signs/US/Regulatory Signs/Sign_R3-4.svg_rrx"
roundabout"Assets/Signs/US/Regulatory Signs/Sign_R6-5P.svg_rrx"
speedLimit"Assets/Signs/US/Regulatory Signs/Sign_R2-1(60).svg_rrx"
keepLeft"Assets/Signs/US/Regulatory Signs/Sign_R4-8a.svg_rrx"
keepRight"Assets/Signs/US/Regulatory Signs/Sign_R4-7a.svg_rrx"
noEntry"Assets/Signs/US/Regulatory Signs/Sign_R5-1.svg_rrx"
twoWayTraffic"Assets/Signs/US/Warning Signs/Sign_TwoWayTraffic.svg_rrx"
oneWayTraffic"Assets/Signs/UK/Sign_OneWayTraffic01.svg_rrx"
dividedHighwayAhead"Assets/Signs/US/Warning Signs/Sign_W6-1_01.svg_rrx"
dividedHighwayEnds"Assets/Signs/US/Warning Signs/Sign_W6-2_01.svg_rrx"
leftLaneEnds"Assets/Signs/US/Warning Signs/Signs_W4-2_01 Reversed.svg_rrx"
rightLaneEnds"Assets/Signs/US/Warning Signs/Sign_W4-2_01.svg_rrx"
roadNarrowsAhead"Assets/Signs/US/Warning Signs/Signs_One lane road or road narrows NY.svg_rrx"
mergeLeftAhead"Assets/Signs/US/Warning Signs/Signs_W4-1 01 Reversed.svg_rrx"
mergeRightAhead"Assets/Signs/US/Warning Signs/Sign_W4-1_01.svg_rrx"
railRoadCrossingAhead"Assets/Signs/US/Warning Signs/Sign_RailroadCrossingAhead.svg_rrx"
noTrucks"Assets/Signs/US/Regulatory Signs/Sign_R5-2.svg_rrx"
noStopping"Assets/Signs/UK/Sign_NoStopping.svg_rrx"
exit"Assets/Signs/US/Expressway Signs/Sign_E8-4.svg_rrx"
noPedestrians"Assets/Signs/US/Regulatory Signs/Sign_R9-3.svg_rrx"
noBikes"Assets/Signs/US/Regulatory Signs/Sign_R5-6.svg_rrx"
bikeLaneAhead"Assets/Signs/US/Warning Signs/Sign_W11-1.svg_rrx"
slipperyRoadAhead"Assets/Signs/US/Warning Signs/Sign_W8-5_01.svg_rrx"
windingRoadAhead"Assets/Signs/US/Warning Signs/Sign_WindingRoadAhead.svg_rrx"
sideRoadLeftAhead"Assets/Signs/US/Warning Signs/Signs_W2-2 Reversed.svg_rrx"
sideRoadRightAhead"Assets/Signs/US/Warning Signs/Sign_W2-2.svg_rrx"
crossRoadAhead"Assets/Signs/US/Warning Signs/Sign_W2-1.svg_rrx"
tIntersectionAhead"Assets/Signs/US/Warning Signs/Sign_TIntersectionAhead.svg_rrx"
yIntersectionAhead"Assets/Signs/US/Warning Signs/Sign_YIntersectionAhead.svg_rrx"
noOvertaking"Assets/Signs/UK/Sign_NoOvertaking.svg_rrx"
slowDown"Assets/Signs/US/Regulatory Signs/Sign_R1-8.svg_rrx"

Version History

Introduced in R2023a

expand all