About error of helperVisu​alizeMotio​nAndStruct​ureStereo

4 views (last 30 days)
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.

Answers (1)

Qu Cao
Qu Cao on 22 Nov 2021
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]
  1 Comment
圭介 川邉
圭介 川邉 on 24 Nov 2021
I was able to eliminate the error by increasing each value. Thank you very much.

Sign in to comment.

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!