pc2scan
Description
specifies options using one or more name-value arguments. For example,
scan
= pc2scan(ptCloudIn
,Name=Value
)pc2scan(ptCloudIn,ElevationAngleTolerance=5)
selects points with
elevation angles in the range [-5
, 5
] degrees to
generate the scan.
Examples
Input Arguments
Output Arguments
Algorithms
The function follows these steps to convert a point cloud into a 2-D lidar scan.
Converts the input point cloud to the 2-D lidar sensor coordinate system using the specified transformation
tform
. If you do not specifytform
, the function assumes the data is in the sensor coordinate system.Projects the points on the xy-plane. For each projected point, the function computes the angle and range. The angle is counter-clockwise positive along the x-axis, and the range is the distance from the origin.
Selects the points whose angle and range are within the specified
ScanAngleLimits
andScanRangeLimits
, respectively.Selects the points whose elevation angle is within the specified
ElevationAngleTolerance
.Computes the scan line index for each point from the measured angle. The function assigns a scan angle to each scan line, starting from the first scan line and assigning it the value of the first element of
ScanAngleLimits
. The function then increments the angle in steps of the specifiedScanAngleResolution
to the remaining scan lines.By default, each scan line index has the maximum range. For multiple scan lines with same index, the function assigns the range value of the point closest to the origin.
Generates the 2-D lidar scan using the scan angles and the range values.