Hauptinhalt

getRoadBoundaries

Extract road boundaries from road surface data

Since R2025b

Description

lbsegment = getRodBoundaries(rsObj) extracts the road boundaries, as the lane boundary segment object lbsegment, from the road surface object rsObj.

Note

This feature 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.

example

Examples

collapse all

Load point cloud data and a road reference line into the workspace.

Note: The point cloud data must contain the road information for the specified road reference line.

data = load("roadSurfaceData.mat","ptCld","roadRefLine");
ptCld = data.ptCld;
roadRefLine = data.roadRefLine;

Specify the width of the road from the reference line as 4 meters on the left and 3 meters on the right.

roadWidthFromRefLine = [4 3];

Specify the resolution of the road surface as 1 cm each in the longitudinal and lateral directions.

gridResolution = [0.01 0.01];

Create a road surface object.

rsObj = roadSurface(ptCld,roadRefLine,roadWidthFromRefLine,gridResolution)
rsObj = 
  roadSurface with properties:

         RoadReferenceLine: [6×2 double]
         LateralResolution: 0.0100
    LongitudinalResolution: 0.0100
      RoadWidthFromRefLine: [4 3]
       InterpolationMethod: "nearest"
       ExtrapolationMethod: "nearest"
               LocalOrigin: []
    HasNormalizedElevation: 1

Visualize the road surface.

show(rsObj)

Extract road boundary information from the road surface data.

lbsegment = getRoadBoundaries(rsObj)
lbsegment = 
  laneBoundarySegment with properties:

       BoundaryIDs: [2×1 string]
    BoundaryPoints: {2×1 cell}
      BoundaryInfo: []
     NumBoundaries: 2
         NumPoints: 2001
      GeoReference: []

Plot the lane boundary segment object.

plot(lbsegment)

Input Arguments

collapse all

Road surface object, specified as a roadSurface object.

Output Arguments

collapse all

Road boundary information of the road surface, returned as a laneBoundarySegment object.

Version History

Introduced in R2025b