Problems with Analytical Inverse Kinematics, no valid kinematic group found
    4 views (last 30 days)
  
       Show older comments
    
Hi everyone,
I am trying to apply the "analyticalInverseKinematics " to a robot that I assembled. I tried to follow the matlab documentation instructions although with little success. 
As you can see, the problem is that no valid kinematic groups are found. What am I doing wrong?
Thanks in advance.
clear;close all;clc
%-----------------
% END-EFFECTOR   |
%-----------------
% EE Coordinates      % Base coordinates
x_EE = 9;             x_0 = 0; 
y_EE = 8;             y_0 = 0;  
z_EE = 3;             z_0 = 0;
% Angles (Euler)
ang_EE = [-6*pi/5 -3*pi/4 pi/6];
% Pose
d_0EE = [x_EE - x_0, y_EE - y_0, z_EE - z_0];
H_0EE = trvec2tform(d_0EE)*eul2tform(ang_EE, 'ZYX');
%-------------------
% ROBOT STRUCTURE  |
%-------------------
% Structure initializing
robot = rigidBodyTree('MaxNumBodies',7);
% Links 
% Lengths         % Bodies 
l_1  = 2.5;       link_1  = rigidBody('link1');
l_2  = 5;         link_2  = rigidBody('link2');
l_3  = 5;         link_3  = rigidBody('link3');
l_4  = 3.5;       link_4  = rigidBody('link4');
l_5  = 1.5;       link_5  = rigidBody('link5');
l_6  = 1.5;       link_6  = rigidBody('link6');
l_EE = 1;         link_EE = rigidBody('linkEE');
% Joints
jnt_0 = rigidBodyJoint('joint_0', 'revolute');
jnt_1 = rigidBodyJoint('joint_1', 'revolute');
jnt_2 = rigidBodyJoint('joint_2', 'revolute');
jnt_3 = rigidBodyJoint('joint_3', 'revolute');
jnt_4 = rigidBodyJoint('joint_4', 'revolute');
jnt_5 = rigidBodyJoint('joint_5', 'revolute');
jnt_6 = rigidBodyJoint('joint_6', 'revolute');
% Home configuration
setFixedTransform(jnt_0, trvec2tform([0 0 0]));
setFixedTransform(jnt_1, trvec2tform([0 0 l_1]));
setFixedTransform(jnt_2, trvec2tform([l_2 0 0]));
setFixedTransform(jnt_3, trvec2tform([0 0 -l_3]));
setFixedTransform(jnt_4, trvec2tform([l_4 0 0]));
setFixedTransform(jnt_5, trvec2tform([l_5 0 0]));
setFixedTransform(jnt_6, trvec2tform([l_6 0 0]));
% Robot assembly 
link_1.Joint  = jnt_0;
link_2.Joint  = jnt_1;
link_3.Joint  = jnt_2;
link_4.Joint  = jnt_3;
link_5.Joint  = jnt_4;
link_6.Joint  = jnt_5;
link_EE.Joint = jnt_6;
addBody(robot, link_1, 'base');
addBody(robot, link_2, 'link1');
addBody(robot, link_3, 'link2');
addBody(robot, link_4, 'link3');
addBody(robot, link_5, 'link4');
addBody(robot, link_6, 'link5');
addBody(robot, link_EE, 'link6');
show(robot);showdetails(robot)
%----------------------
% INVERSE KINEMATICS  |
%----------------------
ee_coord  = d_0EE;
ee_pose   = H_0EE;
aik       = analyticalInverseKinematics(robot);
opts      = showdetails(aik)
aik.KinematicGroup = opts(1).KinematicGroup;
disp(aik.KinematicGroup)
generateIKFunction(aik,'robotIK');
ik_config = robotIK(ee_pose);
%----------------------------
% GRAPHICAL REPRESENTATION  |
%----------------------------
show(robot, ik_config(1,:));
hold on
plotTransforms(ee_coord, ee_pose)
hold off
figure;
num_sol = size(ik_config, 1);
for i = 1:size(ik_config, 1)
    subplot(1, num_sol,i)
    show(robot, ik_config(i,:));
end

0 Comments
Answers (1)
  Varun
      
 on 25 Aug 2023
        Hi,
I understand you are trying to apply the "analyticalInverseKinematics " to the assembled robot but you get an error, no valid kinematic groups are found.
You can refer to similar question that got answered on MATLAB Answers: https://in.mathworks.com/matlabcentral/answers/688879-no-valid-kinematic-groups-were-found?s_tid=srchtitle
0 Comments
See Also
Categories
				Find more on Code Generation in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
