change base of rigidBodyTree like in SerialLink

15 ビュー (過去 30 日間)
Xingchen Li
Xingchen Li 2020 年 12 月 17 日
コメント済み: Xingchen Li 2020 年 12 月 18 日
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

採用された回答

Yiping Liu
Yiping Liu 2020 年 12 月 18 日
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 件のコメント
Xingchen Li
Xingchen Li 2020 年 12 月 18 日
Thanks Yiping! It's really helpful.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeManipulator Modeling についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by