Why doesn't addVisuals display the mesh on the robot ?

3 ビュー (過去 30 日間)
K G
K G 2020 年 4 月 25 日
コメント済み: Omar Mohamad 2021 年 5 月 20 日
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 Center および File ExchangeManipulator Modeling についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by