Main Content

reset

Reset hesaiFileReader object to first frame

Since R2022a

Description

example

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

Examples

collapse all

Download a ZIP file containing a Hesai packet capture (PCAP) file and then unzip the file.

zipFile = matlab.internal.examples.downloadSupportFile("lidar","data/hesai_BusyRoad.zip");
saveFolder = fileparts(zipFile);
pcapFileName = [saveFolder filesep 'hesai_BusyRoad.pcap'];
if ~exist(pcapFileName,"file")
    unzip(zipFile,saveFolder);
end

Create a hesaiFileReader object.

hesaiReader = hesaiFileReader(pcapFileName,"Pandar128E3X");

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

ptCloud = readFrame(hesaiReader,100);

Check the difference between the values of CurrentTime and StartTime.

disp(hesaiReader.CurrentTime - hesaiReader.StartTime)
   10 sec

Reset the hesaiFileReader object.

reset(hesaiReader);

Display the difference between the values of CurrentTime and StartTime.

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

Input Arguments

collapse all

Hesai file reader, specified as a hesaiFileReader object.

Version History

Introduced in R2022a