Lidar Point Cloud 3D Show

4 visualizaciones (últimos 30 días)
Elad Soll
Elad Soll el 23 de Nov. de 2019
Comentada: Anand el 20 de Mayo de 2020
Hi
I have a problem to show lidar point cloud by "build lidar map" example.
I took step by step, but only for the lidar sensor. I changed timerange field function inorder to adjust time and ptCloud values to the lidar variables, but I can not see point cloud on my figure.
Note - there is not complier error.
Please help.
my code:
data = load('lidarPointClouds');
lidarPointClouds = data.lidarPointClouds;
head(lidarPointClouds);%8x1 timetable
lidarFrameDuration = median(diff(lidarPointClouds.Time));
lidarFrameDuration.Format = 's';%Adjust display format to sec
lidarRate = 1/seconds(lidarFrameDuration);%Frame rates
%Display frame durations and rates
fprintf('Lidar:%s %3.1f Hz\n',char(lidarFrameDuration),lidarRate);
%Customize axis
xlimits = [-45 45];
ylimits = [-45 45];
zlimits = [-10 20];
lidarPlayer = pcplayer(xlimits,ylimits,zlimits);
xlabel(lidarPlayer.Axes,'X(m)');
ylabel(lidarPlayer.Axes,'Y(m)');
zlabel(lidarPlayer.Axes,'Z(m)');
title(lidarPlayer.Axes,'Lidar Sensor Data');
% Reading Lidar Point Cloud by a loop
lidarFrames = 0; timeSpan = 0 ;ptCloud = 0;
for i = 1:height(timetable)-1
timeSpan = timerange(lidarPointClouds.Time(1),lidarPointClouds.Time(1000),'closed');
lidarFrames = lidarPointClouds(timeSpan,:);
ptCloud = lidarFrames.PointCloud(i);
view(lidarPlayer,ptCloud);
pause(0.01);
end
  4 comentarios
aws hawary
aws hawary el 13 de Abr. de 2020
Hello
I have a question if anyone could help me
I got Data LIDAR files ( pcap and csv)
I wanna to apply that data but the files should be compatible with MATLAB platform .. How can I read all the frames of ply file .. I read the total of pcap but I need the frames #separately for each timestamp
Walter Roberson
Walter Roberson el 13 de Abr. de 2020
https://www.mathworks.com/help/vision/ref/velodynefilereader.html and readFrame() to read one frame at a time ?

Iniciar sesión para comentar.

Respuestas (1)

Sai Bhargav Avula
Sai Bhargav Avula el 6 de Dic. de 2019
Hi,
Here is updated code that works for simple lidarPointCloud. I think the issue with your code is 'timetable' wasnot defined properly
data = load('lidarPointClouds.mat');
lidarPointClouds = data.lidarPointClouds;
head(lidarPointClouds);%8x1 timetable
lidarFrameDuration = median(diff(lidarPointClouds.Time));
lidarFrameDuration.Format = 's';%Adjust display format to sec
lidarRate = 1/seconds(lidarFrameDuration);%Frame rates
%Display frame durations and rates
fprintf('Lidar:%s %3.1f Hz\n',char(lidarFrameDuration),lidarRate);
%Customize axis
xlimits = [-45 45];
ylimits = [-45 45];
zlimits = [-10 20];
lidarPlayer = pcplayer(xlimits,ylimits,zlimits);
xlabel(lidarPlayer.Axes,'X(m)');
ylabel(lidarPlayer.Axes,'Y(m)');
zlabel(lidarPlayer.Axes,'Z(m)');
title(lidarPlayer.Axes,'Lidar Sensor Data');
% Reading Lidar Point Cloud by a loop
lidarFrames = 0; timeSpan = 0 ;ptCloud = 0;
timeSpan = timerange(lidarPointClouds.Time(1),lidarPointClouds.Time(1000),'closed');
lidarFrames = lidarPointClouds(timeSpan,:);
for i = 1:height(lidarFrames)-1
ptCloud = lidarFrames.PointCloud(i);
view(lidarPlayer,ptCloud);
pause(0.01);
end
Hope this helps!
  2 comentarios
aws hawary
aws hawary el 13 de Abr. de 2020
Hello
I have a question if anyone could help me
I got Data LIDAR files ( pcap and csv)
I wanna to apply that data but the files should be compatible with MATLAB platform .. How can I read all the frames of ply file .. I read the total of pcap but I need the frames #separately for each timestamp
Anand
Anand el 20 de Mayo de 2020
If you have the PCAP file, you can use the velodyneFileReader class to read frames from it using the readFrame function.
If you have PLY files, you can use the pcread function to read each PLY file.

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by