change base of rigidBodyTree like in SerialLink
조회 수: 28 (최근 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.
추가 답변 (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!