How can I change the base position of universalUR10 robot model
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
hussein saied
le 19 Nov 2021
Commenté : hussein saied
le 22 Nov 2021
Code:
ur10 = loadrobot('universalUR10');
ur10Moved = rigidBodyTree;
rb = rigidBody('newBaseForUR10');
rb.Joint.setFixedTransform(trvec2tform([3,0,0]));
ur10Moved.addBody(rb, 'base');
ur10Moved.addSubtree('newBaseForUR10', ur10);
show(ur10);
xlim([-2 4])
zlim([0, 1.5])
hold on
show(ur10Moved);
Error:
The name of the body, base, has already been used in the robot. Use a different name for the body.
when I use a different name, i got this error:
Body with name bbase is not found. Check the BodyNames property of the rigidBodyTree object to get a list of body names.
0 commentaires
Réponse acceptée
Hannes Daepp
le 22 Nov 2021
This issue is because the default base name in a new rigidBodyTree is "base", which is also a rigid body in the loaded UR10.
This is evident when you first create the new rigid body tree:
ur10Moved = rigidBodyTree
ur10Moved.BaseName
As you can see, the BaseName property of UR10 is already set to "base". Then when you load the UR10, it too has a body named "base":
ur10 = loadrobot('universalUR10');
ur10.showdetails
Since body names must be unique, these two rigid body tree objects cannot be combined as-is.
However, the base name is not fixed after construction, so an easy way to get around this issue would be to change the base name in the new rigid body tree that you are creating so that there are no conflicts once the UR10 is added. That is:
% Load the UR10 from the robot library
ur10 = loadrobot('universalUR10');
% Create the new rigid body tree with a new base name
ur10Moved = rigidBodyTree;
ur10Moved.BaseName = 'newBase';
% Add a new custom base to the renamed base
rb = rigidBody('newBaseForUR10');
rb.Joint.setFixedTransform(trvec2tform([3,0,0]));
ur10Moved.addBody(rb, ur10Moved.BaseName);
Then you should be able to add the UR10 as a subtree without any issue
ur10Moved.addSubtree('newBaseForUR10', ur10);
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Manipulator Modeling dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!