Main Content

lidarParameters

Lidar sensor parameters

Since R2021b

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

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.

example

params = lidarParameters(___,Name=Value) specifies properties using one or more name-value arguments, in addition to any combination of input arguments from previous syntaxes. For example, lidarParameters("HDL32E",horizontalResolution,SweepStartAngle=180) specifies the start angle of the sensor sweep as 180 degrees.

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.

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.

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

This property is read-only.

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

Note

You can specify this value at object creation as a name-value argument. For example, lidarParameters("HDL32E",horizontalResolution,HorizontalFoV=180) specifies the horizontal field-of-view covered by the sensor as 180 degrees. Otherwise, the function uses a default value of 360 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.

Start angle of the lidar sensor sweep, stored as a nonnegative scalar, in degrees. This value must be less than 360 degrees.

These are the typical values for SweepStartAngle.

  • For Velodyne Lidar sensors the typical value is 90 degrees.

  • For Ouster® sensors, the typical value is:

    • 0 degrees when the point cloud is in the sensor coordinate system with the origin at sensor center.

    • 180 degrees when the point cloud is in the sensor coordinate system with the origin at sensor base.

Note

You can specify this value at object creation as a name-value argument. For example, lidarParameters("HDL32E",horizontalResolution,SweepStartAngle=180) specifies the start angle of the sensor sweep as 180 degrees. Otherwise, the function uses a default value of 0.

Direction of sensor rotation, specified as a logical 1 (true) or 0. A logical 1 indicates clockwise rotation and a logical 0 indicates anti-clockwise rotation.

Most sensors typically have clockwise rotation.

Note

You can specify this value at object creation as a name-value argument. For example, lidarParameters("HDL32E",horizontalResolution,RotateClockwise=0) specifies anti-clockwise sensor rotation. Otherwise, the function uses a default value of 1, or clockwise rotation.

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 and a sweep start angle of 10 degrees.

params = lidarParameters('HDL64E',horizontalResolution,SweepStartAngle=10);

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 -3.1658 -4.0268 -4.8877 -5.7487 -6.6097 -7.4706 -8.3316 -9.1926 -10.0535 -10.9145 -11.7755 -12.6365 -13.4974 -14.3584 -15.2194 -16.0803 -16.9413 -17.8023 -18.6632 ... ] (1x32 double)
              HorizontalFoV: 360
    HorizontalAngResolution: 0.7031
       HorizontalBeamAngles: [0 0.7031 1.4062 2.1094 2.8125 3.5156 4.2188 4.9219 5.6250 6.3281 7.0312 7.7344 8.4375 9.1406 9.8438 10.5469 11.2500 11.9531 12.6562 13.3594 14.0625 14.7656 15.4688 16.1719 16.8750 17.5781 18.2812 18.9844 ... ] (1x512 double)
            SweepStartAngle: 0
            RotateClockwise: 1

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 -1.8333 -2.5000 -3.1667 -3.8333 -4.5000 -5.1667 -5.8333 -9 -13]
              HorizontalFoV: 360
    HorizontalAngResolution: 0.7031
       HorizontalBeamAngles: [0 0.7031 1.4062 2.1094 2.8125 3.5156 4.2188 4.9219 5.6250 6.3281 7.0312 7.7344 8.4375 9.1406 9.8438 10.5469 11.2500 11.9531 12.6562 13.3594 14.0625 14.7656 15.4688 16.1719 16.8750 17.5781 18.2812 18.9844 ... ] (1x512 double)
            SweepStartAngle: 0
            RotateClockwise: 1

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2021b

expand all