Main Content

hasNextMessage

Check ifIbeoData Container (IDC) file selection has next message

Description

example

flag= hasNextMessage(msgReader)checks if the IDC file selection has a subsequent message to read. This object function returnstrueif there is a next message available to read from theibeoMessageReaderobject,msgReader. Otherwise, it returnsfalse.

Examples

collapse all

Create anibeoFileReaderobject,ibeoReader, to read the message headers from the IDC file. Replace the placeholder argumentsample_data.idcwith the name of your IDC file assample_data.idcfile is not provided with the toolbox.

ibeoReader = ibeoFileReader('sample_data.idc')
ibeoReader = ibeoFileReader with properties: FileName: "C:/Documents/MATLAB/ibeo_data/sample_data.idc" StartTime: 15-Mar-2020 11:21:04.999434999 EndTime: 15-Mar-2020 11:25:35.030095000 Duration: 00:04:30 FileSummary: CAN 53 msgs [0x1002] scan 53 msgs [0x2205] object 106 msgs [0x2281] image 53 msgs [0x2403] vehicleState 53 msgs [0x2808] measurementList 53 msgs [0x2821] pointCloudPlane 53 msgs [0x7510] unsupported 53 msgs [0x6120] unsupported 53 msgs [0x6970]

Create anibeoMessageReaderobject,imgReader, to read all images in the first 2 minutes, by using theselectfunction with appropriate message type and time range values.

timeRange = [0, minutes(2)]; imgReader = select(ibeoReader,'image', timeRange);

Visualize the message data by reading the messages one at a time to a video player object. First, create avision.VideoPlayerobject. Then, use thehasNextMessagefunction to check whetherimgReadercontains a message after the current one. If it does, usereadNextMessagefunction to read the images into the workspace.

videoPlayer = vision.VideoPlayer;whilehasNextMessage(imgReader) img = readNextMessage(imgReader); step(videoPlayer,img);endrelease(videoPlayer);

Reset theibeoMessageReaderobject,imgReader, the first message in the selection, using theresetfunction.

reset(imgReader);

Input Arguments

collapse all

Message reader, specified as aibeoMessageReaderobject.

Output Arguments

collapse all

File selection has subsequent message to read, returned as a logicaltrueorfalse.

Version History

Introduced in R2021a