change base of rigidBodyTree like in SerialLink

31 vues (au cours des 30 derniers jours)
Xingchen Li
Xingchen Li le 17 Déc 2020
Commenté : Xingchen Li le 18 Déc 2020
Hi everyone,
i have build two rigidBodyTree robot model and want these two robots do something together. The second arm is planned to be set on [3, 0, 0].
When i tried to use robot2.base = [3 0 0]; like in SerialLink, it shows Unrecognized property 'base' for class 'rigidBodyTree'. So how can i change the base of the second robot?
If not, how can i put two robot arms in one task space without using a extra plattform to combine them?
Best,
Xingchen

Réponse acceptée

Yiping Liu
Yiping Liu le 18 Déc 2020
Currently there is not a user-facing way to modify the fixed tranform on the robot base - it's always assumed to be at the origin. This could be a future enhancement.
For now, to work around this, you can use addSubtree function to get around this limitation.
lbr = loadrobot('kukaIiwa7');
rng(1)
lbr.show(lbr.randomConfiguration);
kinova = loadrobot('kinovaGen3');
kinovaMoved = rigidBodyTree;
rb = rigidBody('newBaseForKinova');
rb.Joint.setFixedTransform(trvec2tform([3,0,0]));
kinovaMoved.addBody(rb, 'base');
kinovaMoved.addSubtree('newBaseForKinova', kinova);
hold on;
xlim([-2 4])
zlim([0, 1.5])
kinovaMoved.show(kinovaMoved.randomConfiguration);
The result can be seen in the image below. Note that addSubtree does not preserve the Base of the rigidBodyTree object to be added - as a result, you can see that the Kinova arm's base mesh is missing, but everything else should not be affected.
To fix the visualization, you can call kinovaMoved.Base.addVisual(...) , if you have access to the mesh STL file.
  1 commentaire
Xingchen Li
Xingchen Li le 18 Déc 2020
Thanks Yiping! It's really helpful.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Robotics dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by