Anybody can check my code to build mass matrix of 6 DOF manipulator, especially UR10?

18 vues (au cours des 30 derniers jours)
재욱 임 le 1 Déc 2022
Hello,
I'm trying to build mass matrix for UR10 of Universal Robot.
I think you might know that the mass matrix M can be calculated using the equation below
• : velocity Jacobian matrix ()
• : angular velocity Jacobian matrix ()
• : the inertia tensor of the collection of body elements, output as a 3-by-3 matrix relative to the centered frame. The centered frame is a whose axes are aligned with those of Base's Reference Frame (=world frame)
robot.DataFormat = 'column';
and using robotics system toolbox, I coded like this
% LBF means Link Body Fixed Frame, which is link attached reference frame
% LBF_centeredMOI is the inertia tensor of the collection of body elements, output as a 3-by-3 matrix
% relative to the centered frame. The centered frame is a frame whose origin coincides with the center of mass and
% whose axes are aligned with those of LBF
LBF_centeredMOI = cellfun(@buildLBFCenteredMOI, robot.Bodies, 'UniformOutput', false);
% isRevoluteJoint = cellfun(@checkIfRevoluteJoint, robot.Bodies);
config = robot.homeConfiguration;
massMatrix = zeros(6, 6);
jacobian{i} = robot.geometricJacobian(config, robot.BodyNames{i});
jacobianW{i} = jacobian{i}(1:3, :);
jacobianV{i} = jacobian{i}(4:6, :);
xForm_0{i} = robot.getTransform(config, robot.BodyNames{i});
R = xForm_0{i}(1:3, 1:3);
massMatrix = massMatrix + M{i};
end
massMatrix
robot.massMatrix(config)
------------------------------------------------------------------------------------------------------------
inertiaArray = link.Inertia; % [Ixx Iyy Izz Iyz Ixz Ixy]
LBF_MOI = diag(inertiaArray(1:3)) + [0, inertiaArray(6), inertiaArray(5)
inertiaArray(6), 0, inertiaArray(4)
inertiaArray(5), inertiaArray(4), 0];
end
However, the result of {massMatrix} is different from {robot.massMatrix}
• massMatrix :
• robot.massMatrix
What do you think of the problem is?
Thank you
0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

Réponses (1)

The discrepancy in the values of massMatrix is most probably an expected difference. It arises from the fact that URDF specifies the inertia with respect to the Center of Mass, while the RigidBody object defines inertia with respect to the frame origin.
I would request you to go through the following MATLAB answer post for a detailed insight into the issue:
If the issue still persists or you have specific concerns regarding the results of the computation, please feel free to contact MathWorks Technical Support:
Hope this helps!
0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

Catégories

En savoir plus sur Robotics dans Help Center et File Exchange

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by