Main Content

ousterlidar

Stream point clouds from Ouster lidar sensor

Since R2022a

    Add-On Required: This feature requires the Lidar Toolbox Support Package for Ouster Lidar Sensors add-on.

    Description

    The ousterlidar object can stream point cloud data from an Ouster® lidar sensor. Using this object, you can read and preview the incoming point clouds.

    Creation

    Description

    ousterObj = ousterlidar creates an ousterlidar object, ousterObj, that can stream point cloud data from the Ouster lidar sensor. This syntax is valid only if the firmware version of your Ouster sensor is 2.4 or above.

    example

    ousterObj = ousterlidar(calibrationFile) creates an ousterlidar object, ousterObj, that can stream point cloud data from the Ouster lidar sensor specified using the calibration JSON file.

    example

    ousterObj = ousterlidar(___,Name=Value) specifies options using one or more name-value arguments. For example, ousterlidar(Port=7503) specifies the data port of the Ouster lidar sensor as 7503.

    example

    Input Arguments

    expand all

    Ouster lidar sensor calibration JSON file, specified as a character vector or string scalar. You must specify the full file path if the calibration file is not in your MATLAB® path. If the firmware version of your Ouster sensor is lower than 2.4, you must use this argument at object creation to set the CalibrationFile property. If the firmware version of your sensor is 2.4 or above, this argument is optional.

    Data Types: char | string

    Name-Value Arguments

    expand all

    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.

    Example: ousterlidar(Port=7503) specifies the data port of the Ouster lidar sensor as 7503.

    Data port of the Ouster lidar sensor, specified as a positive scalar. The data port for your sensor is listed in the Ouster sensor web interface Data Port field. Use this name-value argument to set the Port property when creating the object.

    Data Types: double

    Maximum time to wait for a response from the Ouster lidar sensor, specified as a positive scalar. Units are in seconds. Use this name-value argument to set the Timeout property.

    Data Types: double

    Properties

    expand all

    This property is read-only.

    Model name of the Ouster sensor, represented as a character vector. The object supports these models:

    Model ValueOuster Model

    'OS1-16' (since R2025a)

    OS1-16 sensor
    'OS0-32'OS0-32 sensor
    'OS1-32'OS1-32 sensor
    'OS2-32'OS2-32 sensor

    'OSDome-32' (since R2025a)

    OS Dome-32 sensor
    'OS0-64'OS0-64 sensor
    'OS1-64'OS1-64 sensor
    'OS2-64'OS2-64 sensor

    'OSDome-64' (since R2025a)

    OS Dome-64 sensor
    'OS0-128'OS0-128 sensor
    'OS1-128'OS1-128 sensor
    'OS2-128'OS2-128 sensor

    'OSDome-128' (since R2025a)

    OS Dome-64 sensor

    Data Types: char

    This property is read-only.

    IP address of the Ouster lidar sensor, represented as a character vector. This value is set by the incoming UDP packets from the sensor.

    Data Types: char

    This property is read-only after object creation. To set this property, you must specify it using the Port name-value argument at object creation.

    Data port of the Ouster lidar sensor, specified as a positive scalar. The data port for your sensor is listed in the Ouster sensor web interface Data Port field.

    Data Types: double

    This property is read-only.

    Number of point clouds available for streaming in the buffer, represented as a positive scalar. This value is set by the object buffer.

    Data Types: double

    This property is read-only after object creation. To set this property, you must specify it using the calibrationFile input argument at object creation.

    Ouster lidar sensor calibration JSON file, specified as a character vector or string scalar. You must specify the full file path if the calibration file is not in your MATLAB path.

    Data Types: char | string

    Maximum time to wait for a response from the Ouster lidar sensor, specified as a positive scalar. Units are in seconds.

    Data Types: double

    This property is read-only.

    Sensor streams data, represented as a logical 0(false) or 1(true). The value is 1 if the object receives streaming data from the sensor. You can use the start and stop functions to control data streaming.

    Data Types: logical

    This property is read-only.

    Return modes of the point cloud data stored in the file, represented as {'strongest'}, {'farthest'}, {'nearest'}, {'strongest','weakest'}, {'farthest','nearest'}, or {'nearest','farthest'}.

    This property is read-only.

    Firmware version of the Ouster sensor, represented as a character vector. For more information on supported firmware versions, see Release-by-Release Version Support.

    Data Types: char

    This property is read-only.

    Lidar data packet format, represented as one of these values.

    • 'LEGACY' — Legacy data packet format.

    • 'RNG19_RFL8_SIG16_NIR16' — Single return profile that is similar to the channel data block present in the 'LEGACY' format.

    • 'RNG19_RFL8_SIG16_NIR16_DUAL'— Dual return profile that enables the sensor to output up to two lidar returns.

    • 'RNG15_RFL8_NIR8' — Single return profile with low data rate and small data packet size.

    • 'FUSA_RNG15_RFL8_NIR8_DUAL' — Dual return profile with low data rate and small data packet size. (since R2025a)

    For more information on the data profiles, see the Sensor Data section in the Ouster Firmware User Manual.

    Data Types: char

    Object Functions

    previewPreview live point cloud data from Ouster lidar sensor
    closePreviewClose preview of live point cloud data from Ouster lidar sensor
    startStart streaming point clouds from Ouster lidar sensor
    flushDelete point clouds from ousterlidar object buffer
    readRead point clouds from ousterlidar object buffer
    stopStop streaming point clouds from Ouster lidar sensor

    Examples

    collapse all

    Specify the file path of the calibration file of an Ouster lidar sensor to create an ousterlidar object, obj. The output shows the object properties.

    obj = ousterlidar("C:\ouster\OS0-64G_sample.json")
    obj = 
       ousterlidar with properties:
    
                          Model: 'OS0-64'
                CalibrationFile: 'C:\ouster\OS0-64G_sample.json'
                      IPAddress: '127.0.0.1'
                           Port: 7502
        NumPointCloudsAvailable: 0
                        Timeout: 10
                      Streaming: 0
                     ReturnMode: {'strongest'}
                FirmwareVersion: 'v2.1.1'
                LidarUDPProfile: 'LEGACY'

    Create an ousterlidar object, obj. Specify the port number and the time out value. The output shows the object properties with the specified port number, 7506, and time out value, 15 seconds.

    obj = ousterlidar("C:\ouster\OS0-64G_sample.json", ...
                Port=7506,Timeout=15)
    obj = 
       ousterlidar with properties:
    
                          Model: 'OS0-64'
                CalibrationFile: 'C:\ouster\OS0-64G_sample.json'
                      IPAddress: '127.0.0.1'
                           Port: 7506
        NumPointCloudsAvailable: 0
                        Timeout: 15
                      Streaming: 0
                     ReturnMode: {'strongest'}
                FirmwareVersion: 'v2.1.1'
                LidarUDPProfile: 'LEGACY'

    Tips

    Release-by-Release Version Support

    ReleaseSupported Firmware Versions
    R2022a

    Support added for:

    • 2.0

    • 2.1

    R2023b

    Support added for:

    • 2.2

    • 2.3

    • 2.4

    R2024a

    Support added for:

    • 2.5

    • 3.0

    R2025a

    Support added for:

    • 3.1

    Version History

    Introduced in R2022a

    expand all