# inverse kinematics matlab RVC for 3 joint RRR

Hi im having problem with Inverse kinematic using RVC toolbox in matlab for RRR manipulator.

 L_1 = 20;
L_2 = 50;
L_3 = 40;
L(1) = Link([0 L_1 0 pi/2]);
L(2) = Link([0 0 L_2 0]);
L(3) = Link([0 0 L_3 0]);
Robot.name = 'RRR_Robot';
T = [1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1];
J = Robot.ikine(T, [0,0,0], [1 1 1 0 0 0]) *180/pi;


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

Can somone explain me why my code is not working? / how to fix it ?

• While using J = Robot.ikine(T,'q0',[0,0,0],'mask',[1 1 1 0 0 0]) error does not apear but calculations are wrong Jan 26 '18 at 16:50

based on the documentation you shall use the mask option, see page 291.

The mask highlight what translation/orientation should be considered in the world frame. Are you sure that your RRR robot can move follow a trajectory which is specified by xyz ?

Also you ask the end-effector to go at the base of the robot that might not be physically possible ... Make sure that your goal position is comprised in the workspace. To do so the best is to use first forward kinematic with a reasonable joint configuration and then try to single to solve your issue with IK on the given position, this way you know that the goal is achievable and can play around with the parameter of th IK until you are satisfied.

I'm not sure what version of RTB you are using but you are missing the 'mask' keyword.

>> J = Robot.ikine(T, [0,0,0], 'mask', [1 1 1 0 0 0]) *180/pi
J =
0.0000  -40.5416 -157.6684


or more concisely:

>> J = Robot.ikine(T, [0,0,0], 'mask', [1 1 1 0 0 0], 'deg')
J =
0.0000   -0.7076   -2.7518


You'll get a quicker response by taking questions like this to http://tiny.cc/rvcforum