Main Content

readFrame

ReadVelodynepoint cloud from file

Description

ptCloud= readFrame(veloReader)reads the next point cloud in sequence from the Velodyne®PCAP file and returns apointCloudobject.

ptCloud= readFrame(veloReader,frameNumber)reads the point cloud with the specific frame number from the file.

example

ptCloud= readFrame(veloReader,frameTime)reads the first point cloud recorded at or after the givenframeTime.

Examples

collapse all

Create avelodyneFileReaderobject to read a Velodyne® packet capture (PCAP) file and select specific point clouds using adurationscalar.

Read in point clouds by using a Velodyne® file reader. Specify the PCAP file to read and the Velodyne® device model.

veloReader = velodyneFileReader('lidarData_ConstructionRoad.pcap','HDL32E');

Create adurationscalar that represents three seconds after the first point cloud reading.

timeDuration = veloReader.StartTime + duration(0,0,3,'Format','s');

Read the first point cloud recorded at or after the given time duration.

ptCloudObj = readFrame(veloReader,timeDuration);

Display the point cloud usingpcshow.

figure pcshow(ptCloudObj)

Figure contains an axes. The axes contains an object of type scatter.

Input Arguments

collapse all

Velodyne file reader, specified as avelodyneFileReaderobject.

Frame number of the desired point cloud in file, specified as a positive integer. Frame numbers are sequential.

Frame time of the desired point cloud in the file, specified as adurationscalar in seconds. The first frame available at or afterframeTimeis given.

Output Arguments

collapse all

Point cloud, returned as apointCloudobject.

Introduced in R2018a