![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/464515/image.png)
change base of rigidBodyTree like in SerialLink
16 次查看(过去 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
0 个评论
采纳的回答
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/464515/image.png)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Robotics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!