SCRIPT TO TEST THE KINEMATICS OF THE 5R robot Copyright (C) 2012, by Arturo Gil Aparicio This file is part of ARTE (A Robotics Toolbox for Education). ARTE is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ARTE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Leser General Public License along with ARTE. If not, see <http://www.gnu.org/licenses/>.
0001 % 0002 % SCRIPT TO TEST THE KINEMATICS OF THE 5R robot 0003 % 0004 % Copyright (C) 2012, by Arturo Gil Aparicio 0005 % 0006 % This file is part of ARTE (A Robotics Toolbox for Education). 0007 % 0008 % ARTE is free software: you can redistribute it and/or modify 0009 % it under the terms of the GNU Lesser General Public License as published by 0010 % the Free Software Foundation, either version 3 of the License, or 0011 % (at your option) any later version. 0012 % 0013 % ARTE is distributed in the hope that it will be useful, 0014 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0015 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0016 % GNU Lesser General Public License for more details. 0017 % 0018 % You should have received a copy of the GNU Leser General Public License 0019 % along with ARTE. If not, see <http://www.gnu.org/licenses/>. 0020 0021 close all 0022 0023 %load the robot 0024 %the robot is represented (interiorly) by two planar 2dof arms 0025 robot=load_robot('example','5R'); 0026 0027 adjust_view(robot) 0028 0029 0030 %Represent a final point in space that will be achieved by the end effector 0031 %P=[Px, Py]=[0.6 0.4] 0032 T=eye(4); 0033 T(1,4)=1.0;%change, for example, to 1.25 0034 %T(2,4)=0.967; %change, for example to 0.967 0035 T(2,4)=0.8; %change, for example to 0.967 0036 0037 %find 4 solutions for the INVERSE KINEMATIC in position 0038 q=inversekinematic(robot, T) 0039 0040 drawrobot3d(robot, q(:,1)), pause(2); 0041 drawrobot3d(robot, q(:,2)), pause(2); 0042 drawrobot3d(robot, q(:,3)), pause(2); 0043 drawrobot3d(robot, q(:,4)), pause(2); 0044 close all 0045 %now solve the DIRECTKINEMATIC problem for each of the above computed 0046 % q 0047 for i=1:4, 0048 drawrobot3d(robot, q(:,i)) 0049 figure, 0050 % 1 and 3 correspond to the joint variables of the robot 0051 T=directkinematic(robot, [q(1,i) q(3,i)]) 0052 pause(2); 0053 close all 0054 end