Codigo De Matlab Para Un Brazo Robotico
Enviado por kano1993 • 16 de Abril de 2014 • 720 Palabras (3 Páginas) • 761 Visitas
CODIGO DE BRAZO ROBOTICO
ax = axes('XLim',[-200 500],'YLim',[-200 200],'ZLim',[-10 500]);
view(3); grid on; axis equal
t(1)=hgtransform('Parent',ax);
t(2)=hgtransform('parent',t(1));
t(3)=hgtransform('parent',t(2));
t(4)=hgtransform('parent',t(3));
t(5)=hgtransform('parent',t(4));
t(6)=hgtransform('parent',t(5));
t(7)=hgtransform('parent',t(6));
[ V,C ] = cualquierprisma( 100,4,80 );
patch('vertices',V,'faces',C,'FaceColor',[.3 .8 .5],'Parent',t(1));
T = makehgtform ('translate',[0,0,0]);
set(t(1),'matrix',T);
[ V,C ] = cualquierprisma( 30,50,10 );
patch('vertices',V,'faces',C,'FaceColor',[.2 .8 .9],'Parent',t(2));
T1 = makehgtform ('translate',[0,0,80]);
set(t(2),'matrix',T1);
[ V,C ] = cualquierprisma( 15,4,300 );
patch('vertices',V,'faces',C,'FaceColor',[.4 .4 .1],'Parent',t(3));
T2 = makehgtform ('translate',[0,0,10]);
set(t(3),'matrix',T2);
G=1/4*pi;
E=makehgtform('zrotate',G);
set(t(5),'matrix',T4*E);
[ V,C ] = cualquierprisma( 20,50,30 );
patch('vertices',V,'faces',C,'FaceColor',[.5 .6 .1],'Parent',t(4));
T3 = makehgtform ('translate',[0,15,300]);
set(t(4),'matrix',T3);
G=1/2*pi;
E=makehgtform('xrotate',G);
set(t(4),'matrix',T3*E);
[ V,C ] = cualquierprisma( 15,4,200 );
patch('vertices',V,'faces',C,'FaceColor',[.5 .6 .1],'Parent',t(5));
T4 = makehgtform ('translate',[0,0,15]);
set(t(5),'matrix',T4);
G=1/2*pi;
E=makehgtform('yrotate',G);
set(t(5),'matrix',T4*E);
[ V,C ] = cualquierprisma( 15,4,100 );
patch('vertices',V,'faces',C,'FaceColor',[.5 .6 .1],'Parent',t(6));
T5 = makehgtform ('translate',[0,0,185]);
set(t(6),'matrix',T5);
G=1/2*pi;
E=makehgtform('xrotate',G);
set(t(6),'matrix',T5*E);
for r = 1:.006:(2*pi)*5
Rz = makehgtform('zrotate',r);
%Rx = makehgtform('xrotate',r);
set(t(2),'Matrix',T*T1*Rz)
%set(t(6),'Matrix',T4*T5*Rz)
...