Error in using ikine()

157 views
Skip to first unread message

Vinay

unread,
Jan 4, 2022, 3:30:52 AM1/4/22
to Robotics & Machine Vision Toolboxes
Hello, I am trying to implement the inverse kinematics by inputting a transformation matrix, but I seem to have an issue with the ikine function.

Here is my code:

L1 = 4;
L2 = 3;
L3 = 2;

DH = [0 0 0 0; 0 0 L1 0; 0 0 L2 0];

L(1) = Link('revolute','d',DH(1,2),'a',DH(1,3),'alpha',DH(1,4));
L(2) = Link('revolute','d',DH(2,2),'a',DH(2,3),'alpha',DH(2,4));
L(3) = Link('revolute','d',DH(3,2),'a',DH(3,3),'alpha',DH(3,4));

M=[1 1 0 0 0 1]
Rob = SerialLink(L,'name','3R Planar Robot')


for i=1:4
    for j=1:4
        tr_matrix(i,j) = input("Enter the element " + i+","+j+" of transformation matrix: ");
    end
end

disp("The entered matrix is: ")
disp(tr_matrix)

inv = ikine(Rob,tr_matrix,'mask',M)


Here are the errors that are being displayed after I enter the transformation matrix:

The entered matrix is:
     1     0     0     9
     0     1     0     0
     0     0     1     0
     0     0     0     1


Warning: ikine: rejected-step limit 100 exceeded (pose 1), final err 2
> In SerialLink/ikine (line 245)
  In Ex_4b (line 24)
Warning: failed to converge: try a different initial value of joint coordinates
> In SerialLink/ikine (line 274)
  In Ex_4b (line 24)

inv =

     []


Can anyone please review my code and help me? 

Thank you


Mason Rhodes

unread,
Jul 20, 2022, 2:26:41 PM7/20/22
to Robotics & Machine Vision Toolboxes

Did you ever find a solution? I am having the same problem using phantom joints to offset my model.
Reply all
Reply to author
Forward
0 new messages