About error of helperVisu​alizeMotio​nAndStruct​ureStereo

3 次查看(过去 30 天)
I am the following site
https://jp.mathworks.com/help/vision/ug/stereo-visual-simultaneous-localization-mapping.html
For reference, I'm thinking of running SLAM with my own stereo camera with the file name "stereoslam.m".
No error occurred up to the "Map Initialization" item, but the following error occurs in the "Data Management and Visualization" item.
Error: pointclouds.internal.pcui.validateAndParseInputsXYZC (line 47)
The input must be non-empty.
Error: pcplayer / parseInputs (line 518)
[X, Y, Z, C, map, ptCloud] =
pointclouds.internal.pcui.validateAndParseInputsXYZC (mfilename, varargin {:});
Error: pcplayer / view (line 199)
[X, Y, Z, C, map, ptCloud] = pcplayer.parseInputs (varargin {:});
Error: helperVisualizeMotionAndStructureStereo (line 41)
obj.MapPointsPlot.view (xyzPoints, color);
Error: stereoslam (line 79)
mapPlot = helperVisualizeMotionAndStructureStereo (vSetKeyFrames, mapPointSet);
I suspect that the "color" value of the helperVisualizeMotionAndStructureStereo function is the cause,
The following code on line 39 of the actual helperVisualizeMotionAndStructureStereo function
color = xyzPoints(:, 3);
When I checked the value of this color, it became the following value.
color =
0 × 1 empty single column vector
However, since xyzPoints of the workspace in "stereoslam.m" that I am making is written as "264x3 single", I think that the color value should be a sequence of all the values in the third column.
The following xyzPoints in the helperVisualizeMotionAndStructureStereo function
[xyzPoints, currPose, trajectory] = retrievePlottedData(obj, vSetKeyFrames, mapPoints);
How can I enter the value of xyzPoints in my workspace instead of this?
Also, if my thinking is wrong and the error is another cause, please let me know about the cause.

回答(1 个)

Qu Cao
Qu Cao 2021-11-22
In helperVisualizeMotionAndStructureStereo.m, please note the following code in retrievePlottedData which discards xyzPoints outside the axis limits.
% Only plot the points within the limit
inPlotRange = xyzPoints(:, 1) > obj.XLim(1) & ...
xyzPoints(:, 1) < obj.XLim(2) & xyzPoints(:, 2) > obj.YLim(1) & ...
xyzPoints(:, 2) < obj.YLim(2) & xyzPoints(:, 3) > obj.ZLim(1) & ...
xyzPoints(:, 3) < obj.ZLim(2);
xyzPoints = xyzPoints(inPlotRange, :);
You can change the following properties in helperVisualizeMotionAndStructureStereo for your use case.
XLim = [-20 100]
YLim = [-100 40]
ZLim = [-5 15]

类别

Help CenterFile Exchange 中查找有关 Point Cloud Processing 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by