Why the result of Robotic System Toolbox are different with RTB(Robotics Toolbox for MALTAB)?
古いコメントを表示
I built a simple two DoF robot with Robotic System Toolbox and set the transform matrix using DH parameters. But the result has a big difference with result of RTB toolbox (developed by Peter Corke).
When I use Modified DH parameters, the results are the same. Does anybody know why? Is something wrong with my code?
The Two DOF robot is

[m1,m2] = deal(20,20); %Mass of links
[l1,l2] = deal(0.5,0.5); %Length of links
lc1 = l1/2; %Center of Gravity
lc2 = l2/2;
I1 = 1; %inertia
I2 = 1;
%% this section is a robot model built by RTB(Robotics Toolbox for MALTAB) using DH parameters
L(1) = Revolute('d', 0, 'a', l1, 'alpha', 0, 'I',[0;0;I1;0;0;0], 'r', [-lc1; 0; 0], 'm', m1); %the inertia is relative to COG
L(2) = Revolute('d', 0, 'a', l2, 'alpha', 0, 'I',[0;0;I2;0;0;0], 'r', [-lc2; 0; 0], 'm', m2);
two_Link= SerialLink(L, 'name', 'Puma 560');
two_Link.gravity = [0,0,0];
two_Link.nofriction;
%% this section is a robot model built by robotic system toolbox
dhparams = [l1, 0, 0, 0;
l2, 0, 0, 0];
Two_rigid = robotics.RigidBodyTree;
Two_rigid.DataFormat = 'column';
link1 = robotics.RigidBody('link1');
link2 = robotics.RigidBody('link2');
jnt1 = robotics.Joint('joint1','revolute');
jnt2 = robotics.Joint('joint2','revolute');
setFixedTransform(jnt1,dhparams(1,:),'dh');
setFixedTransform(jnt2,dhparams(2,:),'dh');
link1.Joint = jnt1;
link2.Joint = jnt2;
link1.Mass = m1;
link1.Inertia = [0; m1*lc1^2; I1+m1*lc1^2; 0;0;0]; % the inertia is change to body frame
link1.CenterOfMass = [-lc1; 0; 0];
link2.Mass = m2;
link2.Inertia = [0; m2*lc2^2; I2+m2*lc2^2; 0;0;0];
link2.CenterOfMass = [-lc2; 0; 0];
addBody(Two_rigid,link1,'base');
addBody(Two_rigid,link2,'link1');
%% results of two toolboxes
q1 = pi/6;
q2 = pi/12;
q = [q1;q2];
qd = [0.1;0.1];
C_L = coriolis(two_Link, q', qd');
M_L = inertia(two_Link,q'); %% mass matrix computed by RTB
M_r = massMatrix(Two_rigid,q); %% mass matrix computed by RST
The results are

Obviously, the results has a big difference.
3 件のコメント
Walter Roberson
2020 年 5 月 19 日
my understanding is that they use different coordinate systems.
siyong xu
2020 年 5 月 20 日
Karsh Tharyani
2020 年 10 月 29 日
Thank you for your question. In order to aid you better in diagnosing this issue, I recommend that you please reach out to Technical Support https://www.mathworks.com/support/contact_us.html with a reproducible (you can use the one in this post) of your issue. The appropriate team of this feature will be able to answer your query.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Manipulator Modeling についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!