Lidar Point Cloud 3D Show

5 Ansichten (letzte 30 Tage)
Elad Soll
Elad Soll am 23 Nov. 2019
Kommentiert: Anand am 20 Mai 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 Kommentare
aws hawary
aws hawary am 13 Apr. 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 am 13 Apr. 2020
https://www.mathworks.com/help/vision/ref/velodynefilereader.html and readFrame() to read one frame at a time ?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Sai Bhargav Avula
Sai Bhargav Avula am 6 Dez. 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 Kommentare
aws hawary
aws hawary am 13 Apr. 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 am 20 Mai 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.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by