Contenuto principale

exportToASAMOpenCRG

Export road surface object to ASAM OpenCRG format

Since R2025b

Description

exportToASAMOpenCRG(rsObj,filename) exports the road surface object rsObj to an ASAM OpenCRG® file, filename.

example

exportToASAMOpenCRG(rsObj,filename,Filetype=filetype) specifies the ASAM OpenCRG file type filetype to which to export the data.

crgStruct = exportToASAMOpenCRG(___) additionally returns a structure crgStruct that contains the parameters required to represent a ASAM OpenCRG file.

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

Export the road surface object to an ASAM OpenCRG file.

exportToASAMOpenCRG(rsObj,"exportedRoadSurface.crg")

Input Arguments

collapse all

Road surface object, specified as a roadSurface object.

ASAM OpenCRG filename, specified as a string scalar or a character vector.

You can specify filename as the absolute or relative path on which to save a file with the .crg extension. For example, to save the file myFile.crg in your current folder, C:\myFolder, you can specify the ASAM OpenCRG file as "myFile.crg" or "C:\myFolder\myFile.crg".

Data Types: string | char

Type of ASAM OpenCRG file to export, specified as one of these types.

  • "KRBI" — Specifies a binary data format for the ASAM OpenCRG file. For more information on the KRBI data format, see the 4.4.4 section of the ASAM OpenCRG Version 1.2.0 document.

  • "LRFI" — Specifies a human-readable, plain-text data format for the ASAM OpenCRG file. For more information on the LRFI data format, see the 4.4.4 section of the ASAM OpenCRG Version 1.2.0 document.

Data Types: string | char

Output Arguments

collapse all

ASAM OpenCRG creation parameters, returned as a structure. You can use the structure to visualize CRG data using ASAM OpenCRG library. For more information on the ASAM OpenCRG library, see ASAM OpenCRG.

Version History

Introduced in R2025b