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
Amrtanshu Raj
2021년 4월 20일
Hi,
Can you attach the complete code. The values of variables are missing.
답변 (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!