error in using 'ikine' command in 'twolink' robot

1,520 views
Skip to first unread message

javidx...@gmail.com

unread,
Jul 26, 2017, 5:39:55 PM7/26/17
to Robotics & Machine Vision Toolboxes
Hello Peter,
I am using MATLAB 2017a;
In page 149 and 150 of the book, I am unable to use the code 
>> q = twolink.ikine(T, [0 0], [1 1 0 0 0 0])
And it does give an error in line 164 whose description is: "Number of robot DOF must be >= the same number of 1s in the mask
matrix".
I would appreciate if you solve the problem.
Regards

Erik van Oene

unread,
Jul 26, 2017, 6:06:49 PM7/26/17
to Robotics & Machine Vision Toolboxes
Hi Jarvid,

your mask parameter is not properly handled in this way....

please use:

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

This could be found quite easily by using:
help seriallink.ikine
OR
use the Matlab debugger next time you run into an error like this... You would have found that ikine() was using the default mask of [ 1 1 1 1 1 1 ].

Erik


Op woensdag 26 juli 2017 23:39:55 UTC+2 schreef javid rabbani:

Bruce Liang

unread,
Jun 11, 2018, 7:37:06 PM6/11/18
to Robotics & Machine Vision Toolboxes

I have the same problem as your!
>> q = twolink.ikine(T, [0 0], [1 1 0 0 0 0])
warning: Initial joint configuration results in a (near-)singular configuration, this may slow convergence 
> In SerialLink.ikine at 156 
warning: ikine: iteration limit 1000 exceeded (row 1), final err 0.523502 
> In SerialLink.ikine at 179 

q =

   1.0e+15 *

    2.9396    1.4698

Peter Corke

unread,
Jun 17, 2018, 8:22:28 AM6/17/18
to Robotics & Machine Vision Toolboxes
You don't specify the value of T.  As per the documentation this robot moves in the xz-plane so be sure to give a pose that is reachable.  Using RTB10:

>> T=SE3(.5, 0, .5)
T = 
         1         0         0       0.5
         0         1         0         0
         0         0         1       0.5
         0         0         0         1
>> q = twolink.ikine(T, [0 0], 'mask', [1 1 0 0 0 0])
q =
   -0.4240    2.4189
Reply all
Reply to author
Forward
0 new messages