Lidar Point Cloud 3D Show
6 次查看(过去 30 天)
显示 更早的评论
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 个评论
aws hawary
2020-4-13
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
2020-4-13
https://www.mathworks.com/help/vision/ref/velodynefilereader.html and readFrame() to read one frame at a time ?
回答(1 个)
Sai Bhargav Avula
2019-12-6
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 个评论
aws hawary
2020-4-13
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
2020-5-20
If you have the PCAP file, you can use the velodyneFileReader class to read frames from it using the readFrame function.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Point Cloud Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!