Home > arte3.2.0 > RAPID > programs > test_configurations.m

test_configurations

PURPOSE ^

IN ORDER TO SIMULATE THE PROGRAM:

SYNOPSIS ^

function test_configurations

DESCRIPTION ^

 IN ORDER TO SIMULATE THE PROGRAM:
   A) FIRST, LOAD A ROBOT
       robot = load_robot('abb','irb140');
   
 The example presents the robot achieving the same position and
 orientation in space with eight different possible configurations.
 
 This program is equivalent to test_config.prg. Just execute matlab2RAPID
 and select test_configurations.m to obtain it. You may delete some Matlab
 expressions that cannot be converted to RAPID.

 Have a look to this video that represents the execution in Matlab and the
 execution in the real controller:

 http://www.youtube.com/watch?v=4HepUzuVyUs&list=PLClKgnzRFYe72qDYmj5CRpR9ICNnQehup&index=27

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % IN ORDER TO SIMULATE THE PROGRAM:
0002 %   A) FIRST, LOAD A ROBOT
0003 %       robot = load_robot('abb','irb140');
0004 %
0005 % The example presents the robot achieving the same position and
0006 % orientation in space with eight different possible configurations.
0007 %
0008 % This program is equivalent to test_config.prg. Just execute matlab2RAPID
0009 % and select test_configurations.m to obtain it. You may delete some Matlab
0010 % expressions that cannot be converted to RAPID.
0011 %
0012 % Have a look to this video that represents the execution in Matlab and the
0013 % execution in the real controller:
0014 %
0015 % http://www.youtube.com/watch?v=4HepUzuVyUs&list=PLClKgnzRFYe72qDYmj5CRpR9ICNnQehup&index=27
0016 %
0017 function test_configurations
0018 
0019 %global JT_q1 JT_q2 JT_q3 JT_q4 JT_q5 JT_q6 JT_q7 JT_q8
0020 global RT_tp1 RT_tp2 RT_tp3 RT_tp4 RT_tp5 RT_tp6 RT_tp7 RT_tp8 TD_tool0 robot
0021 
0022 
0023 % T =[0.0    0.0    1.0    0.5150;
0024 %    0.0   1.0   0.0    0.2000
0025 %    -1.0   0.0   0.0    0.7120
0026 %     0         0         0    1.0];
0027 %
0028 % q_inv=inversekinematic(robot, T);
0029 
0030 %definition of the end effector.
0031 TD_tool0=[1,[[0,0,0],[1,0,0,0]],[0,[0,0,0],[1,0,0,0],0,0,0]];
0032 
0033 %JT_q1=[[23.9625,6.7721,-7.1508,90.852,-23.9653,-90.9324],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]*pi/180;
0034 
0035 RT_tp1=[[0.515,0.200,0.712],[0.7071,0,0.7071,0],[0,1,-2,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
0036 RT_tp2=[[0.515,0.200,0.712],[0.7071,0,0.7071,0],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
0037 RT_tp3=[[0.515,0.200,0.712],[0.7071,0,0.7071,0],[0,1,-2,3],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
0038 RT_tp4=[[0.515,0.200,0.712],[0.7071,0,0.7071,0],[0,-1,0,2],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
0039 RT_tp5=[[0.515,0.200,0.712],[0.7071,0,0.7071,0],[-2,-1,-2,5],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
0040 RT_tp6=[[0.515,0.200,0.712],[0.7071,0,0.7071,0],[-2,1,0,4],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
0041 RT_tp7=[[0.515,0.200,0.712],[0.7071,0,0.7071,0],[-2,-1,-2,7],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
0042 RT_tp8=[[0.515,0.200,0.712],[0.7071,0,0.7071,0],[-2,1,0,6],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
0043 
0044 main
0045 end
0046 
0047 function main
0048 %global JT_q1 JT_q2 JT_q3 JT_q4 JT_q5 JT_q6 JT_q7 JT_q8
0049 global RT_tp1 RT_tp2 RT_tp3 RT_tp4 RT_tp5 RT_tp6 RT_tp7 RT_tp8 TD_tool0 robot
0050 
0051 
0052 MoveJ(RT_tp1, 'vmax' , 'fine' , TD_tool0, 'wobj0');
0053 MoveJ(RT_tp2, 'vmax' , 'fine' , TD_tool0, 'wobj0');
0054 MoveJ(RT_tp3, 'vmax' , 'fine' , TD_tool0, 'wobj0');
0055 MoveJ(RT_tp4, 'vmax' , 'fine' , TD_tool0, 'wobj0');
0056 MoveJ(RT_tp5, 'vmax' , 'fine' , TD_tool0, 'wobj0');
0057 MoveJ(RT_tp6, 'vmax' , 'fine' , TD_tool0, 'wobj0');
0058 MoveJ(RT_tp7, 'vmax' , 'fine' , TD_tool0, 'wobj0');
0059 MoveJ(RT_tp8, 'vmax' , 'fine' , TD_tool0, 'wobj0');
0060   
0061 
0062 end

Generated on Fri 03-Jan-2014 12:20:01 by m2html © 2005