Main Content

Create a velodynelidar Object and Use Object Properties

You access the point cloud data by using the velodynelidar object. Once you have created the object, you can preview and read point clouds from the supported lidar sensors by using the preview and read functions. You can read all available point clouds or read a subset that you select. You can specify the number of point clouds to read and specify them as the latest or the oldest point clouds in the buffer by using arguments of the read command.

Create Object Specifying Model Only

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

v = velodynelidar('model')

Possible values for model include the values listed in this table.

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

For example, to create the object when you are using a VLP-16 Puck:

v = velodynelidar('VLP16')

Create Object Specifying Other Properties

The model property is the only required argument to create the object. You can also assign other properties to the object by using name-value pairs, with this syntax:

v = velodynelidar(model,Name,Value)

For example, to set the port:

v = velodynelidar('HDL32E','Port',3000)

For example, to designate a calibration file:

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

There are three properties that you can set by using the object constructor function: CalibrationFile, Port, and Timeout.

PropertyValue
'CalibrationFile'

Path and name of an XML file containing Velodyne LiDAR® laser calibration data. If no calibration file is specified, a default calibration file with data obtained from Velodyne device manuals is chosen.

Default: location of the default calibration file. For example, for version R2019a, it would be C:\Program Files\R2019a\matlab\toolbox\shared\ pointclouds\utilities\VelodyneFileReaderConfiguration

'Port'

Sensor's data port. This is listed in the Velodyne Web Interface Data Port field on the Configuration tab.

Default: 2368

'Timeout'

Timeout specified for reading point clouds from the sensor, in seconds.

Default: 10

Object Properties

When you create the velodynelidar object, the object properties are displayed if you do not suppress the output, as shown here.

v = velodynelidar('VLP16','Port',3000)

v = 

    velodynelidar object with properties:

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

Velodyne LiDAR object properties are listed in this table.

PropertyValue
ModelVelodyne model, specified during object creation. See the preceding "Model" table for possible values. Read-only after object is created.
IPAddressIP address of the sensor, read from incoming UDP packets. Read-only.
PortUDP data port of the sensor. The port is required when creating the object if it is different from the default of 2368. Read-only after object creation.
TimeoutTimeout specified for reading a Point Cloud from the sensor, in seconds. Can be set during object creation or after.
CalibrationFile

Path and name of an XML file containing Velodyne LiDAR laser calibration data. The name can be set when creating the object. Read-only after object creation.

NumPointCloudsAvailable

Count of the number of point clouds available in the buffer. When the object is created, this count is 0 because acquisition has not been started yet. Once you start acquiring point clouds, you can use this property to see how many point clouds are available. Read-only.

StreamingIndicates whether the sensor is streaming data. A value of 0 means it is not streaming. A value of 1 means it is streaming data to the buffer. Read-only. You can use the start and stop functions to control streaming.

Use Properties After Creating the Object

You can use two properties after object creation: Timeout and NumPointCloudsAvailable.

You can change the timeout value after the object has been created, using this syntax for an object v.

v.Timeout = 20;

You can query for the number of point clouds that are available in the buffer after the object has been created and you have acquired point clouds, by using this syntax for an object v.

n = v.NumPointCloudsAvailable

   n = 497

See Also

| |

Related Topics