Home > arte3.2.0 > tools > drawrobot3d_par.m_bak.m

drawrobot3d_par.m_bak

PURPOSE ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

SYNOPSIS ^

function drawrobot3d_par(robot, q, noclear)

DESCRIPTION ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DRAWROBOT3D_par(ROBOT, Q)    
 3D drawing with DH reference systems for a parallel robot.
 The parallel robot is divided into different serial arms, drawn altogether
 
 If the robot possesses 3D graphics, the function DRAW_LINK is called to represent
 the link in 3D. Otherwise a line connecting each consecutive reference
 system is plotted.

 See also DRAWROBOT3D, DENAVIT, DIRECTKINEMATIC, DRAW_LINK.

   Author: Arturo Gil. Universidad Miguel Hern�ndez de Elche.
   email: arturo.gil@umh.es date:   05/02/2012
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0002 % DRAWROBOT3D_par(ROBOT, Q)
0003 % 3D drawing with DH reference systems for a parallel robot.
0004 % The parallel robot is divided into different serial arms, drawn altogether
0005 %
0006 % If the robot possesses 3D graphics, the function DRAW_LINK is called to represent
0007 % the link in 3D. Otherwise a line connecting each consecutive reference
0008 % system is plotted.
0009 %
0010 % See also DRAWROBOT3D, DENAVIT, DIRECTKINEMATIC, DRAW_LINK.
0011 %
0012 %   Author: Arturo Gil. Universidad Miguel Hern�ndez de Elche.
0013 %   email: arturo.gil@umh.es date:   05/02/2012
0014 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0015 
0016 % Copyright (C) 2012, by Arturo Gil Aparicio
0017 %
0018 % This file is part of ARTE (A Robotics Toolbox for Education).
0019 %
0020 % ARTE is free software: you can redistribute it and/or modify
0021 % it under the terms of the GNU Lesser General Public License as published by
0022 % the Free Software Foundation, either version 3 of the License, or
0023 % (at your option) any later version.
0024 %
0025 % ARTE is distributed in the hope that it will be useful,
0026 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0027 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0028 % GNU Lesser General Public License for more details.
0029 %
0030 % You should have received a copy of the GNU Leser General Public License
0031 % along with ARTE.  If not, see <http://www.gnu.org/licenses/>.
0032 function drawrobot3d_par(robot, q, noclear)
0033 %global configuration
0034 
0035 %origin=[0 0 0];
0036 endpoints=[];
0037 %draw every arm considered in the parallel mechanism
0038 k=1;
0039 for i=1:robot.nserial,
0040     r=eval(sprintf('robot.robot%d',i));
0041     
0042     fi=q(k:(k+r.DOF-1));
0043     k=k+r.DOF;
0044     drawrobot3d(r,fi,0);
0045     
0046     T=eval(sprintf('directkinematic(robot.robot%d, fi)',i));
0047     destination=T(1:3,4);
0048     endpoints = [endpoints destination];   
0049        
0050 end
0051 %Add the first point
0052 endpoints = [endpoints endpoints(:,1)];
0053 
0054 %now, draw a line between the end points including the first
0055 for i=1:robot.nserial,
0056     origin=endpoints(:,i);
0057     destination=endpoints(:,i+1);
0058     line([origin(1) destination(1)],[origin(2) destination(2)],[origin(3) destination(3)], 'Color',  'k' ,'LineWidth', 3 );     
0059 end
0060 
0061

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