inverse kinematics solver problem

32 views (last 30 days)
Pranesh g
Pranesh g on 20 Jan 2020
hi
i am pranesh. I have been trying to implement inverse kinematic solver for my custom 7 DOF robotic arm. There are couple of issues that i face;
  1. the solution is incorrect when checked forward kinematic equation function that i created( this fk function has been tested multiple times), with significant offset
  2. each time i invoke a function the solution shifts by huge value
  3. Also i would like to elobrate on how weights affect the solution of the ik solver.
i have attached the code with the question;
function [jntangles] = dexik(tform)
dhparams=[125 pi/2 0 0;0 -pi/2 0 0;250 pi/2 0 0;0 -pi/2 0 0;
250 pi/2 0 0;0 -pi/2 0 0;100 0 0 0];
dextra = robotics.RigidBodyTree;
body1 = robotics.RigidBody('body1');
jnt1 = robotics.Joint('jnt1','revolute');
setFixedTransform(jnt1,dhparams(1,:),'dh');
body1.Joint = jnt1;
addBody(dextra,body1,'base')
body2 = robotics.RigidBody('body2');
jnt2 = robotics.Joint('jnt2','revolute');
body3 = robotics.RigidBody('body3');
jnt3 = robotics.Joint('jnt3','revolute');
body4 =robotics.RigidBody('body4');
jnt4 = robotics.Joint('jnt4','revolute');
body5 = robotics.RigidBody('body5');
jnt5 = robotics.Joint('jnt5','revolute');
body6 = robotics.RigidBody('body6');
jnt6 = robotics.Joint('jnt6','revolute');
body7 = robotics.RigidBody('body7');
jnt7 = robotics.Joint('jnt7','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');
setFixedTransform(jnt7,dhparams(7,:),'dh');
body2.Joint = jnt2;
body3.Joint = jnt3;
body4.Joint = jnt4;
body5.Joint = jnt5;
body6.Joint = jnt6;
body7.Joint = jnt7;
addBody(dextra,body2,'body1')
addBody(dextra,body3,'body2')
addBody(dextra,body4,'body3')
addBody(dextra,body5,'body4')
addBody(dextra,body6,'body5')
addBody(dextra,body7,'body6')
ik = robotics.InverseKinematics('RigidBodyTree',dextra);
ik.SolverParameters.AllowRandomRestarts = true;
ig=homeConfiguration(dextra);
weights=[0.25 0.25 0.25 1 1 1];
release(ik)
[QSOL, SOLINFO] = step(ik, 'body7', tform, weights, ig);
jntangles=struct2table(QSOL);
jntangles=table2array(jntangles(:,2));
jntangles=rad2deg(jntangles);
end

Answers (0)

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!