change base of rigidBodyTree like in SerialLink

36 次查看(过去 30 天)
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Robotics 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by