Main Content

select

Select subset of messages to read fromIbeoData Container (IDC) file

Description

Useselectobject function to specify a subset of messages to read from the IDC file based on message type, message ID or device ID. Theselectmethod returns anibeoMessageReaderobject which can be used to read the selected messages, from the IDC file. The supported values for message type and message ID are listed below. A Lidar Toolbox™ license is required to readscanandpointCloudPlanemessages.

Message Type Message ID Ibeo®Data Type Name
'scan' '0x2205' Ibeo FUSION SYSTEM/ECU scan data
'pointCloudPlane' '0x7510' Ibeo point cloud plane
'image' '0x2403' Ibeo FUSION SYSTEM/ECU image
'object' '0x2281' Ibeo FUSION SYSTEM/ECU object data
'vehicleState' '0x2808' Ibeo FUSION SYSTEM/ECU vehicle state
'measurementList' '0x2821' Ibeo FUSION SYSTEM/ECU measurement list
'CAN' '0x1002' Ibeo FUSION SYSTEM/ECU CAN messages

example

msgReader= select(ibeoReader,msgType)creates anibeoMessageReaderobject,msgReader, that can read all messages of type,msgType, present in anibeoFileReaderobject,ibeoReader.

msgReader= select(ibeoReader,msgID)creates anibeoMessageReaderobject,msgReader. that can read all messages with ID,msgID, present in anibeoFileReaderobject.

msgReader= select(___,timeRange)specifies a time range within which theibeoMessageReaderobject can read messages, in addition to any combination of arguments from previous syntaxes.

msgReader= select(___,'DeviceID',deviceID)specifies a device ID corresponding to which theibeoMessageReaderobject can read messages, in addition to any combination of arguments from previous syntaxes.

Examples

collapse all

Create anibeoFileReaderobject,ibeoReader, to read the message headers from an 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 twoibeoMessageReaderobjects,imgReaderandobjReader, to read all image and object detection messages in the first 2 minutes, respectively, by using theselectfunction with appropriate message type and time range values.

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

Read the first 10 images and all object detection messages in the first 2 minutes, by using thereadMessagesfunction on the respectiveibeoMessageReaderobjects with appropriateindicesandtimeRangearguments. Reading object detection messages returns both online objects and postprocessed objects along with their metadata.

imgs = readMessages(imgReader,1:10); [rawObjs,procObjs,rawMetadata,procMetadata] = readMessages(objReader);

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 whetherimgReader包含一个消息后. 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, to the first message in the selection, using theresetfunction.

reset(imgReader);

Input Arguments

collapse all

ibeoFileReaderobject, corresponding to the IDC file to be read.

Message type to read from the IDC file, specified as string scalar or character vector. SpecificmsgTypevalues correspond to Ibeo data types, as illustrated in the table.

Message ID of the message type to be read from the IDC file, specified as string scalar or character vector. SpecificmsgIDvalues correspond to Ibeo data types, as illustrated in the table.

Time range in which to read messages, specified as a duration or datetime vector of the form[startTime endTime]. IftimeRangeis a duration vector,startTimeandendTimeare relative to the start time specified by theStartTimeproperty ofibeoReader.

Device IDs of messages to read, specified as a scalar or vector of nonnegative integers. For a list of device IDs that you can select, see theDeviceIDcolumn of the table stored inFileSummaryproperty ofibeoReader.

Output Arguments

collapse all

Message reader, returned as anibeoMessageReaderobject. This object reads selected messages from the IDC file.

Version History

Introduced in R2021a