How to get a cell array with lidarScan data for addScan?
Show older comments
Hello,
I tried to use the code from https://de.mathworks.com/help/nav/ref/lidarslam.addscan.html.
But on Mathworks they have a cell array with the lidarScan data and I have a lidarScan array. How do I change this to cell array?
% piece of code from Mathworks
% load garage_fl1_southend.mat scans
% scans = scans(1:40:end);
% my code
T = readtable('lidar_scan.csv');
for j=2:62
ranges = T{j,9:1088}; % T ist my table with all the given information
% from the LiDAR. So I have measured ranges for every timestamp for every 0.25 step of the 270
% degrees
angles = linspace(-135,135,numel(ranges));
scan(1,j-1) = lidarScan(ranges,angles); % output lidarScan array
end
maxRange = 19.2; % meters
resolution = 10; % cells per meter
slamObj = lidarSLAM(resolution,maxRange);
slamObj.LoopClosureThreshold = 360;
slamObj.LoopClosureSearchRadius = 8;
for i = 1:numel(scans)
addScan(slamObj,scans{i}); % Error here
if rem(i,10) == 0
show(slamObj);
end
end
Brace indexing is not supported for variables of this type.
Error in addScan(slamObj,scans{i});
Accepted Answer
More Answers (0)
Categories
Find more on Labeling, Segmentation, and Detection in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!