필터 지우기
필터 지우기

frames not appearing using robotics system toolbox

조회 수: 12 (최근 30일)
emile dimas
emile dimas 2019년 10월 15일
댓글: Alfredo Rodriguez Diaz 2020년 3월 29일
Hi all,
I am using the rotics system toolbox and I want to create a robot , when I display my robot, there are no frames unlike the tutorial.
Does anyone know what is happening please and how I can fix it
here is my code:
clear all; clc;
dh=[0 60 0 pi/2;
0 0 -315 0;
0 0 -310 0 ;
0 0 -75 -pi/2];
body1 = rigidBody('body1');
jnt1 = rigidBodyJoint('jnt1','revolute');
jnt1.HomePosition = 0;
tform = dh2homogene(dh(1,:)); % function that gets the homegenous transformation given the denavit hartenberg table/row
setFixedTransform(jnt1,tform);
body1.Joint = jnt1;
robot = rigidBodyTree;
% body1.Mass = .5;
% body1.CenterOfMass = [0.5 0 0];% p/r au centre du link selon (x,y,z)
% body1.Inertia = [0.167 0.001 0.167 0 0 0];
%
addBody(robot,body1,'base')
body2 = rigidBody('body2');
jnt2 = rigidBodyJoint('jnt2','revolute');
jnt2.HomePosition = pi/6; % User defined
tform2 = dh2homogene(dh(2,:)); % User defined
setFixedTransform(jnt2,tform2);
body2.Joint = jnt2;% body2.Mass = .585;
% body2.CenterOfMass = [0 0 0];% p/r au centre du link selon (x,y,z)
% body2.Inertia = 0.0001*[4 4 4 0 0 0];
addBody(robot,body2,'body1'); % Add body2 to body1
body3 = rigidBody('body3');
body4 = rigidBody('body4');
jnt3 = rigidBodyJoint('jnt3','revolute');
jnt4 = rigidBodyJoint('jnt4','revolute');
tform3 = dh2homogene(dh(3,:)); % User defined
tform4 = dh2homogene(dh(4,:)); % User defined
setFixedTransform(jnt3,tform3);
setFixedTransform(jnt4,tform4);
jnt3.HomePosition = 0; % User defined
body3.Joint = jnt3;
body4.Joint = jnt4;
% % adding dynamics props
%
%
% body3.Mass = .55;
% body3.CenterOfMass = [0 0 0];% p/r au centre du link selon (x,y,z)
% body3.Inertia = 0.0001*[4 4 4 0 0 0];
%
% body4.Mass = .032;
% body4.CenterOfMass = [0 0 0];% p/r au centre du link selon (x,y,z)
% body4.Inertia = 0.0001*[4 4 4 0 0 0];
addBody(robot,body3,'body2'); % Add body3 to body2
addBody(robot,body4,'body3'); % Add body4 to body3
bodyEndEffector = rigidBody('endeffector');
tform5 = trvec2tform([0, 0, 0]); % User defined
setFixedTransform(bodyEndEffector.Joint,tform5);
addBody(robot,bodyEndEffector,'body4');
config = homeConfiguration(robot);
% tform = getTransform(robot,config,'endeffector','base');
% save('robot')
show(robot)

채택된 답변

Sebastian Castro
Sebastian Castro 2019년 11월 12일
Maybe the frames have a default size that is much smaller than the robot. If you divide the distance values of the DH parameters by say 1000, do the frames show up?
- Sebastian
  댓글 수: 2
emile dimas
emile dimas 2019년 11월 12일
thank you Sebastien, it worked!!
Alfredo Rodriguez Diaz
Alfredo Rodriguez Diaz 2020년 3월 29일
I would have expected this to be automatic.
This worked. Thanks a lot!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Manipulator Modeling에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by