Why doesn't addVisuals display the mesh on the robot ?
2 views (last 30 days)
Show older comments
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 Comments
Amrtanshu Raj
on 20 Apr 2021
Hi,
Can you attach the complete code. The values of variables are missing.
Answers (0)
See Also
Categories
Find more on Robotics in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!