Main Content

hasFrame

Determine if another Velodyne point cloud is available

Description

example

isAvailable = hasFrame(veloReader) determines if another point cloud is available in the packet capture (PCAP) file of the input Velodyne® file reader. As you read point clouds using readFrame, the point clouds are read sequentially until this function returns false.

Examples

collapse all

Create a velodyneFileReader object to read a Velodyne® packet capture (PCAP) file and check for available frames using hasFrame.

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

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

Check if the file reader has a point cloud to read.

disp(hasFrame(veloReader));
   1

Read the last frame of the file.

ptCloudObj = readFrame(veloReader,veloReader.NumberOfFrames);

Check again if the file reader has another point cloud available.

disp(hasFrame(veloReader));
   0

Input Arguments

collapse all

Velodyne file reader, specified as a velodyneFileReader object.

Output Arguments

collapse all

Indicator if frame is available, returned as true or false.

Introduced in R2018a