586 lines
18 KiB
HTML
586 lines
18 KiB
HTML
<html><head><title>VRML Preparation for Robot Simulation/es</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link type='text/css' href='wiki.css' rel='stylesheet'></head><body><h1>VRML Preparation for Robot Simulation/es</h1></div>
|
||
|
||
<div id="mw-content-text" lang="es" dir="ltr" class="mw-content-ltr"><hr/>
|
||
<div class="mw-parser-output"><table class="fcinfobox wikitable ct" style="width: 230px; float: right; margin-left: 1em">
|
||
<tr>
|
||
<td class="ctTitle">
|
||
<h3><span class="mw-headline" id="Tutorial"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Base_ExampleCommandModel.png" class="image"><img alt="Base ExampleCommandModel.png" src="32px-Base_ExampleCommandModel.png" width="32" height="30" srcset="/wiki/images/thumb/9/93/Base_ExampleCommandModel.png/48px-Base_ExampleCommandModel.png 1.5x, /wiki/images/9/93/Base_ExampleCommandModel.png 2x" /></a> Tutorial</span></h3>
|
||
</td></tr>
|
||
<tr>
|
||
<th class="ctOdd">Tema
|
||
</th></tr>
|
||
<tr>
|
||
<td class="ctEven">Robot Workbench
|
||
</td></tr>
|
||
<tr>
|
||
<th class="ctOdd">Nivel
|
||
</th></tr>
|
||
<tr>
|
||
<td class="ctEven">Intermediate
|
||
</td></tr>
|
||
<tr>
|
||
<th class="ctOdd">Tiempo para completar
|
||
</th></tr>
|
||
<tr>
|
||
<td class="ctEven">
|
||
</td></tr>
|
||
<tr>
|
||
<th class="ctOdd">Autor
|
||
</th></tr>
|
||
<tr>
|
||
<td class="ctEven">
|
||
</td></tr>
|
||
<tr>
|
||
<th class="ctOdd">Versión de FreeCAD
|
||
</th></tr>
|
||
<tr>
|
||
<td class="ctEven">
|
||
</td></tr>
|
||
<tr>
|
||
<th class="ctOdd">Archivo(s) de ejemplo(s)
|
||
</th></tr>
|
||
<tr>
|
||
<td class="ctEven">
|
||
</td></tr>
|
||
<tr>
|
||
<td class="ctToc"><br /><div id="toc" class="toc"><div class="toctitle"><h2>Contents</h2></div>
|
||
<ul>
|
||
<li class="toclevel-1"><a href="#Tutorial"><span class="tocnumber">1</span> <span class="toctext">Tutorial</span></a></li>
|
||
<li class="toclevel-1 tocsection-1"><a href="#Abrir_un_archivo_o_crear_uno_con_FreeCAD"><span class="tocnumber">2</span> <span class="toctext">Abrir un archivo o crear uno con FreeCAD</span></a></li>
|
||
<li class="toclevel-1 tocsection-2"><a href="#Measure_geometric_characteristics"><span class="tocnumber">3</span> <span class="toctext">Measure geometric characteristics</span></a></li>
|
||
<li class="toclevel-1 tocsection-3"><a href="#Exportar_a_VRML"><span class="tocnumber">4</span> <span class="toctext">Exportar a VRML</span></a></li>
|
||
<li class="toclevel-1 tocsection-4"><a href="#Preparaci.C3.B3n_del_archivo_VRML"><span class="tocnumber">5</span> <span class="toctext">Preparación del archivo VRML</span></a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
</td></tr></table>
|
||
<p><br />
|
||
</p><p><br />
|
||
Este tutorial explica como utilizar FreeCAD y el entorno de simulación de Robots para simular los movimientos de un robot de 6 ejes. <b>El tutorial se centra en la creación de un archivo VRML</b> utilizado como visualización. La base del archivo VRML es el modelo de FreeCAD. La versión de FreeCAD utilizada es 0.11.4252ppa1 en Ubuntu 32bit.
|
||
</p>
|
||
<h2><span class="mw-headline" id="Abrir_un_archivo_o_crear_uno_con_FreeCAD">Abrir un archivo o crear uno con FreeCAD</span></h2>
|
||
<p>El tutorial está basado en un archivo STEP de un Stäubli TX40 (TX40-HB.stp). Puedes descargar el archivo de <a rel="nofollow" class="external free" href="https://secure.staubli.com/Intranet_Applications/Robotics/Group/RobDoc.nsf/ea05b3f4b301f597c1256d5f005665e8/bc3707ec036c9f6bc12576c700327958/$FILE/page.html">https://secure.staubli.com/Intranet_Applications/Robotics/Group/RobDoc.nsf/ea05b3f4b301f597c1256d5f005665e8/bc3707ec036c9f6bc12576c700327958/$FILE/page.html</a>. Sin embargo, aunque aún no he tenido tiempo para comprobarlo, el método debería también aplicarse a un modelo creado completamente en FreeCAD.
|
||
Después de abrir el archivo deberías tener esto:
|
||
</p><p><a href="https://www.freecadweb.org/wiki/index.php?title=File:Staeubli_step_import.png" class="image"><img alt="Staeubli step import.png" src="1024px-Staeubli_step_import.png" width="1024" height="587" srcset="/wiki/images/f/f6/Staeubli_step_import.png 1.5x" /></a>
|
||
</p><p>Observa, que en la importación, el robot es creado en 8 formas, directamente en la raíz del árbol del documento. La estructura del archivo VRML exportado debe cambiarse si se utilizan grupos. Las formas están ordenadas desde la base a la herramienta. La última forma contiene los ejes de rotación de todos los ejes del robot. Los nombres de las formas son dados de forma correlativa (de momento, marzo de 2011, FreeCAD no importa los nombres incluidos en los archivos STEP):
|
||
</p>
|
||
<table class="wikitable">
|
||
|
||
<tr>
|
||
<th> FreeCAD name
|
||
</th>
|
||
<th> STEP name
|
||
</th></tr>
|
||
<tr>
|
||
<td> TX40_HB
|
||
</td>
|
||
<td>HORIZONTAL BASE CABLE OUTLET
|
||
</td></tr>
|
||
<tr>
|
||
<td> TX40_HB001
|
||
</td>
|
||
<td> SHOULDER
|
||
</td></tr>
|
||
<tr>
|
||
<td> TX40_HB002
|
||
</td>
|
||
<td> ARM
|
||
</td></tr>
|
||
<tr>
|
||
<td> TX40_HB003
|
||
</td>
|
||
<td> ELBOW
|
||
</td></tr>
|
||
<tr>
|
||
<td> TX40_HB004
|
||
</td>
|
||
<td> FOREARM
|
||
</td></tr>
|
||
<tr>
|
||
<td> TX40_HB005
|
||
</td>
|
||
<td> WRIST
|
||
</td></tr>
|
||
<tr>
|
||
<td> TX40_HB006
|
||
</td>
|
||
<td> TOOL FLANGE
|
||
</td></tr>
|
||
<tr>
|
||
<td> TX40_HB007
|
||
</td>
|
||
<td> ?
|
||
</td></tr></table>
|
||
<p>Cambia el “modo de visualización” de cada forma, excepto TX40_HB007, de “líneas planas” a “sombreado” para que la exportación a VRML tenga un buen aspecto. Yo también he cambiado el color a [245, 196, 0] y [204, 204, 204] para corresponderse mejor con el amarillo de Stäubli. Oculta TX40_HB007 porque contiene los ejes de todas las uniones y no puede cogerse aparte.
|
||
</p>
|
||
<h2><span class="mw-headline" id="Measure_geometric_characteristics">Measure geometric characteristics</span></h2>
|
||
<p>In order to build the Denavit-Hartenberg table (see <a href="Robot_6-Axis.html" title="Robot 6-Axis">Robot 6-Axis</a>) and prepare the vrml file, you need to get characteristics of the robot. For now, the measurement tool of FreeCAD is not ready, you can use the axes included in TX40_HB007 (the co-ordinates are indicated on the bottom left when you point an object with the mouse) or you have to use the Python console to get some information about the geometry. Note that the DH-table is only required if you need to use the inverse kinematics, i.e. get the Cartesian coordinates or drive the robot with Cartesian coordinates.
|
||
The DH-table for this robot is the following (mm, deg and deg/s):
|
||
</p>
|
||
<table class="wikitable">
|
||
|
||
<tr>
|
||
<th> i
|
||
</th>
|
||
<th> d
|
||
</th>
|
||
<th> θ
|
||
</th>
|
||
<th> r
|
||
</th>
|
||
<th> α
|
||
</th>
|
||
<th> θmin
|
||
</th>
|
||
<th> θmax
|
||
</th>
|
||
<th> Axis velocity
|
||
</th></tr>
|
||
<tr>
|
||
<td> 1
|
||
</td>
|
||
<td> 320
|
||
</td>
|
||
<td> q1
|
||
</td>
|
||
<td> 0
|
||
</td>
|
||
<td> -90
|
||
</td>
|
||
<td> -180
|
||
</td>
|
||
<td> 180
|
||
</td>
|
||
<td> 555
|
||
</td></tr>
|
||
<tr>
|
||
<td> 2
|
||
</td>
|
||
<td> 35
|
||
</td>
|
||
<td> q2 - 90
|
||
</td>
|
||
<td> 225
|
||
</td>
|
||
<td> 0
|
||
</td>
|
||
<td> -125
|
||
</td>
|
||
<td> 125
|
||
</td>
|
||
<td> 475
|
||
</td></tr>
|
||
<tr>
|
||
<td> 3
|
||
</td>
|
||
<td> 0
|
||
</td>
|
||
<td> q3 + 90
|
||
</td>
|
||
<td> 0
|
||
</td>
|
||
<td> 90
|
||
</td>
|
||
<td> -138
|
||
</td>
|
||
<td> 138
|
||
</td>
|
||
<td> 585
|
||
</td></tr>
|
||
<tr>
|
||
<td> 4
|
||
</td>
|
||
<td> 225
|
||
</td>
|
||
<td> q4
|
||
</td>
|
||
<td> 0
|
||
</td>
|
||
<td> -90
|
||
</td>
|
||
<td> -270
|
||
</td>
|
||
<td> 270
|
||
</td>
|
||
<td> 1035
|
||
</td></tr>
|
||
<tr>
|
||
<td> 5
|
||
</td>
|
||
<td> 0
|
||
</td>
|
||
<td> q5
|
||
</td>
|
||
<td> 0
|
||
</td>
|
||
<td> 90
|
||
</td>
|
||
<td> -120
|
||
</td>
|
||
<td> 133.5
|
||
</td>
|
||
<td> 1135
|
||
</td></tr>
|
||
<tr>
|
||
<td> 6
|
||
</td>
|
||
<td> 65
|
||
</td>
|
||
<td> q6
|
||
</td>
|
||
<td> 0
|
||
</td>
|
||
<td> 0
|
||
</td>
|
||
<td> -270
|
||
</td>
|
||
<td> 270
|
||
</td>
|
||
<td> 1575
|
||
</td></tr></table>
|
||
<p>El archivo CSV es entonces:
|
||
</p>
|
||
<pre> a , alpha, d , theta, rotDir, maxAngle, minAngle, AxisVelocity
|
||
0 , -90, 320, 0, 1, 180, -180, 555
|
||
225, 0, 35, -90, 1, 125, -125, 475
|
||
0 , 90, 0, 90, 1, 138, -138, 585
|
||
0 , -90, 225, 0, 1, 270, -270, 1035
|
||
0 , 90, 0, 0, 1, 133.5, -120, 1135
|
||
0 , 0, 65, 0, 1, 270, -270, 1575
|
||
</pre>
|
||
<h2><span class="mw-headline" id="Exportar_a_VRML">Exportar a VRML</span></h2>
|
||
<p>Exportar el documento a un archivo VRML. La estructura del archivo VRML es la siguiente:
|
||
</p>
|
||
<div class="mw-highlight mw-content-ltr" dir="ltr"><pre> #VRML V2.0 utf8
|
||
|
||
|
||
Group {
|
||
children
|
||
Group {
|
||
children [
|
||
Group {
|
||
…
|
||
|
||
},
|
||
|
||
Group {
|
||
…
|
||
|
||
},
|
||
|
||
Group {
|
||
…
|
||
|
||
},
|
||
|
||
Group {
|
||
…
|
||
|
||
},
|
||
|
||
Group {
|
||
…
|
||
|
||
},
|
||
|
||
Group {
|
||
…
|
||
|
||
},
|
||
|
||
Group {
|
||
…
|
||
|
||
},
|
||
|
||
Group {
|
||
…
|
||
|
||
} ]
|
||
|
||
}
|
||
|
||
}</pre></div>
|
||
<p>Puedes observar que tenemos 8 grupos independientes correspondientes a las 8 formas.
|
||
</p>
|
||
<h2><span class="mw-headline" id="Preparaci.C3.B3n_del_archivo_VRML">Preparación del archivo VRML</span></h2>
|
||
<p>Todas las formas en el archivo VRML son expresadas en el cuadro base, independientemente de cada otra. Para el entorno de simulación de Robots, necesitamos crear una estructura donde un movimiento de una forma induzca un movimiento de todas las formas situadas después en la estructura. La ubicación de las formas será relativa a la forma precedente, así necesitamos incluir algunas traducciones desde el sistema de referencia absoluto a los relativos. Las traducciones se describen en la siguiente imagen:
|
||
</p><p><a href="https://www.freecadweb.org/wiki/index.php?title=File:Staeubli_important_points.png" class="image"><img alt="Staeubli important points.png" src="Staeubli_important_points.png" width="177" height="418" /></a>
|
||
</p><p>Con
|
||
</p>
|
||
<dl><dd> A=(0, 0, 168)</dd>
|
||
<dd>B=(0, 107.8, 320)</dd>
|
||
<dd>C=(0, 104.15, 545)</dd>
|
||
<dd>D=(0, 35, 601)</dd>
|
||
<dd>E=(0, 35, 770)</dd>
|
||
<dd>F=(0, 35, 835)</dd></dl>
|
||
<p>Cojamos el ejemplo de el eje 4 entre ELBOW y FOREARM, situado en D=(xd, yd, zd). El anclaje para el eje de FreeCAD es
|
||
</p>
|
||
<div class="mw-highlight mw-content-ltr" dir="ltr"><pre> "DEF FREECAD_AXIS4 Transform { rotation 0 1 0 0 children ["</pre></div>
|
||
<p>Este corresponde a la rotación alrededor del eje Y. En el modelo de CAD, la rotación es alrededor del eje Z. Así, necesitamos una rotación alrededor del eje X de <math>\pi</math> antes de la definición del eje en FreeCAD y de <math>-\pi</math> después de ella. También, se necesita una traslación de (-xd, -yd, -zd) antes de la correspondencia del grupo a la definición de FOREARM para expresarlo centrado en el cuadro de referencia relativa en D. Esto significa que la traslación de (xd, yd, zd) debe insertarse antes de la primera rotación.
|
||
Al final, el archivo VRML de la definición de ELBOW a la definición de FOREARM se parecerá a esto:
|
||
</p>
|
||
<div class="mw-highlight mw-content-ltr" dir="ltr"><pre> # ELBOW
|
||
Group {
|
||
… here comes the unmodified definition of ELBOW
|
||
|
||
},
|
||
|
||
Transform {
|
||
translation 0 35 601
|
||
rotation 1 0 0 1.5707963
|
||
children
|
||
DEF FREECAD_AXIS4 Transform { rotation 0 1 0 0 children
|
||
Transform {
|
||
rotation 1 0 0 -1.5707963
|
||
children
|
||
Transform {
|
||
translation 0 -35 -601
|
||
children [
|
||
# FOREARM
|
||
Group {
|
||
... here comes the unmodified definition of FOREARM
|
||
|
||
},</pre></div>
|
||
At the end of the document, the appropriate closing brackets must be inserted: <div class="mw-highlight mw-content-ltr" dir="ltr"><pre> ]}}}},</pre></div>
|
||
<p>for each of the 6 axes. Eventually, the document looks like this (I don't know if I can link the file here because of copyrights):
|
||
</p>
|
||
<div class="mw-highlight mw-content-ltr" dir="ltr"><pre> #VRML V2.0 utf8
|
||
|
||
|
||
Group {
|
||
children
|
||
Group {
|
||
children [
|
||
# HORIZONTAL BASE CABLE OUTLET
|
||
Group {
|
||
... here comes the unmodified definition of HORIZONTAL BASE CABLE OUTLET
|
||
|
||
},
|
||
|
||
Transform {
|
||
translation 0 0 168
|
||
rotation 1 0 0 1.5707963
|
||
children
|
||
DEF FREECAD_AXIS1 Transform { rotation 0 1 0 0 children
|
||
Transform {
|
||
rotation 1 0 0 -1.5707963
|
||
children
|
||
Transform {
|
||
translation 0 0 -168
|
||
children [
|
||
# SHOULDER
|
||
Group {
|
||
... here comes the unmodified definition of SHOULDER
|
||
|
||
},
|
||
|
||
Transform {
|
||
translation 0 107.8 320
|
||
#rotation 0 0 1 0
|
||
children
|
||
DEF FREECAD_AXIS2 Transform { rotation 0 1 0 0 children
|
||
Transform {
|
||
#rotation 0 0 1 0
|
||
children
|
||
Transform {
|
||
translation 0 -107.8 -320
|
||
children [
|
||
# ARM
|
||
Group {
|
||
... here comes the unmodified definition of ARM
|
||
|
||
},
|
||
|
||
Transform {
|
||
translation 0 104.15 545
|
||
#rotation 0 0 1 0
|
||
children
|
||
DEF FREECAD_AXIS3 Transform { rotation 0 1 0 0 children
|
||
Transform {
|
||
#rotation 0 0 1 0
|
||
children
|
||
Transform {
|
||
translation 0 -104.15 -545
|
||
children [
|
||
# ELBOW
|
||
Group {
|
||
... here comes the unmodified definition of ELBOW
|
||
|
||
},
|
||
|
||
Transform {
|
||
translation 0 35 601
|
||
rotation 1 0 0 1.5707963
|
||
children
|
||
DEF FREECAD_AXIS4 Transform { rotation 0 1 0 0 children
|
||
Transform {
|
||
rotation 1 0 0 -1.5707963
|
||
children
|
||
Transform {
|
||
translation 0 -35 -601
|
||
children [
|
||
# FOREARM
|
||
Group {
|
||
... here comes the unmodified definition of FOREARM
|
||
|
||
},
|
||
|
||
Transform {
|
||
translation 0 35 770
|
||
#rotation 0 0 1 0
|
||
children
|
||
DEF FREECAD_AXIS5 Transform { rotation 0 1 0 0 children
|
||
Transform {
|
||
#rotation 0 0 1 0
|
||
children
|
||
Transform {
|
||
translation 0 -35 -770
|
||
children [
|
||
# WRIST
|
||
Group {
|
||
... here comes the unmodified definition of WRIST
|
||
|
||
},
|
||
|
||
Transform {
|
||
translation 0 35 835
|
||
rotation 1 0 0 1.5707963
|
||
children
|
||
DEF FREECAD_AXIS6 Transform { rotation 0 1 0 0 children
|
||
Transform {
|
||
rotation 1 0 0 -1.5707963
|
||
children
|
||
Transform {
|
||
translation 0 -35 -835
|
||
children [
|
||
# TOOL FLANGE
|
||
Group {
|
||
... here comes the unmodified definition of TOOL FRAME
|
||
|
||
},
|
||
|
||
Group {
|
||
... here comes the unmodified definition of TX40_HB007
|
||
|
||
} # "]" was deleted from this line
|
||
]}}}},
|
||
]}}}},
|
||
]}}}},
|
||
]}}}},
|
||
]}}}},
|
||
]}}}},
|
||
] # this is the "]" deleted from the line above
|
||
}
|
||
}</pre></div>
|
||
<p>Aquí está un parche para conseguir el archivo VRML adecuado para la simulación del robot:
|
||
</p>
|
||
<div class="mw-highlight mw-content-ltr" dir="ltr"><pre> 7a8
|
||
> # HORIZONTAL BASE CABLE OUTLET
|
||
95968a95970,95981
|
||
> Transform {
|
||
> translation 0 0 168
|
||
> rotation 1 0 0 1.5707963
|
||
> children
|
||
> DEF FREECAD_AXIS1 Transform { rotation 0 1 0 0 children
|
||
> Transform {
|
||
> rotation 1 0 0 -1.5707963
|
||
> children
|
||
> Transform {
|
||
> translation 0 0 -168
|
||
> children [
|
||
> # SHOULDER
|
||
128428a128442,128453
|
||
> Transform {
|
||
> translation 0 107.8 320
|
||
> #rotation 0 0 1 0
|
||
> children
|
||
> DEF FREECAD_AXIS2 Transform { rotation 0 1 0 0 children
|
||
> Transform {
|
||
> #rotation 0 0 1 0
|
||
> children
|
||
> Transform {
|
||
> translation 0 -107.8 -320
|
||
> children [
|
||
> # ARM
|
||
206503a206529,206540
|
||
> Transform {
|
||
> translation 0 104.15 545
|
||
> #rotation 0 0 1 0
|
||
> children
|
||
> DEF FREECAD_AXIS3 Transform { rotation 0 1 0 0 children
|
||
> Transform {
|
||
> #rotation 0 0 1 0
|
||
> children
|
||
> Transform {
|
||
> translation 0 -104.15 -545
|
||
> children [
|
||
> # ELBOW
|
||
267111a267149,267160
|
||
> Transform {
|
||
> translation 0 35 601
|
||
> rotation 1 0 0 1.5707963
|
||
> children
|
||
> DEF FREECAD_AXIS4 Transform { rotation 0 1 0 0 children
|
||
> Transform {
|
||
> rotation 1 0 0 -1.5707963
|
||
> children
|
||
> Transform {
|
||
> translation 0 -35 -601
|
||
> children [
|
||
> # FOREARM
|
||
417854a417904,417915
|
||
> Transform {
|
||
> translation 0 35 770
|
||
> #rotation 0 0 1 0
|
||
> children
|
||
> DEF FREECAD_AXIS5 Transform { rotation 0 1 0 0 children
|
||
> Transform {
|
||
> #rotation 0 0 1 0
|
||
> children
|
||
> Transform {
|
||
> translation 0 -35 -770
|
||
> children [
|
||
> # WRIST
|
||
422053a422115,422126
|
||
> Transform {
|
||
> translation 0 35 835
|
||
> rotation 1 0 0 1.5707963
|
||
> children
|
||
> DEF FREECAD_AXIS6 Transform { rotation 0 1 0 0 children
|
||
> Transform {
|
||
> rotation 1 0 0 -1.5707963
|
||
> children
|
||
> Transform {
|
||
> translation 0 -35 -835
|
||
> children [
|
||
> # TOOL FLANGE
|
||
435627c435700,435707
|
||
< } ]
|
||
---
|
||
> }
|
||
> ]}}}},
|
||
> ]}}}},
|
||
> ]}}}},
|
||
> ]}}}},
|
||
> ]}}}},
|
||
> ]}}}},
|
||
> ]</pre></div>
|
||
<p><br />
|
||
</p>
|
||
<div style="clear:both"></div>
|
||
</div>
|
||
|
||
|
||
|
||
</div>
|
||
|
||
</div><div class="printfooter">
|
||
Online version: "<a dir="ltr" href="https://www.freecadweb.org/wiki/index.php?title=VRML_Preparation_for_Robot_Simulation/es&oldid=177711">http://www.freecadweb.org/wiki/index.php?title=VRML_Preparation_for_Robot_Simulation/es&oldid=177711</a>"</div>
|
||
<div id="catlinks" class="catlinks" data-mw="interface"></div><div class="visualClear"></div>
|
||
</div>
|
||
</div>
|
||
<div id="mw-navigation">
|
||
<h2>Navigation menu</h2>
|
||
|
||
</body></html> |