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
Amrtanshu Raj 2021-4-20
Hi,
Can you attach the complete code. The values of variables are missing.
Omar Mohamad
Omar Mohamad 2021-5-20
Kindly make sure that the biggest dimension is smaller than unity.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Robotics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by