メインコンテンツ

getCurvedGridPointCloud

Extract curved regular grid of road surface data as point cloud object

Since R2025b

Description

crgPtCld = getCurvedGridPointCloud(rsObj) extracts the curved regular grid of the road surface as a point cloud object 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)

Create a point cloud object from the road surface data.

crgPtCld = getCurvedGridPointCloud(rsObj)
crgPtCld = 
  pointCloud with properties:

     Location: [2001×701×3 single]
        Count: 1402701
      XLimits: [0 20]
      YLimits: [-4 3]
      ZLimits: [-1.1488 1.1247]
        Color: []
       Normal: []
    Intensity: []

Plot the point cloud object.

pcshow(crgPtCld)

Input Arguments

collapse all

Road surface object, specified as a roadSurface object.

Output Arguments

collapse all

Point cloud object created from the road surface object, returned as a pointCloud object.

The getCurvedGridPointCloud object function returns the normalized elevation or the raw elevation of the road surface based on the value of the HasNormalizedElevation property of the input road surface object rsObj. If HasNormalizedElevation is true, the function returns the normalized elevation. If HasNormalizedElevation is false, the function returns the raw elevation.

Tips

  • To create an OpenCRG mesh from the returned point cloud object, use the pc2surfacemesh (Lidar Toolbox) function.

Version History

Introduced in R2025b