Contenuto principale

show

Display road surface from road surface object

Since R2025b

Description

show(rsObj) displays the road surface specified by the road surface object rsObj.

example

show(rsObj,Name=Value) specifies options using one or more name-value arguments. For example, ShowColorbar=true displays the road surface with a color bar.

figHandle = show(___) returns a figure handle as a Figure object using any combination of input arguments from previous syntaxes.

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.

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)

Input Arguments

collapse all

Road surface object, specified as a roadSurface object.

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: show(rsObj,ShowColorbar=true) displays the road surface with a color bar.

Display color bar, specified as a logical 1 (true) or 0 (false). Specify true to display a color bar representing the elevation of the road surface. Otherwise, specify false.

Data Types: logical

Size of the road segment for visualization, specified as a scalar in the range (0, 1]. By default, the function displays the complete road. This value represents the proportion of the road to display. For example, 0.5 specifies to display half of the road.

Data Types: double

Parent figure, specified as a Figure object. If you do not specify Parent, the function plots the road surface data in a new figure.

Output Arguments

collapse all

Figure handle, returned as a Figure object. You can use the figure handle to query and modify figure properties. For more information, see Figure.

Tips

The show object function displays 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 displays the normalized elevation. If HasNormalizedElevation is false, the function displays the raw elevation.

Version History

Introduced in R2025b