주요 콘텐츠

evaluate

Extract elevation values of road surface data for location queries

Since R2025b

Description

valueForQuery = evaluate(rsObj,xQuery,yQuery) extracts the elevation values of point cloud data from the road surface object rsObj for location queries specified by the x-location query xQuery and y-location query yQuery.

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)

Specify the x-locations and y-locations at which to query the road surface object.

xQuery = [1 2 3];
yQuery = [2 3 4];

Evaluate the elevation values for the query locations.

evaluate(rsObj,xQuery,yQuery)
ans = 1×3

    0.3918    0.5871    0.6382

Input Arguments

collapse all

Road surface object, specified as a roadSurface object.

x-location of points at which to query the elevation of the road surface, specified as an M-element vector. M is the number of query points.

The number of elements for xQuery and yQuery must be the same.

y-location of points at which to query the elevation of the road surface, specified as an M-element vector. M is the number of query points.

The number of elements for xQuery and yQuery must be the same.

Output Arguments

collapse all

Elevation values of the road surface at the query points, returned as an M-element vector. M is the number of query points. Units are in meters.

The evaluate 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.

Version History

Introduced in R2025b