Why doesn't addVisuals display the mesh on the robot ?
2 次查看(过去 30 天)
显示 更早的评论
dhparams = [0 0 l1 0;
l2 -pi/2 0 0
l3 0 0 0;
l4 0 0 0];
%creat BodyTree
excavator=robotics.RigidBodyTree('DataFormat','row');
%base
cap = robotics.RigidBody('cap');
swing1=robotics.Joint('swing1','revolute');
setFixedTransform(swing1,dhparams(1,:),'dh');
cap.Joint=swing1;
%boom
boom = robotics.RigidBody('boom');
jnt2=robotics.Joint('jnt2','revolute');
setFixedTransform(jnt2,dhparams(2,:),'dh');
boom.Joint=jnt2;
%stick
stick = robotics.RigidBody('stick');
jnt3=robotics.Joint('jnt3','revolute');
setFixedTransform(jnt3,dhparams(3,:),'dh');
stick.Joint=jnt3;
%bucket
bucket = robotics.RigidBody('bucket');
jnt4=robotics.Joint('jnt4','revolute');
setFixedTransform(jnt4,dhparams(4,:),'dh');
bucket.Joint=jnt4;
%Specify Dynamics Properties to Rigid Body Tree
cap.Mass = 10;
cap.CenterOfMass = [0 0 0];
cap.Inertia = [0 0 0 0 0 0];
boom.Mass = 1.5;
boom.CenterOfMass = [0.24577 -0.19993 -0.00004];
boom.Inertia = [0 0 0 0 0 0];
stick.Mass = 1;
stick.CenterOfMass = [0 0 0];
stick.Inertia = [0 0 0 0 0 0];
bucket.Mass = 0.9;
bucket.CenterOfMass = [0 0 0];
bucket.Inertia = [0 0 0 0 0 0];
%
%addVisuals
addVisual(cap,"Mesh",'zylinder.stl');
%
%add bodys % Muss immer zum Schluss ausgeführt werden
addBody(excavator,cap,'base');
addBody(excavator,boom,'cap');
addBody(excavator,stick,'boom');
addBody(excavator,bucket,'stick');
% show result
% showdetails(excavator)
show(excavator)
2 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Robotics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!