getting started with lidar acquisition in matlab video -凯发k8网页登录
this video shows how to quickly get started acquiring live lidar data from velodyne lidar® sensors into matlab®. it covers connecting to hardware, reading data, and performing analysis on lidar point clouds.
with your velodyne hardware connected to your computer, you can test the connection using the third-party veloview software. then in matlab, you can connect directly to the hardware using the velodynelidar function.
once you’ve connected to the hardware from matlab, you can read point clouds using the read command or stream point clouds to a buffer using the start and stop commands. you can also perform live analysis while streaming point cloud data into matlab.
matlab toolboxes provide many point cloud processing functions for different applications. with just a few lines of code, these functions and their corresponding examples can be applied to point clouds acquired live from velodyne lidar sensors.
the functionality shown in this video requires image acquisition toolbox™ as well as image acquisition toolbox support package for velodyne lidar sensors, which can be downloaded from the add-on explorer in matlab.
you can now acquire live lidar data from select velodyne lidar sensors directly into matlab. this video will show you how to get started.
first, i’ll review how to connect to your hardware. then i’ll show the different options for reading lidar point clouds in matlab. finally, you’ll see how to get started with some of the lidar processing functionality available in matlab.
before you get started, you’ll want to make sure that you have installed all the required products and hardware support packages.
the following velodyne lidar sensors are currently supported. for this example, i’ll be using a velodyne puck sensor.
here is the sensor as it is mounted to my desk. i have it connected to power and to my computer’s ethernet port.
before i connect to the sensor from matlab, i’ll check the connection using the veloview software, which is a free third-party tool.
i can open the sensor steam, specify the sensor that i’m using and the lidar port. here i’m using the default, which is 2368. and i can see the data coming from the sensor live, and if i move around my office, you can see this movement in the displayed point cloud.
so this is all working well. i can connect to the sensor from matlab. before i do so, i should make sure to close the veloview software.
in matlab, i can connect to the sensor using the velodynelidar function. specify the sensor name. here you can also specify the port and the calibration file if you have one. i’m using the defaults for those. the default calibration file is the one that’s provided by velodyne lidar.
so you can see i’ve successfully connected to this device. i can preview the data coming from the sensor with the preview function. now you can see the data is streaming into a matlab figure. and once again, if i move around the office, you can see the preview update to reflect this.
but the streaming preview does not save any data. if i want to actually acquire data in matlab, i can use the read function. and that will read data into a point cloud variable. so you can see i’ve read a single point cloud with 57,000 points into matlab. i can view this point cloud using the pcshow function. so that data has now been acquired and visualized in matlab.
in addition to on-demand point cloud readings, i can also stream data into a buffer in matlab. if i start acquiring on v and look at the object, we can now see that streaming is true and the number of point clouds available continues to increase over time.
i can read point clouds from the beginning of the buffer, either one at a time or in groups, and i can analyze this data in matlab while data continues to stream into the end of the buffer.
i can also stop the buffered acquisition. when i do so, i still have access to the remaining data in the buffer. so there are a few different options for reading point clouds from the device.
now let’s say i’d like to start doing some processing of these point clouds. when i want to learn how to do something in matlab, i like to search the documentation. if i search for lidar processing, i see that there are entire documentation sections dedicated to this. let’s say i want to do some segmentation. there is a section here with a number of lidar preprocessing functions available. i see that one of them is pcsegdist, which can segment point clouds into clusters based on euclidean distance.
whenever i’m trying to use a new function for the first time, i like to look at the examples that are available. i see here that there’s an example where some artificial sphere data is created and then it’s segmented based on distance and the two clusters that are discovered are differentiated by color. that seems like an interesting application. i’ll open the live script in matlab. and i could just run this, but rather than using this artificial data, i’ll replace it with the data specific to my application, which is the live data coming from my sensor.
so now if i run this, it’ll read from my sensor and then perform the rest of these computations on that data.
now i can see in this plot that most of the points within my office were found to be in the same cluster and there was a second cluster here for the chair in my office which is right behind me.
if i want to find more distinct clusters in my office, i can change this minimum distance so that rather than points needing to be half a meter away to be distinct clusters, let’s say they only need to be ten centimeters away. and i’ll also change the colormap so that adjacent clusters have more distinct colors.
now let’s run this again.
and in the figure that pops up, i can see that there are a number of different colors for different segments that are found in my office. i was identified as one color here. my chair was a different color. this wall with my computer on it was another color. and there were several different clusters found on this desk at the far side of my office.
so these are some of the first steps that i would take exploring some new lidar processing function and then adapting it to my own needs.
so to review, i’ve gone through three steps that are needed to get started with hardware. first testing your connection and then connecting in matlab with the velodyne lidar function. you can read point clouds with the read function and stream point clouds with the start and stop functions. and then when you move on to processing, you can explore provided point cloud processing functionality and adapt these examples to suit your own needs.
thank you.
featured product
image acquisition toolbox
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 mathworks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- (español)
- (english)
- (english)
欧洲
- (english)
- (english)
- (deutsch)
- (español)
- (english)
- (français)
- (english)
- (italiano)
- (english)
- (english)
- (english)
- (deutsch)
- (english)
- (english)
- switzerland
- (english)
亚太
- (english)
- (english)
- (english)
- 中国
- (日本語)
- (한국어)