Main Content

lidarParameters

Lidar sensor parameters

Description

A lidarParameters object stores the parameters of a lidar sensor. To convert unorganized point clouds into organized point clouds using the pcorganize function, you must specify these sensor parameters. For more information, see Lidar Sensor Parameters.

Creation

Description

example

params = lidarParameters(sensorName,horizontalResolution) returns the sensor parameters of the specified sensor sensorName as a lidarParameters object. horizontalResolution specifies the HorizontalResolution property. Use this syntax to load the parameters of a supported sensor. See Supported Sensors.

example

params = lidarParameters(verticalResolution,verticalFoV,horizontalResolution) stores parameters for a uniform beam configuration lidar sensor. The verticalResolution, verticalFoV, and horizontalResolution arguments set the VerticalResolution, VerticalFoV, and HorizontalResolution properties, respectively.

example

params = lidarParameters(verticalBeamAngles,horizontalResolution) stores parameters for a gradient beam configuration lidar sensor. The verticalBeamAngles and horizontalResolution arguments set the VerticalBeamAngles and HorizontalResolution properties, respectively.

params = lidarParameters(___,HorizontalFoV=horizontalFoV) specifies the horizontal field-of-view HorizontalFoV covered by the sensor in addition to any combination of input arguments from previous syntaxes.

Input Arguments

expand all

Name of a supported sensor, specified as a character vector or string scalar. Use this argument to load the parameters of a supported sensor. See Supported Sensors.

Number of channels in the horizontal direction, specified as a positive integer. Typical values include 512 and 1024.

Number of channels in the vertical direction, specified as a positive integer. Typical values include 32 and 64.

Vertical field-of-view of the lidar sensor, specified as a two-element vector.

Angular position of each vertical channel, specified as an N-element vector, in degrees. N is the verticalResolution of the sensor.

Properties

expand all

This property is read-only.

Number of channels in the horizontal direction, stored as a positive integer.

This property is read-only.

Horizontal field-of-view of the lidar sensor, stored as a positive scalar, in degrees.

Number of channels in the vertical direction, stored as a positive integer.

Vertical field-of-view of the lidar sensor, stored as a two-element vector, in degrees.

Horizontal angular resolution of the lidar sensor, stored as a positive scalar, in degrees.

Angular position of each horizontal channel, stored as an M-element vector, in degrees. M is the HorizontalResolution of the sensor.

Angular position of each vertical channel, stored as an N-element vector, in degrees. N is the VerticalResolution of the sensor.

Examples

collapse all

Load point cloud data into the workspace.

fileName = fullfile(toolboxdir("lidar"),"lidardata","lcc","HDL64", ...
                   "pointCloud","0001.pcd");
ptCloudUnorg = pcread(fileName);

Specify the horizontal resolution of the lidar sensor.

horizontalResolution = 1024;

Create a lidarParameters object that represents an HDL64E sensor with the specified horizontalResolution.

params = lidarParameters('HDL64E',horizontalResolution);

Convert the unorganized point cloud into an organized point cloud.

ptCloudOrg = pcorganize(ptCloudUnorg,params);

Display the dimensions of the input point cloud.

size(ptCloudUnorg.Location)
ans = 1×2

       37879           3

Display the size of the converted point cloud. pointCloud objects store organized point clouds as M-by-N-by-3 arrays, whereas they store unorganized point clouds as M-by-3 matrices

size(ptCloudOrg.Location)
ans = 1×3

          64        1024           3

Define lidar sensor parameters.

verticalFoV = [2 -24.69];
verticalResolution = 32;
horizontalResolution = 512;

Define a lidarParmaters object.

params = lidarParameters(verticalResolution,verticalFoV,...
                         horizontalResolution)
params = 
  lidarParameters with properties:

       HorizontalResolution: 512
         VerticalResolution: 32
                VerticalFoV: [2 -24.6900]
         VerticalBeamAngles: [2 1.1390 0.2781 -0.5829 -1.4439 -2.3048 ... ]
              HorizontalFoV: 360
    HorizontalAngResolution: 0.7045
       HorizontalBeamAngles: [0 0.7045 1.4090 2.1135 2.8180 3.5225 ... ]

Define vertical beam angles of the sensor. Refer the data handbook of the sensor to find the beam angles. To learn more about beam configuration, see Lidar Sensor Parameters.

verticalBeamAngles = [15.0000 3.0000 1.5000 0.8333 0.1667 -0.5000 ...
                       -1.1667 -1.8333 -2.5000 -3.1667 -3.8333 -4.5000 ...
                       -5.1667 -5.8333 -9.0000 -13.0000];

Define horizontal resolution of the sensor.

horizontalResolution = 512;

Define a lidarParmaters object.

params = lidarParameters(verticalBeamAngles,horizontalResolution)
params = 
  lidarParameters with properties:

       HorizontalResolution: 512
         VerticalResolution: 16
                VerticalFoV: [15 -13]
         VerticalBeamAngles: [15 3 1.5000 0.8333 0.1667 -0.5000 -1.1667 ... ]
              HorizontalFoV: 360
    HorizontalAngResolution: 0.7045
       HorizontalBeamAngles: [0 0.7045 1.4090 2.1135 2.8180 3.5225 ... ]

Introduced in R2021b