velodynelidarObject 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
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
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
|Model Value||Velodyne Model|
|VLP-32C Ultra Puck sensor|
|VLP-16 Puck sensor|
|VLP-16 Puck Lite sensor|
|VLP-16 Puck Hi-Res sensor|
For example, to create the object when you are using a VLP-16 Puck:
v = velodynelidar('VLP16')
Create Object Specifying Other Properties
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
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:
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\
Sensor's data port. This is listed in the Velodyne Web Interface Data Port field on the Configuration tab.
Timeout specified for reading point clouds from the sensor, in seconds.
Default: 10 seconds
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.
|Velodyne model, specified during object creation. See the preceding "Model" table for possible values. Read-only after object is created.|
|IP address of the sensor, read from incoming UDP packets. Read-only.|
|UDP 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.|
|Timeout specified for reading a Point Cloud from the sensor, in seconds. Can be set during object creation or after.|
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.
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.
|Indicates whether the sensor is streaming data. A value of |
Use Properties After Creating the Object
You can use two properties after object creation:
You can change the timeout value after the object has been created, using this syntax for
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
n = v.NumPointCloudsAvailable n = 497