33 views (last 30 days)

I'm currently working on a project where I want to plot a 3d diagram (sort of like terrain mapping) with the data obtain by Rp lidar.

I am able to get x,y,z axis in .csv format but I am not sure how I can display these values accurately so that it represents a terrain map.

I have tried scatter2, mesh and pcshow but those graphs have not been accurate and just shows me noise.

Any help will be highly apperciated.

Thank you.

K.

Amrtanshu Raj
on 6 Oct 2020

Hi,

The problem is not in the plotting/visualisation part. We advise implementing the equations first to get proper values and then look into the visualisation part. If the values are recorded correct, then pcshow will be enough to visualise the plot.

My advice to get the desired values will be first to understand how a Lidar works and then try to record the Lidar range and theta (given by the lidar sensor) along with the time step. Then rotate the Lidar using the stepper along Y-axis( you should not need the Z stepper as the entire 3D area will be swept) and also record the angles(phi) along with the timestamp. Then you can try to sync both the set of readings(range and theta from RPLidar and phi from the stepper) with the help of the timestamp.

Then you can use sph2cart(theta will be the azimuth and phi will be elevation) to get the xyz values for each Lidar reading, after that use the PointCloud to store them as a point cloud. The use the pcshow function to get the desired Visualisation.

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

Start Hunting!
## 7 Comments

## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/600169-rp-lidar-data-plotting#comment_1025194

⋮## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/600169-rp-lidar-data-plotting#comment_1025194

## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/600169-rp-lidar-data-plotting#comment_1029223

⋮## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/600169-rp-lidar-data-plotting#comment_1029223

## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/600169-rp-lidar-data-plotting#comment_1030663

⋮## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/600169-rp-lidar-data-plotting#comment_1030663

## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/600169-rp-lidar-data-plotting#comment_1031860

⋮## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/600169-rp-lidar-data-plotting#comment_1031860

## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/600169-rp-lidar-data-plotting#comment_1034716

⋮## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/600169-rp-lidar-data-plotting#comment_1034716

## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/600169-rp-lidar-data-plotting#comment_1038221

⋮## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/600169-rp-lidar-data-plotting#comment_1038221

## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/600169-rp-lidar-data-plotting#comment_1038821

⋮## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/600169-rp-lidar-data-plotting#comment_1038821

Sign in to comment.