How to convert my data to fit the 'Build Map and Localize Using Segment Matching' example?

hello
I have my own 'Velodyne-VLP-16-Data.pcap' data with 1,537 frames collected using Velodyne Puck Lite sensor.
But since I don't know what the example data in this example looks like, I don't know how to apply my own data.
How can I convert my data to fit this example?
thank you.

4 Comments

No one can solve your problem before understanding what's going on. In other words, you should help others reproduce your issue. Can you share the "pcap" file and reproduction steps?
In the example, the provided data is in the format of 'scan*.png', representing point clouds in a 5x100x3 format. During the execution of the code, the input data for the function segmentLidarData needs to be in the format (M×N×3).
My pcap point cloud data is formatted as (25960×3), which has caused errors.
Therefore, I want to convert my pcap data into png format with the dimensions (M×N×3).
Could you help me with this conversion process?
My data file is too large to upload here.
It would be okay for you to upload even a small sample of this data and your current approach so we can point you to the solution.

Sign in to comment.

Answers (1)

Hello Seohyeon
In the example that you are following, the lidar data is being read from a PNG file. Given that you have a PCAP-file, you can leverage MATLAB’s built-in function “velodyneFileReader” to read the point clouds from the file.
Kindly use the “velodyneFileReader” function along with the “readFrame” function to read the point cloud object which can then be used with “segmentLidarData” function. The following code snippet demonstrates how to read point cloud data from a PCAP-file and then visualise it.
p = velodyneFileReader("2023-03-27-13-34-03_Velodyne-VLP-16-Data (Frame 0 to 100).pcap",'VLP16')
timeDuration = p.StartTime + duration(0,0,1,Format='s');
ptCloudObj = readFrame(p,timeDuration);
figure
pcshow(ptCloudObj)
For further understanding, refer to the following MathWorks Documentation:
I hope you find the above explanation and suggestions useful!

Products

Asked:

on 25 Apr 2024

Answered:

on 12 Jul 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!