一.将URDF模型导入MATLAB
robot = importrobot('xxxxxxx.urdf')
show(robot)
二.将STL模型导入MATLAB
1.下载 STL File Reader
https://ww2.mathworks.cn/matlabcentral/fileexchange/22409-stl-file-reader
2.准备STL文件
3.导入并显示
fig = figure;
fv = stlread('arm_link1.stl');
patch(fv,'FaceColor', [0.8 0.8 1.0], ...
'EdgeColor', 'none', ...
'FaceLighting', 'gouraud', ...
'AmbientStrength', 0.15);
% Add a camera light, and tone down the specular highlighting
camlight('headlight');
material('dull');
axis([-0.04 0.04 -0.08 0.08 -0.06 0.06]);
view([-135 35]);
title('模型原始零件');
xlabel('X[m]');ylabel('Y[m]');zlabel('Z[m]');
% Fix the axes scaling, and set a nice view angle
axis('image');view([-135 35]);
% hold on;