When running the Manipulator Simulation in MATLAB visual servo toolbox, the following problems are encountered: error in port widths or dimensions. ‘ Output Port 1’ of ‘sl_ arm_ ibvs/camera’ is a [28×1] matrix.
The problem is caused by the wrong input vector dimension at the red circle dimension in the figure below.
Here the p for the camera pixel coordinate system under the coordinate value, should be 2 * 4 vectors.
Solution: The new version of Machine Vision Toolbox for MATLAB toolbox lacks the module “slcamera.m”, open the camera module in simulate.
Double click the MATLAB FCN module, and you will be prompted that “slcamera” cannot be found. Select new:
Type the following code:
function p = slcamera(cam, u)
%if all(u == 0)
if (u(1:16,:)==0)
% Simulink is probing for the dimensions
np = (length(u)-16)/3;
p = zeros(2, np);
else
p = zeros(2, 4);
P = reshape(u(17:end), 3, []);
Tcam = reshape(u(1:16), 4, 4);
p = cam.plot(P, 'pose', Tcam, 'drawnow');
end
Run simulate again, you can see the error report and disappear, then you should encounter the following error.
Error in ‘sl_arm_ibvs/camera/MATLAB Fcn’. Evaluation of expression resulted in an invalid output.
Only finite double vector or matrix outputs are supported
I am also working on a solution for this error, so please stay tuned.
Read More:
- How to Solve m_gshhs_i Error
- [Solved] MATLAB Error: Wrong use of commLTETurboDecoder/step
- R language learning problem solving error in output $nodeid: $operator is invalid for atomic vectors
- How to Solve “License Manager Error -8” Error After MATLAB2018a is Installed
- [Solved] pytorch CrossEntropyLoss Error: RuntimeError: 1D target tensor expected, multi-target not supported
- [system] [error] Attempted to start Color camera – NOT detected
- Numpy.exp Function Error ‘Float’ object has no attribute ‘exp’
- How to Solve Vector Variable Error in sub thread
- Matlab 2018a Error: License Manager Error-8 [Solved]
- [Solved] matlab error: try to write SCRIPT vl_sift is executed as a function
- Matlab R2019b License Manager Error -103 [How to Solve]
- Error in *** : subscript out of bounds [How to Solve]
- [USF-XSim-62] ‘elaborate‘ step failed with errors.[Vivado 12-4473] Detected error while running sim
- Template argument deduction/substitution failed: couldn‘t deduce template parameter [How to Solve]
- [Solved] MATLAB and pycharm open error messages at the same time
- Android Phone Record Screen Error: failed to get surface
- [Solved] Opencv Error: Error: Assertion failed (data) in cv::Mat::at, file … mat.inl.hpp, line 897(Accessed pixels of non-existent matrix)
- [Solved] throw new Error(“‘output.filename’ is required, either in config file or as –output-filename”);
- C++ clang Compile Error: error: expected unqualified-id
- Kill Tomcat process in windows and Linux environment (solve the problem of other ports being occupied)