Main Content

ousterROSMessageReader

Read Ouster ROS messages

Since R2024a

Description

The ousterROSMessageReader object reads point cloud data from PacketMsg ROS messages, collected from a Ouster® lidar sensor. To read this point cloud data into the workspace as point cloud object, use the object function. To check for additional point clouds in the message set, use the object function.

Creation

Description

ousterReader = ousterROSMessageReader(msgs,calibrationFile) creates a Ouster ROS message reader object for a set of PacketMsg ROS messages msgs created from raw Ouster lidar data messages in a specified calibration JSON file calibrationFile.

ousterReader = ousterROSMessageReader(msgs,calibrationFile,Name=Value) specifies options using one or more name-value arguments in addition to any combination of arguments from previous syntaxes.

Input Arguments

expand all

Ouster scan ROS messages, specified as a cell array of PacketMsg message objects or a structure array. The message type is ouster_ros/PacketMsg. This argument sets the OusterMessages property.

Calibration JSON file, specified as a string.

A calibration file for Ouster lidar data holds crucial parameters and adjustment values utilized to convert initial sensor readings into precise 3D point cloud data. This file plays a vital role in the data processing sequence, guaranteeing that the lidar data is appropriately modified and matched to real-world coordinates.

If you do not specify a calibration file, the reader selects a default calibration file containing data from the Ouster device manual.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: (SkipPartialFrames=true) returns an organized point cloud.

Partial frame processing, specified as a numeric or logical1 (true) or 0 (false). Set this property to true to skip partial frames from the set of PacketMsg ROS messages.

Partial frames refer to frames that have a horizontal field of view smaller than the average horizontal field of view of all frames within the ROS Messages.

Data Types: logical | numeric

Example: ousterFileReader(fileName,calibrationFile,SkipPartialFrames=false) creates an Ouster file reader that does not skip partial frames.

Coordinate frame for point cloud data, specified as one of these options:

  • "center" – Origin of the coordinate frame is at the center of the sensor.

  • "base" – Origin of the coordinate frame is at the base of the sensor.

Example: ousterFileReader(fileName,calibrationFile,CoordinateFrame="center") sets the origin of the coordinate frame at the center of the sensor.

Properties

expand all

This property is read-only.

Raw Ouster ROS messages, specified as a cell array of VelodyneScan message objects or structure array. The ROS messages are of type ouster_ros/PacketMsg.

Data Types: struct | cell array

This property is read-only.

Name of Ouster calibration JSON file, specified as a string.

If you do not specify a calibration file, the reader selects a default calibration file containing data from the Ouster device manual.

Data Types: string

This property is read-only.

Number of point cloud frames in the file, specified as a positive integer.

Data Types: double

This property is read-only.

Total duration of the bag messages, specified as a duration scalar, in seconds.

This property is read-only.

Timestamp of the first point cloud, specified as a duration scalar in seconds.

Start and end times are specified relative to the previous whole hour. For instance, if the file is recorded for 7 minutes from 13:58 to 14:05, then:

  • StartTime = 58 min = 3480 s

  • EndTime = StartTime + 7 min = 65 min = 3900 s

This property is read-only.

Timestamp of the last point cloud reading, specified as a duration scalar, in seconds.

Start and end times are relative to the whole hour. For example, if the data is recorded over the 7 minutes from 1:58 PM to 2:05 PM, then:

  • StartTime = 58 min = 3840 s

  • EndTime = StartTime + 7 min = 65 min = 3900 s

This property is read-only.

Timestamps of the point cloud frames in seconds, specified as a duration vector, representing the capture start time of all frames. The length of the vector is equal to the value of the NumberOfFrames property. The value of the first element in the vector is the same as that of the StartTime property. You can use this property to read point cloud frames captured at different times.

For example, read the timestamp of a point cloud frame from the Timestamps property. Use the start time as an input for the readFrame object function to read the corresponding point cloud frame.

ousterReader = ousterROSMessageReader(msgs,'')
frameTime = ousterReader.Timestamps(10);
ptCloud = readFrame(ousterReader,frameTime);

Timestamp of the current point cloud reading, specified as a duration scalar, in seconds. As you read point clouds using the readFrame object function, the object updates this property with the most recently read point cloud. You can use the reset object function to reset this property to the default value. The default value matches the StartTime property.

Object Functions

hasFrameDetermine if another Ouster point cloud is available in the ROS messages
readFrameRead Ouster point cloud frame from ROS message
resetReset CurrentTime property of ousterROSMessageReader object to default value

Tips

  • Not providing a calibration file can lead to inaccurate results.

Version History

Introduced in R2024a