how to create a robot from DH parameters
Hello,
I have the DH matrix of my robot manipulator.
[0.033 -pi/2 0.147 q1;
0.155 0 0 q2-pi/2;
0.135 0 0 q3;
0 pi/2 0 q4+pi/2;
0 0 0.218 q5];
I am trying to create a model of the robot along what’s used here:
https://www.mathworks.com/help/robotics/ref/rigidbodytree.html#d122e13383
the forward kinematics function getTransform() doesn’t return the right Homogeneous transormation matrix, which means the model isn’t correct.
the code I wrote:
dhparams=[0.033 -pi/2 0.147 0;
0.155 0 0 -pi/2;
0.135 0 0 0;
0 pi/2 0 pi/2;
0 0 0.218 0];
robot = rigidBodyTree(‘DataFormat’,’row’);
body1 = rigidBody(‘body1’);
jnt1 = rigidBodyJoint(‘jnt1′,’revolute’);
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’);
;
setFixedTransform(jnt1,dhparams(1,:),’dh’);
setFixedTransform(jnt2,dhparams(2,:),’dh’);
setFixedTransform(jnt3,dhparams(3,:),’dh’);
setFixedTransform(jnt4,dhparams(4,:),’dh’);
setFixedTransform(jnt5,dhparams(5,:),’dh’);
body1.Joint = jnt1;
body2.Joint = jnt2;
body3.Joint = jnt3;
body4.Joint = jnt4;
body5.Joint = jnt5;
addBody(robot,body1,’base’)
addBody(robot,body2,’body1′)
addBody(robot,body3,’body2′)
addBody(robot,body4,’body3′)
addBody(robot,body5,’body4′)
transform = getTransform(robot,[0.1 0.1 0.1 0.1 0.1],’body5′)Hello,
I have the DH matrix of my robot manipulator.
[0.033 -pi/2 0.147 q1;
0.155 0 0 q2-pi/2;
0.135 0 0 q3;
0 pi/2 0 q4+pi/2;
0 0 0.218 q5];
I am trying to create a model of the robot along what’s used here:
https://www.mathworks.com/help/robotics/ref/rigidbodytree.html#d122e13383
the forward kinematics function getTransform() doesn’t return the right Homogeneous transormation matrix, which means the model isn’t correct.
the code I wrote:
dhparams=[0.033 -pi/2 0.147 0;
0.155 0 0 -pi/2;
0.135 0 0 0;
0 pi/2 0 pi/2;
0 0 0.218 0];
robot = rigidBodyTree(‘DataFormat’,’row’);
body1 = rigidBody(‘body1’);
jnt1 = rigidBodyJoint(‘jnt1′,’revolute’);
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’);
;
setFixedTransform(jnt1,dhparams(1,:),’dh’);
setFixedTransform(jnt2,dhparams(2,:),’dh’);
setFixedTransform(jnt3,dhparams(3,:),’dh’);
setFixedTransform(jnt4,dhparams(4,:),’dh’);
setFixedTransform(jnt5,dhparams(5,:),’dh’);
body1.Joint = jnt1;
body2.Joint = jnt2;
body3.Joint = jnt3;
body4.Joint = jnt4;
body5.Joint = jnt5;
addBody(robot,body1,’base’)
addBody(robot,body2,’body1′)
addBody(robot,body3,’body2′)
addBody(robot,body4,’body3′)
addBody(robot,body5,’body4′)
transform = getTransform(robot,[0.1 0.1 0.1 0.1 0.1],’body5′) Hello,
I have the DH matrix of my robot manipulator.
[0.033 -pi/2 0.147 q1;
0.155 0 0 q2-pi/2;
0.135 0 0 q3;
0 pi/2 0 q4+pi/2;
0 0 0.218 q5];
I am trying to create a model of the robot along what’s used here:
https://www.mathworks.com/help/robotics/ref/rigidbodytree.html#d122e13383
the forward kinematics function getTransform() doesn’t return the right Homogeneous transormation matrix, which means the model isn’t correct.
the code I wrote:
dhparams=[0.033 -pi/2 0.147 0;
0.155 0 0 -pi/2;
0.135 0 0 0;
0 pi/2 0 pi/2;
0 0 0.218 0];
robot = rigidBodyTree(‘DataFormat’,’row’);
body1 = rigidBody(‘body1’);
jnt1 = rigidBodyJoint(‘jnt1′,’revolute’);
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’);
;
setFixedTransform(jnt1,dhparams(1,:),’dh’);
setFixedTransform(jnt2,dhparams(2,:),’dh’);
setFixedTransform(jnt3,dhparams(3,:),’dh’);
setFixedTransform(jnt4,dhparams(4,:),’dh’);
setFixedTransform(jnt5,dhparams(5,:),’dh’);
body1.Joint = jnt1;
body2.Joint = jnt2;
body3.Joint = jnt3;
body4.Joint = jnt4;
body5.Joint = jnt5;
addBody(robot,body1,’base’)
addBody(robot,body2,’body1′)
addBody(robot,body3,’body2′)
addBody(robot,body4,’body3′)
addBody(robot,body5,’body4′)
transform = getTransform(robot,[0.1 0.1 0.1 0.1 0.1],’body5′) manipulators, rigidbody, forward kinematics, rigidbodytree MATLAB Answers — New Questions