Main Content

velodynelidar

Stream point clouds from Velodyne LiDAR lidar sensor

Since R2020b

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

Description

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

Creation

Description

v = velodynelidar(model) creates a velodynelidar object v that can stream point clouds from the Velodyne LiDAR sensor model model.

example

v = velodynelidar(model,Name,Value)specifies additional options with one or more name-value pair arguments. You can set these object properties by using the name-value arguments: CalibrationFile, Port, and Timeout. For example, velodynelidar(model,'Timeout',15) sets the time out value to 15 seconds.

example

Properties

expand all

This property is read-only.

Model name of the Velodyne LiDAR sensor, specified as a character vector or string. You must set this property at object creation by using the input argument model.

Valid model names are:

Model ValueVelodyne® Model
'HDL64E'HDL-64E sensor
'HDL32E'HDL-32E sensor
'PuckHiRes'VLP-16 Puck Hi-Res sensor
'PuckLITE'VLP-16 Puck LITE sensor
'VLP16'VLP-16 Puck sensor
'VLP32C'VLP-32C Ultra Puck sensor
'VLS128' or 'AlphaPuck'VLS-128 Alpha Puck sensor

Example: v = velodynelidar('HDL32E')

Data Types: char | string

This property is read-only.

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

Data Types: char

This property is read-only.

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

To set this property, you must specify it as a name-value argument at object creation. For example, velodynelidar(model,'Port',3000) sets the data port as 3000.

Data Types: double

This property is read-only.

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

Data Types: double

Maximum time to wait for a response from the Velodyne LiDAR lidar sensor, specified as a positive scalar in seconds.

To set this property, you must specify it as a name-value argument at object creation.

Example: velodynelidar(model,'Timeout',15) sets the time out value to 15 seconds.

Data Types: double

This property is read-only.

Sensor streams data, stored 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.

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

To set this property, you must specify it as a name-value argument at object creation.

Example: v = velodynelidar('HDL32E','CalibrationFile','C:\...\utilities\velodyneFileReaderConfiguration\HDL32E.xml)'

Data Types: char | string

Object Functions

startStart streaming point clouds from Velodyne LiDAR sensor
stopStop streaming point clouds from Velodyne LiDAR sensor
previewPreview of live point cloud data from Velodyne LiDAR sensor
closePreviewClose preview of live point cloud data from Velodyne LiDAR sensor
readAcquire point clouds from velodynelidar object buffer
flushDelete point clouds in velodynelidar object buffer

Examples

collapse all

When you create the object, you must indicate your hardware model by using the model argument in the object constructor function.

Create a velodynelidar object, v, for use with a model HDL-32E sensor.

v = velodynelidar('HDL32E')
v = 

    velodynelidar object with properties:

                   Model: 'HDL32E'
               IPAddress: '192.168.1.001'
                    Port: 2368
 NumPointCloudsAvailable: 0
                 Timeout: 10
               Streaming: 0
         CalibrationFile: 'matlab\...\utilities\velodyneFileReaderConfiguration\HDL32E.xml'

The output shows the object properties. For more information about the properties, see Create a velodynelidar Object and Use Object Properties.

You can also assign other properties to the object by using name-value pairs.

Create a velodynelidar object, v, and increase the timeout to 20 seconds.

v = velodynelidar('HDL32E','Timeout',20)
v = 

    velodynelidar object with properties:

                   Model: 'HDL32E'
               IPAddress: '192.168.1.001'
                    Port: 2368
 NumPointCloudsAvailable: 0
                 Timeout: 20
               Streaming: 0
         CalibrationFile: 'matlab\...\utilities\velodyneFileReaderConfiguration\HDL32E.xml'

In the output, you see that the timeout is now set to 20.

Version History

Introduced in R2020b

expand all