Problem with ikine().

700 views
Skip to first unread message

Za

unread,
Nov 13, 2017, 1:45:38 PM11/13/17
to Robotics & Machine Vision Toolboxes
Hello. I am trying to build a simple 2DOF robot and I keep getting the same error:

Error using SerialLink/ikine (line 164)
Number of robot DOF must be >= the same number of 1s in the mask matrix

Error in zac (line 10)
q = R.ikine(T, [0 0], [1 1 0 0 0 0])

I don't know what else to try. I have tried changing the mask matrix and it didn't help. I tried different examples with 3 or 4 Links and it still didn't work.

L(1) = Link([0, 0, 256, 0]);
L(2) = Link([0, 0, 123, 0]);

R = SerialLink(L)

R.plot([0.4, 0.3]);
R.teach()

T = transl(0.4, 0.5, 0.6);
q = R.ikine(T, [0 0], [1 1 0 0 0 0])
 

Peter Corke

unread,
Nov 13, 2017, 5:59:55 PM11/13/17
to Robotics & Machine Vision Toolboxes
This has come up a few times recently, you are not using the function as per the documentation.  The syntax is:

q = R.ikine(T, [0 0], 'mask', [1 1 0 0 0 0])

Why do you think the 'mask' option is not required?  If you are using the first edition of RVC book then please use RTB9.10 not RTB10.

Peter

Za

unread,
Nov 14, 2017, 5:33:12 AM11/14/17
to Robotics & Machine Vision Toolboxes
Thank you. I see now that I read the documentation poorly. All the examples I came across were written without 'mask' and it didn't occur to me that whoever wrote them was using older version of RTB. In the future I will read the documentation more thoroughly. Thank you again. 

Satyendra kumar

unread,
Apr 1, 2018, 11:45:46 AM4/1/18
to Robotics & Machine Vision Toolboxes

Dear Peter Sir,

I am working with 2R,3R inverse kinematics problem.

I am facing this problem.

 

 

log

Warning: ikine: rejected-step limit 100

exceeded (pose 1), final err 0.224109 

> In SerialLink/ikine (line 244)

  In threedof>invbutton_Callback (line 281)

  In gui_mainfcn (line 95)

  In threedof (line 42)

  In @(hObject,eventdata)threedof('invbutton_Callback',hObject,eventdata,guidata(hObject)) 

Warning: failed to converge: try a

different initial value of joint

coordinates 

> In SerialLink/ikine (line 273)

  In threedof>invbutton_Callback (line 281)

  In gui_mainfcn (line 95)

  In threedof (line 42)

  In @(hObject,eventdata)threedof('invbutton_Callback',hObject,eventdata,guidata(hObject)) 

 

Here is my button callback for 3R robot

 

px = str2double(handles.edit4.String);

py = str2double(handles.edit5.String);

pz = str2double(handles.edit6.String);

 

L1_1 = 020; L2_2 = 050;L3_3 = 040;

L(1) = Link([0 ;L1_1 ; 0; pi/2]);

L(2) = Link([0 ; 0 ;L2_2 ; 0]);

L(3) = Link([0 ; 0 ;L3_3 ; 0]);

 

Robot = SerialLink(L);

Robot.name  = '3DOFRobot';

 

T = [1 0 0 px;

      0 1 0 py; 

      0 0 1 pz ;

      0 0 0 1];

 

Q0 = [0 -pi/2 pi/2];

QF = Robot.ikine(T, Q0, 'mask',[1 1 1 0 0 0]) * 180/pi;

 

I faced same problem for 2R also.

 

q = Robot.ikine(T, [0 0], 'mask', [1 1 0 0 0 0])

 

My work setup

8.5.0.197613 (R2015a)

Robotics Toolbox for MATLAB (release 10.2)

Shall i switch to RTB9.10.

Peter Corke

unread,
Apr 1, 2018, 9:49:33 PM4/1/18
to Robotics & Machine Vision Toolboxes
Inverse kinematics for under actuated arms is tricky.  Have a look at the FAQ or talk to your professor.
Reply all
Reply to author
Forward
0 new messages