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