Main Content

reset

Reset ousterFileReader object to first frame

Since R2022a

Description

example

reset(ousterReader) resets the Ouster® file reader object ousterReader to the first frame by resetting its CurrentTime property to the default value. The default value is the value of the StartTime property of ousterReader.

Examples

collapse all

Download a ZIP file containing an Ouster packet capture (PCAP) file and the corresponding calibration file, and then unzip the file.

zipFile = matlab.internal.examples.downloadSupportFile("lidar", "data/ouster_RoadIntersection.zip");
saveFolder = fileparts(zipFile);
pcapFileName = [saveFolder filesep 'ouster_RoadIntersection' filesep 'ouster_RoadIntersection.pcap'];
calibFileName = [saveFolder filesep 'ouster_RoadIntersection' filesep 'OS1-128U.json'];
if ~(exist(pcapFileName,"file") && exist(calibFileName,"file"))
    unzip(zipFile,saveFolder);
end

Create an ousterFileReader object.

ousterReader = ousterFileReader(pcapFileName,calibFileName);

Read the 100th point cloud from the Ouster PCAP file.

ptCloud = readFrame(ousterReader,100);

Check the difference between the values of CurrentTime and StartTime.

disp(ousterReader.CurrentTime - ousterReader.StartTime)
   9.9977 sec

Reset the ousterFileReader object.

reset(ousterReader);

Display the difference between the values of CurrentTime and StartTime.

disp(ousterReader.CurrentTime - ousterReader.StartTime)
   0 sec

Input Arguments

collapse all

Ouster file reader, specified as an ousterFileReader object.

Version History

Introduced in R2022a