Is there a bug in show function of Robotics System Toolbox of 2021a version?
2 ビュー (過去 30 日間)
古いコメントを表示
It seems there is a bug in `show` function.
This is a simple robot model built using DH parameters.
dhparams = [0 pi/2 0 0;
0.4318 0 0 0
0.0203 -pi/2 0.15005 0;
0 pi/2 0.4318 0;
0 -pi/2 0 0;
0 0 0 0];
robot = rigidBodyTree;
body1 = rigidBody('body1');
jnt1 = rigidBodyJoint('jnt1','revolute');
setFixedTransform(jnt1,dhparams(1,:),'dh');
body1.Joint = jnt1;
addBody(robot,body1,'base')
body2 = rigidBody('body2');
jnt2 = rigidBodyJoint('jnt2','revolute');
body3 = rigidBody('body3');
jnt3 = rigidBodyJoint('jnt3','revolute');
body4 = rigidBody('body4');
jnt4 = rigidBodyJoint('jnt4','revolute');
body5 = rigidBody('body5');
jnt5 = rigidBodyJoint('jnt5','revolute');
body6 = rigidBody('body6');
jnt6 = rigidBodyJoint('jnt6','revolute');
setFixedTransform(jnt2,dhparams(2,:),'dh');
setFixedTransform(jnt3,dhparams(3,:),'dh');
setFixedTransform(jnt4,dhparams(4,:),'dh');
setFixedTransform(jnt5,dhparams(5,:),'dh');
setFixedTransform(jnt6,dhparams(6,:),'dh');
body2.Joint = jnt2;
body3.Joint = jnt3;
body4.Joint = jnt4;
body5.Joint = jnt5;
body6.Joint = jnt6;
addBody(robot,body2,'body1')
addBody(robot,body3,'body2')
addBody(robot,body4,'body3')
addBody(robot,body5,'body4')
addBody(robot,body6,'body5')
showdetails(robot)
show(robot);
axis([-0.5,0.5,-0.5,0.5,-0.5,0.5])
axis off
But there are something wrong with the figure ploted by show funciton: when I click the axis of some body, the arrow that shows the revolute direction is not coinside with the axis, just like this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/637245/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/637250/image.png)
When I click the body 3, is shows the z axis of body 2, and when I click the body2, it shows the z axis of body1.
So, is there a bug of show function? Because the show funciton in MATLAB 2020a is normal.
0 件のコメント
採用された回答
Yiping Liu
2021 年 6 月 1 日
So the plot from 20a (LEFT) is incorrect, and this bug has been fixed in 21a (the plot on the RIGHT shows the correct joint axis).
For a robot specified using DH parameters, when you click on body3, its rotation axis happens to be aligned with the z axis of body2's body frame.
0 件のコメント
その他の回答 (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!