ROBOTS DE EXTERIORES - Centro de Automática y Robótica
ROBOTS DE EXTERIORES - Centro de Automática y Robótica
ROBOTS DE EXTERIORES - Centro de Automática y Robótica
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
134 Robots <strong>de</strong> exteriores<br />
automática por el sistema aparece en la Fig. 8 (las ligeras variaciones en la<br />
trayectoria no son visibles por la escala empleada):<br />
# obviamos la creación <strong>de</strong>l vehículo y algunas variables<br />
# <strong>de</strong>spegue y posición inicial en una esquina <strong>de</strong>l campo<br />
uav.TakeOff (10m)<br />
uav.FlyTo (coord_esquina, velocidad = v)<br />
# fijamos la altura <strong>de</strong> referencia<br />
uav.RefPosition.Z() = 50m<br />
# la misión pue<strong>de</strong> <strong>de</strong>finirse como un bucle<br />
<strong>de</strong>stino = coord_esquina<br />
for (i = 0; i < 15; i = i + 1)<br />
# calculamos la coor<strong>de</strong>nada final <strong>de</strong> este segmento<br />
# con la anchura <strong>de</strong>l campo<br />
<strong>de</strong>stino = <strong>de</strong>stino + @0.0, ancho_campo, 50m@<br />
# volamos en línea recta<br />
print (‘volando hacia ‘, <strong>de</strong>stino)<br />
uav.FlyTo (<strong>de</strong>stino, v)<br />
# en ese extremo <strong>de</strong>l campo po<strong>de</strong>mos girar con un arco<br />
# <strong>de</strong> circunferencia<br />
print (‘girando’)<br />
centro = <strong>de</strong>stino + @2.5m, 0m, 0m@<br />
uav.Arc (centro, velocidad = v, longitud = 180 <strong>de</strong>g)<br />
# volvemos<br />
<strong>de</strong>stino = <strong>de</strong>stino + @0.0, -ancho_campo, 50m@<br />
print (‘volando hacia ‘, <strong>de</strong>stino)<br />
uav.FlyTo (<strong>de</strong>stino, v)<br />
# en este extremo hay que evitar la autovia. Volamos a<br />
# la mitad <strong>de</strong> velocidad y giramos en ángulos rectos<br />
<strong>de</strong>stino = <strong>de</strong>stino + @5m, 0m, 0m@<br />
# si a la instrucción Hover le damos un punto, orienta<br />
# el uav en esa direccion<br />
uav.Hover (duracion = 15s, dir = <strong>de</strong>stino)<br />
uav.FlyTo (<strong>de</strong>stino, velocidad = v/2)<br />
endFor<br />
# fin <strong>de</strong>l bucle. Vuelta a “casa” y aterrizaje<br />
uav.RefPosition.Z() = 5m<br />
uav.FlyTo (casa, velocidad = v)<br />
uav.Land ()<br />
60<br />
50<br />
40<br />
30<br />
20<br />
10<br />
0<br />
-20 -10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150<br />
Fig. 8. Vuelo sobre un sembradío (en metros)