scieee AI-readable full text Open interactive document viewer

Contributions to underwater glider path planning

Fernández Perdomo, Enrique

Abstract

La Planificación de Rutas o Caminos es un disciplina de Robótica que trata la búsqueda de caminos factibles u óptimos. Para la mayoría de vehículos y entornos, no es un problema trivial y por tanto nos encontramos con un gran diversidad de algoritmos para resolverlo, no sólo en Robótica e Inteligencia Artificial, sino también como parte de la literatura de Optimización, con Métodos Numéricos y Algoritmos Bio-inspirados, como Algoritmos Genéticos y el Algoritmo de la Colonia de Hormigas. El caso particular de escenarios de costes variables es considerablemente difícil de abordar porque el entorno en el que se mueve el vehículo cambia con el tiempo. El presente trabajo de tesis estudia este problema y propone varias soluciones prácticas para aplicaciones de Robótica Submarina.

Full text

Universidad de Las Palmas de Gran Canaria Instituto Universitario de Sistemas Inteligentes y Aplicaciones Num´ ericas en Ingenier´ ıa Contributions to Underwater Glider Path Planning § Contribuciones a la Planificaci´ on de Rutas para Planeadores Submarinos § by Enrique Fern´andez Perdomo A thesis submitted for the degree of Doctor of Philosophy January 26, 2014 Las Palmas de Gran Canaria, Spain Under the supervision of Antonio C. Dom´ ınguez Brito Daniel Hern´ andez Sosa vJosep Isern Gonz´ alez Contributions to Underwater Glider Path Planning § Contribuciones a la Planificaci´ on de Rutas para Planeadores Submarinos § Universidad de Las Palmas de Gran Canaria Instituto Universitario de Sistemas Inteligentes y Aplicaciones Num´ ericas en Ingenier´ ıa Enrique Fern´ andez Perdomo Las Palmas de Gran Canaria, Spain A thesis submitted for the degree of Doctor of Philosophy Under the supervision of Antonio C. Dom´ ınguez Brito Daniel Hern´ andez Sosa vJosep Isern Gonz´ alez January 26, 2014 ©Copyright 2013 by Enrique Fern´ andez Perdomo To my family The fundamental cause of the trouble is that in the modern world the stupid are cocksure while the intelligent are full of doubt. The Triumph of Stupidity Bertrand Russell Contents 1 Introduction 1 1.1 OceanResearch .......................................... 1 1.2 Ocean Monitoring and Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.3 Unmanned Underwater Vehicles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.3.1 Autonomous Underwater Gliders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.4 Autonomous Underwater Glider Piloting and Path Planning . . . . . . . . . . . . . . . . . . . 12 1.5 ThesisHypothesis......................................... 16 1.6 LimitationsandScope....................................... 16 1.7 ThesisOutline........................................... 18 2 Ocean Gliders 21 2.1 Autonomous Underwater Gliders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.1.1 Description ........................................ 22 2.1.2 PilotingandNavigation.................................. 24 2.1.3 CommercialModels.................................... 25 2.2 Glider Motion Model and Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 2.2.1 Notation.......................................... 26 2.2.2 PointMotionModel.................................... 27 2.2.2.1 Unconstrained Motion Model . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.2.2.2 Constrained Motion Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.2.3 Force Balance Motion Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.2.4 DynamicMotionModels ................................. 41 3 Ocean Glider Path Planning Problems and Applications 43 3.1 PathOptimization......................................... 43 3.1.1 MinimalTimePath.................................... 44 3.1.2 Path of Minimal Distance to the Target . . . . . . . . . . . . . . . . . . . . . . . . . 47 3.2 ObstacleAvoidance ........................................ 48 3.3 PathFollowing........................................... 48 3.3.1 RelaxedPathFollowing.................................. 51 3.3.2 Summary ......................................... 52 3.4 Multi-Glider Path Planning and Coordination . . . . . . . . . . . . . . . . . . . . . . . . . . 53 3.4.1 EfficientRecovery..................................... 54 3.5 Tracking Evolving Ocean Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 3.5.1 OceanEddies ....................................... 57 3.5.2 Samplingpatterns..................................... 58 vii xiv List of Figures (b) Path............................................. 45 3.3 Minimal Departure Time problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 3.4 Minimal Distance to the Target problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 3.5 ObstacleAvoidanceproblem ................................... 48 3.6 PathFollowingproblem...................................... 49 3.7 Righttrapezoidarea........................................ 49 (a) Righttrapezoid ....................................... 49 (b) Right trapezoid (crossing) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 3.8 PathFollowing.Line ....................................... 52 3.9 PathFollowing.Corridor ..................................... 53 3.10 Multi-glider coordination constraint diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 3.11EfficientRecoveryproblem .................................... 55 3.12EvolvingStructure.FTLE..................................... 56 3.13Evolvingstructures.Eddy..................................... 57 3.14 Evolving structures. Windmill eddy sampling pattern . . . . . . . . . . . . . . . . . . . . . . 58 4.1 DiagramofRoboticTasks..................................... 62 4.2 Survey of Glider Path Planning techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 4.3 DirecttoGoaldiagram ...................................... 66 4.4 A* diagram of gridded graph, neighbors and heading angles . . . . . . . . . . . . . . . . . . . 68 4.5 A* example of optimal path not found . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 4.6 CTS-A*. Successors generation diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 4.7 CTS-A*. Diagram of operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 4.8 ABS CTS-A*. Effective speed and PDF distribution . . . . . . . . . . . . . . . . . . . . . . . 79 (a) 50% speedratio....................................... 79 (b) 150% speedratio ...................................... 79 (c) PDF distributions fψc(ψe)given by Ue........................... 79 4.9 ABS CTS-A*. Normal distribution with heading direct to the goal . . . . . . . . . . . . . . . 80 4.10 ABS CTS-A*. Combination of the PDF distributions . . . . . . . . . . . . . . . . . . . . . . 80 4.11 ABS CTS-A*. Sequential Importance Sampling (SIS) . . . . . . . . . . . . . . . . . . . . . . 81 4.12 ABS CTS-A*. Samples drawn from the proposed PDF distribution . . . . . . . . . . . . . . . 81 4.13RRT ................................................ 83 (a) 50 iterations......................................... 83 (b) 500 iterations ........................................ 83 4.14 Optimization method. Naive vs. Intelligent initialization . . . . . . . . . . . . . . . . . . . . 87 (a) Naive.Case#1....................................... 87 (b) Intelligent.Case#1..................................... 87 (c) Naive.Case#2....................................... 87 (d) Intelligent.Case#2..................................... 87 4.15 Optimization method. Intelligent initialization for Obstacle Avoidance . . . . . . . . . . . . . 89 (a) Step#1........................................... 89 (b) Step#2........................................... 89 (c) Step#3........................................... 89 (d) Step#4........................................... 89 4.16 Optimization method. Partition of initialization stretches. . . . . . . . . . . . . . . . . . . . . 90 4.17 Stability Analysis. FTLE field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 4.18 Mesoscale Eddy detection, characterization and tracking . . . . . . . . . . . . . . . . . . . . 98 4.19 Pinz´ on PathPlannerOutput ................................... 99 4.20KMLAnimationOutput......................................100 List of Figures xv 5.1 Ocean currents dynamics for a day in the ESEOAT region . . . . . . . . . . . . . . . . . . . . 104 (a) Velocityfield ........................................104 (b) Velocityplot.........................................104 (c) Compassplot ........................................104 (d) Roseplot ..........................................104 5.2 ROM. Effect of dynamic ocean currents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 5.3 Synthetic eddies. Streamfunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 5.4 Syntheticeddies.Eddysize....................................108 (a) Eddies of ≈15km .....................................108 (b) Eddies of ≈30km .....................................108 (c) Eddies of ≈50km .....................................108 (d) Eddies of ≈100km ....................................108 5.5 Analytical Ocean Currents. Constant, Source and Sink . . . . . . . . . . . . . . . . . . . . . 108 (a) Constant...........................................108 (b) Source............................................108 (c) Sink .............................................108 5.6 Analytical Ocean Currents. Double eddy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 (a) t= 0 .............................................110 (b) t= 0.33 ...........................................110 (c) t= 0.66 ...........................................110 (d) t= 1 .............................................110 5.7 Analytical Ocean Currents. Stuart vortex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 (a) t= 0 .............................................111 (b) t= 5 .............................................111 (c) t= 10 ............................................111 (d) t= 15 ............................................111 5.8 Analytical Ocean Currents. Dynamic tiled eddies . . . . . . . . . . . . . . . . . . . . . . . . 111 (a) t= 0 .............................................111 (b) t= 2 .............................................111 (c) t= 4 .............................................111 5.9 Analytical Ocean Currents. Sinusoidal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 (a) t= 0 .............................................112 (b) t= 0.33 ...........................................112 (c) t= 0.66 ...........................................112 (d) t= 1 .............................................112 5.10 Minimal time path. RU27 glider, DtG, A* and CTS-A* paths . . . . . . . . . . . . . . . . . . 116 5.11 ESEOAT region and RU27 path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 5.12 Pinz´ on paths for the RU27 trans-Atlantic mission . . . . . . . . . . . . . . . . . . . . . . . . 117 (a) Plotoutput .........................................117 (b) KMLoutput.........................................117 5.13 SLOCUM glider affected by biofouling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 5.14 Effect of ocean currents strength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 5.15 Path cost box and whisker plot for ABS tests . . . . . . . . . . . . . . . . . . . . . . . . . . 122 5.16 CTS-A* and ABS CTS-A* paths for test case #2........................124 5.17 Minimal time path example with Iterative Optimization . . . . . . . . . . . . . . . . . . . . . 125 5.18 Comparison of minimal time path (case # 1) ..........................127 5.19 Comparison of minimal time path (case # 2) ..........................128 5.20 Comparison of Minimal Time Path for low glider speed . . . . . . . . . . . . . . . . . . . . . 129 5.21 Comparison of Minimal Time Path (case # 3)..........................130 xvi List of Figures 5.22 Minimal Distance to the Target problem. Dynamic ocean currents . . . . . . . . . . . . . . . 131 5.23 Minimal Distance to the Target. Test cases 1and 2.......................133 5.24 Minimal Distance to the Target. Test case 3...........................134 5.25 Initialization phase of Optimization-CTS-A* . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 5.26 Obstacle Avoidance. Static scenarios. Case #1 . . . . . . . . . . . . . . . . . . . . . . . . . 137 5.27 Obstacle Avoidance. Static scenarios. Case #2 . . . . . . . . . . . . . . . . . . . . . . . . . 138 5.28 Obstacle Avoidance. Dynamic scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 (a) CaseI ............................................141 (b) CaseII............................................141 (c) CaseIII ...........................................141 (d) CaseIV(obstaclefree) ...................................141 5.29 Path Following. Comparison of HTTVE and Iterative Optimization . . . . . . . . . . . . . . . 142 5.30 Path Following. Iterative Optimization. Straight line path . . . . . . . . . . . . . . . . . . . . 143 5.31 Path Following. Iterative Optimization. Corridor around desired path . . . . . . . . . . . . . . 144 5.32 Path Following. Pareto curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 5.33 Path Following. Strong ocean currents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 5.34 Path Following. Windmill trajectory for mesoscale eddies . . . . . . . . . . . . . . . . . . . . 147 5.35 Multi-Glider. Parallel formation. Case 1.............................148 5.36 Multi-Glider. Parallel formation. Case 2.............................149 5.37 Multi-Glider Path Planning and Coordination. Efficient Recovery . . . . . . . . . . . . . . . . 150 (a) Individual ..........................................150 (b) Meettogether........................................150 (c) Shippath ..........................................150 5.38 Tracking Evolving Ocean Structures. Eddy boundary path . . . . . . . . . . . . . . . . . . . 152 A.1 OceanModelOutput .......................................169 (a) Temperature.........................................169 (b) SSHA ............................................169 A.2 GreatCircle ............................................172 A.3 Distancemetrics.CPUtime ...................................173 (a) Alldistancemetrics.....................................173 (b) Zoom in without the slowest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 A.4 Distancemetrics.Distance ....................................174 (a) Alldistancemetrics.....................................174 (b) Zoominwithouttheworst.................................174 A.5 Distancemetrics.Error ......................................175 (a) Alldistancemetrics.....................................175 (b) Withouttheworst......................................175 A.6 Azimuth angle metrics. CPU time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 (a) All azimuth angle metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 (b) Zoom in without the slowest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 A.7 Azimuth angle metrics. Azimuth angle and error . . . . . . . . . . . . . . . . . . . . . . . . . 179 (a) Azimuthanglemetrics ...................................179 (b) Error.............................................179 1.1 Spray,SLOCUMySeaglider.................................... ii 1.2 Glider RU27 en la misi´ on trans-Atl´ antica............................. iv 2.1 Diagrama del perfil yo-yo y el patr´ on de diente de sierra . . . . . . . . . . . . . . . . . . . . . x 2.2 Diagrama de un tramo de navegaci´ ondeunglider........................ xi List of Figures xvii 2.3 Modelo de Movimiento Puntual no restringido . . . . . . . . . . . . . . . . . . . . . . . . . . xiii 2.4 Composici´ on de vectores para la correcci´ ondeladeriva..................... xv 2.5 Diagrama de equilibrio de fuerzas en un glider . . . . . . . . . . . . . . . . . . . . . . . . . . xvi 2.6 Model de Movimiento de Equilibrio de Fuerzas . . . . . . . . . . . . . . . . . . . . . . . . . . xviii 3.1 Problema del Camino de M´ ınimoTiempo ............................ xx 3.2 Problema de M´ ınima Distancia la Destino . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi 3.3 Problema de Evitaci´ on de Obst´ aculos...............................xxii 3.4 Problema de Seguimiento de Trayectorias . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii 3.5 Seguimiento de Trayectorias. Pasillo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii 3.6 Diagrama de restricci´ on de coordinaci´ on multi-glider . . . . . . . . . . . . . . . . . . . . . . xxiv 3.7 Problema de la Recogida Eficiente . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv 3.8 Estructura M´ ovil.FTLE......................................xxvi 3.9 Estructuras m´ oviles. Patr´ on de muestreo de Molino . . . . . . . . . . . . . . . . . . . . . . . xxvii 4.1 Revisi´ on de t´ ecnicas de Planificaci´ on de Caminos para gliders . . . . . . . . . . . . . . . . . . xxx 4.2 DiagramadelDirecttoGoal ...................................xxxi 4.3 DiagramadelA*..........................................xxxi 4.4 CTS-A*. Diagrama de funcionamiento . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxiii 4.5 ABS CTS-A*. Combinaci´ on de distribuciones PDF . . . . . . . . . . . . . . . . . . . . . . . xxxv 4.6 RRT ................................................xxxvii (a) 50 iteraciones ........................................xxxvii (b) 500 iteraciones .......................................xxxvii 4.7 M´ etodo de Optimizaci´ on. Inicializaci´ on Inteligentes para Evitaci´ on de Obst´ aculos . . . . . . . xxxix (a) Paso#1...........................................xxxix (b) Paso#2...........................................xxxix (c) Paso#3...........................................xxxix (d) Paso#4...........................................xxxix 4.8 An´ alisis de Estabilidad. Campo FTLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xli 4.9 Detecci´ on, caracterizaci´ on y seguimiento de Giros Mesoescalares . . . . . . . . . . . . . . . . xlii 4.10 Animaci´ onKML..........................................xliii 5.1 Comparativa del Camino de M´ ınimoTiempo...........................xlvi 5.2 M´ ınima Distancia Restante al Destino. Caso de Test 3.....................xlviii 5.3 Evitaci´ on de Obst´ aculos. Escenarios din´ amicos..........................xlix (a) CasoI ............................................xlix (b) CasoII............................................xlix (c) CasoIII ...........................................xlix (d) Caso IV (sin obst´ aculos) ..................................xlix 5.4 Seguimiento de Trayectorias. Pasillo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . l 5.5 Seguimiento de Trayectorias. Curva de Pareto . . . . . . . . . . . . . . . . . . . . . . . . . . li 5.6 Seguimiento de Trayectorias. Trayectoria de Molino para giros mesoescalares . . . . . . . . . . lii 5.7 Planificaci´ on de Caminos Multi-glider y Coordinaci´ on. Recogida Eficiente . . . . . . . . . . . liii (a) Individual .......................................... liii (b) Encontrarsejuntos ..................................... liii (c) Caminodelbarco ...................................... liii 5.8 Seguimiento de Estructuras Oce´ anicas M´ oviles.......................... liv 1.1 Spray,SLOCUMySeaglider.................................... 2 1.2 Glider RU27 en la misi´ on trans-Atl´ antica............................. 3 xviii List of Figures 2.1 Problema del Camino de M´ ınimoTiempo ............................ 5 2.2 Problema de M´ ınima Distancia la Destino . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.3 Problema de Seguimiento de Trayectorias . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.4 Estructura M´ ovil.FTLE...................................... 8 3.1 DiagramadelA*.......................................... 10 3.2 CTS-A*. Diagrama de funcionamiento . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.3 ABS CTS-A*. Combinaci´ on de distribuciones PDF . . . . . . . . . . . . . . . . . . . . . . . 12 3.4 An´ alisis de Estabilidad. Campo FTLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.1 M´ ınima Distancia Restante al Destino. Caso de Test 3..................... 15 4.2 Evitaci´ on de Obst´ aculos. Escenarios din´ amicos.......................... 16 (a) CasoI ............................................ 16 (b) CasoII............................................ 16 4.3 Seguimiento de Trayectorias. Trayectoria de Molino para giros mesoescalares . . . . . . . . . . 17 4.4 Planificaci´ on de Caminos Multi-glider y Coordinaci´ on. Recogida Eficiente . . . . . . . . . . . 18 (a) Individual .......................................... 18 (b) Encontrarsejuntos ..................................... 18 (c) Caminodelbarco ...................................... 18 4.5 Seguimiento de Estructuras Oce´ anicas M´ oviles.......................... 18 List of Tables 2.1 Force balance motion model parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 4.1 Optimization method. Travel time for different kernels . . . . . . . . . . . . . . . . . . . . . 91 4.2 Optimization method. Computing time for different kernels . . . . . . . . . . . . . . . . . . . 91 5.1 Minimal time path cost for ABS CTS-A* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 5.2 Computing time for ABS CTS-A* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 5.3 Summary of minimal time path cost for ABS CTS-A* . . . . . . . . . . . . . . . . . . . . . . 122 5.4 MWW test for ABS CTS-A* wrt CTS-A* . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 5.5 Path cost for the Minimal Time Path comparison . . . . . . . . . . . . . . . . . . . . . . . . 125 5.6 Effective velocity for the Minimal Time Path comparison . . . . . . . . . . . . . . . . . . . . 126 5.7 Computing time for the Minimal Time Path comparison . . . . . . . . . . . . . . . . . . . . . 126 5.8 Minimal Distance to the Target. Average distance difference wrt DtG . . . . . . . . . . . . . 132 5.9 Obstacle Avoidance. Static scenarios, fast speed. Average travel time . . . . . . . . . . . . . 135 5.10 Obstacle Avoidance. Static scenarios, slow speed. Average travel time . . . . . . . . . . . . . 135 5.11 Obstacle Avoidance. Static scenarios. Effective speed . . . . . . . . . . . . . . . . . . . . . . 135 5.12 Obstacle Avoidance. Static scenarios. Computing time . . . . . . . . . . . . . . . . . . . . . 136 5.13 Obstacle Avoidance. Dynamic Scenarios, fast. Remaining distance . . . . . . . . . . . . . . . 139 5.14 Obstacle Avoidance. Dynamic Scenarios, slow. Remaining distance . . . . . . . . . . . . . . . 139 5.1 Coste del camino para la comparaci´ on del Camino de M´ ınimo Tiempo . . . . . . . . . . . . . xlvi 5.2 M´ ınima Distancia Restante al Destino. Promedio de diferencia con el DtG . . . . . . . . . . . xlvii 5.3 Evitaci´ on de Obst´ aculos. Escenarios din´ amicos..........................xlviii xix List of Algorithms 2.1 Trajectoryintegration....................................... 31 4.1 A*algorithm............................................ 69 4.2 Successors generation in CTS-A* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 4.3 RRTalgorithm........................................... 82 4.4 Iterative Optimization algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 4.5 FTLEfield............................................. 96 2.1 Integraci´ ondelatrayectoria.................................... xii 4.1 AlgoritmoA* ...........................................xxxii 4.2 Generaci´ on de sucesores en el CTS-A* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxiv 4.3 AlgoritmoRRT ..........................................xxxvi 4.4 Algoritmo de Optimizaci´ onIterativa ...............................xxxviii 4.5 CampoFTLE ........................................... xl 3.1 Generaci´ ondesucesoresenelCTS-A*.............................. 11 xxi Abstract Path or Motion Planning is a Robotics discipline that deals with the search of feasible or optimal paths. For most vehicles and environments, it is not a trivial problem and therefore we find a great diversity of algorithms to solve it, not only in Robotics and Artificial Intelligence, but also as part of the Optimization literature, with Numerical Methods and Bio-inspired Algorithms, like Genetic Algorithms and Ant Colony Optimization. The particular case of variable cost scenarios is considerably difficult to address because the environment where the vehicle moves varies over time. The present thesis work studies this problem and proposes a number of practical solutions for Underwater Robotics applications. The thesis focuses on Autonomous Underwater Glider (AUG) Path Planning, considering its motion model and the effect of ocean currents. Gliders are a type of Autonomous Underwater Vehicle (AUV) that moves with a relatively slow nominal speed when compared with ocean currents. For this reason, they conform an interesting research field from the perspective of path planning. Ocean current maps provide the snapshot of this physical parameter at different time instants, which along with other physical parameters, are computed with Ocean Models. In those zones close to the coastline they exhibit a high temporal variability, so we have to perform path planning in a variable cost environment, where the cost function is also asymmetric. This work attacks the problem using different approaches. Starting with classical path planning algorithms adapted to the problem, like A*, up to optimization techniques, Genetic Algorithms, Probabilistic Sampling methods, among others. The thesis also provides a number of proposals to solve this particular problem. For instance, some variants of A* combined with probabilistic sampling techniques and several proposals of optimization algorithms within the configuration space of the feasible bearings the vehicle can follow from each surfacing point, are described and analyzed. A thorough comparison of these techniques is covered by this document, with the intention of assessing which ones are more suitable for the given problem, as well as analyzing their computational cost. Finally, the work explores sampling strategies for movable ocean structures. xxx Acknowledgements amiga i ensenyar-me els indcrets m´ es bonics de Girona i la Costa Brava, per` o sobretot per la seva amistat. Gr` acies a tots els components del grup “Ens va la marxa, marxa”: Cesar, Toni, Elsa, Imma, ... espero no deixar-me ning´ u! I en especial a l’Eva, que va veure coses en m´ ı que jo no era capac¸ de veure. Van fer molt agradable el meu pas per Girona. La estancia en Girona la compagin´ e con la participaci´ on en el SAUC-E’12, como un miembro m´ as del equipo AVORA. Fue todo un honor, chicos. Gracias por hacerme un hueco y dejarme disfrutar de aquella semana en La Spezia. Esos d´ ıan han renovado mi ambici´ on. Anil, Aaron, Luis, David, Federico, y Daniel, gracias. Mucho ´ animo a los participantes de este a˜ no. Tambi´ en quiero dar gracias a mis amistades, muchos amigos de carrera. Con ellos viv´ ı una de las mejores etapas de mi vida. Gracias por sus ´ animos estos ´ ultimos meses y por ayudarme a distraerme alg´ un que otro fin de semana. En especial, gracias a Rodrigo y Eliezer, compa˜ neros de pr´ acticas y risas. Tambi´ en guardo un especial recuerdo de Orlando, Jorge, Samuel, Gast´ on, y muchos m´ as. Gracias, porque lo que aprend´ ı con ustedes me ha llevado hasta aqu´ ı. Finalmente, mi familia. Gracias a Enrique senior, y a mi madre. Mi padre, por sus sabios consejos. La voz de la experiencia. Y por hacer de ch´ ofer tantas veces, pero sobre todo, por no pedir nada a cambio. Gracias mam´ a, por hablar conmigo, escucharme, y por el sancocho. Tambi´ en gracias a mi hermana Yolanda, con la que a veces puedo hablar de estas cosas tan t´ ecnicas que hago en el trabajo. Gracias a los tres por liberarme de tantas tareas estos ´ ultimos meses que llevo pegado al teclado. Y finalmente gracias a mis vecinos por ayudarme a mantenerme despierto estas ´ ultimas noches antes de acabar la tesis. Mientras yo hac´ ıa la memoria de la tesis, ... Gracias. Thank you. Danke. Gr` acies. Obrigado. - Notation g(ni)Accumulated cost from nstart to ninode. αAngle of Attack (AoA). AAspect Ratio A=b2 S. ψgGlider bearing angle. |B| Number of bearings (cardinality of B). BBearings set that defines the path P. ∇Vbp Buoyancy change due to the buoyancy engine. O(·)Complexity in big-Onotation. εCompressibility of the hull. c(ni, ni+1)Cost of going from node nito ni+1. CDDrag coefficient. xn−1Ending location. f(ni)f-cost for node ni. γGlide angle γ=θ+α. UGlider velocity through water along the glide path. ψeGlider heading (or course) angle. ˆ ψeHeading error. h(ni)Heuristic value for node ni. CD1,h Induced drag for the hull. CD1,w Induced drag for the wings. CLLift coefficient. xxxi xxxii Notation ahLift slope coefficient for the hull. awLift slope coefficient for the wings. mgGlider mass. k·kEuclidean norm, usually used as a distance. CD0,h Parasite drag for the hull. CD0,w Parasite drag for the wings. PPath. PdDesired path, for the path following problem. θPitch angle in the BODY frame. T0Reference temperature for αT. φRoll angle in the BODY frame. eSpan efficiency parameter e≈0.8. SR Speed ratio. x0Start location. nstart Start node. xiSurfacing location. tsSurfacing time, between consecutive stints. ttTravel time, from x0to xgoal. xgoal Target waypoint location. ngoal Target (or goal) node. αTThermal expansion coefficient. UcOcean current speed. UeGlider effective speed Ue=Ug+Uc. UgGlider nominal surge speed Ug=Ucos γ. VgGlider volume at atmospheric pressure. bWingspan. SWing surface area. ΩWing sweep angle (at 1/4chord line). ψYaw angle in the BODY frame. Chapter 1 Introduction We will begin justifying this work by describing one of the main scopes of application of its contributions and results. It is the vast scientific discipline called Oceanography. Also known as Marine Science, it is the science that studies the ocean. It was in 1872 when the departure of the H.M.S. Challenger (see Figure 1.1) from England on the historic four-year global expedition of exploration established the science of Oceanography (Earle, 2012). Given the complexity of the world ocean system, Oceanography actually covers a wide range of topics, including ocean currents, waves, and geophysical fluid dynamics; plate tectonics and the geology of the sea floor; marine organisms and ecosystem dynamics; and fluxes of various chemical substances and physical properties within the ocean and across its boundaries. Although we will later see that the contributions of the present work can assist several sectors in the industry and also the navy, here we will focus on which is probably the sector most favored from the improvements in marine technology and engineering. 1.1 Ocean Research Probably, one of the most interesting oceanographic phenomena to study is Climate Change, since it affects globally both the ocean itself and the life it supports. The factors that cause Climate Change include oceanic processes, variations in solar radiation received by Earth, plate tectonics and volcanic eruptions, and humaninduced alterations of the natural world. Clearly, dissimilar agents that are complex and difficult to measure and study. In the glossary of the National Snow and Ice Data Center (NSIDC), Climate Change is defined as the study dealing with variations in climate on many different time scales from decades to millions of years, and the possible causes of such variations. In order to study these processes to find statistical evidence of Climate Change for a particular period of time and validate hypotheses like the correlation of Global Warming and anthropogenic activities, a global monitoring and sampling network is required. Only with accurate temporal series of physical, chemical and biological data, it is possible to improve climate models, and the models of the subsystems they rely on (Bindoff et al., 2007). The more confident and predictable the state of the atmosphere and the oceans are, the greater the chance to monitor and sample processes that happen in the environment adequately —e.g. at the exact location, for their whole lifespan, with a higher or adaptive sampling resolution, etc. Otherwise, we will not be able to adapt our monitoring or sampling strategy until the phenomenon has reached a mature state in which it can be observed from the surface, and hence we miss all the previous subprocesses that take place underwater. One of the most visible proofs of ocean warming and acidification is the growth in the frequency and intensity of bloom episodes. An algal bloom is a rapid increase or accumulation in the population of algae in an aquatic system. Also, the particular case of Harmful Algal Blooms (HABs) constitutes a remarkable problem for the ecosystem and human society. Ocean calcification and the impact on ocean calcifying organisms, is a similar and related process as well, with significant consequences on the biological and chemical characteristics 1 2 1 Introduction Figure 1.1: H.M.S. Challenger, a steam-assisted Royal Navy Pearl-class corvette launched on 13 February 1858 at the Woolwich Dockyard, that undertook the first global marine research expedition: the Challenger expedition (1872–1876). Picture taken from The NOAA Photo Library. of the region. It turns out to be of extreme interest for the scientists to establish which are the physical, chemical and biological processes that originate HABs. It is also critical to observe the evolution of these structures, quantify the concentration of nutrients, classify the chemicals and organisms of the food chain that form the ecosystem of blooms, etc. The greatest difficulty lies in the fact that most of these processes happen beneath the surface, and might originate far beyond several days or weeks before their consequences are observable from the surface, as in the red tide shown in Figure 1.2. Since blooms depend on vertical transport, their spring exhibits a tight relation with upwelling zones. Upwelling is a phenomenon in which a vertical wind-driven motion of dense, cooler, and usually nutrientrich water goes towards the ocean surface, replacing the warmer, usually nutrient-depleted surface water. During upwelling episodes or in upwelling regions, the contribution of nutrient-rich water stimulates the growth of primary producers like phytoplankton. This is the basis for a food chain that supports some of the most productive fisheries in the world. Clearly, the study of this ecosystem demands methods that can monitor and take samples underwater. Furthermore, in those places where the episodes are sporadic, and generally unpredictable, large areas must be continuously sampled at different depths in order to detect the phenomenon since it begins. Vertical transport also happens in the other direction, going from the surface to the ocean’s interior. In oceanic biogeochemistry there is a process known as the Biological Pump, or also Vertical Pump, which is illustrated in the diagram of Figure 1.3. Organic carbon is transported primarily by sinking particulate material —e.g. dead organisms or fecal pellets—, while Dissolved Organic Carbon (DOC) reaches the deep ocean by physical transport processes like downwelling. Also, inorganic carbon such as calcium carbonate (CaCO3), a component of calcifying organisms, reaches the deep ocean by these means. This vertical pump takes CO2from the atmosphere and plays an important role in marine primary production. 1.1 Ocean Research 3 Figure 1.2: Red Algal Bloom. Photo by Miriam Godfrey. It is thought that Climate Change may affect the biological pump in the future, so it turns to be an important process to study as an indicator (Orr et al., 2005). A key requirement for the study of any process and its temporal evolution in the ocean, is the knowledge or estimation of how the water masses move. That is exactly what Ocean Models are designed for, since they solve the oceanic primitives equations in order to obtain the ocean currents. The earliest class of Ocean Model, and still the most widely applied, was pioneered by Kirk Bryan using low-order finite difference techniques (Bryan and Cox, 2011). Since 1970, the computational methods have evolved and, in recent years, the usage of terrain-following coordinates (sigma, hybrid) Ocean Models has led to improvements of the numerical algorithms for time-stepping, advection, pressure gradient, and subgrid-scale parameterizations. Nowadays we can find Regional Oceanic Models (ROMs), which are based on models that can be adapted to relatively small areas. A good number of oceanographic institutions use these models to predict the ocean conditions. In order to run the models adequately, they must be correctly parameterized, tunned and, above all, initialized with the current conditions/state of the ocean system. This is far from being a trivial task, and for that reason ROMs are usually state-of-the-art ocean models tuned for a particular area, which turns to be a complex task in practice; see, as a ROM product example, the ocean currents map of Figure 1.4. A great and heterogeneous number of expensive technologies is required to achieve a proper tunning that allows to obtain sufficient accuracy in the forecast simulations. Such technologies comprises both observation or monitoring, and in situ sampling, e.g. satellites, HF radar, oceanographic buoys, among others. Apart from the main world ocean currents, shown in Figure 1.5, the Ocean Model’s solution must recover the existence of common ocean current structures. The world ocean currents might dominate the net flow in a particular region, but we also find a composition of eddies in general. Such eddies range in diameter from centimeters to hundreds of kilometers, and they may last a few seconds for the former, while the latter may persist several months. In oceanography, those eddies of large diameter and a persistence of days to months are known as Mesoscale eddies. In Figure 1.4 we can see several Mesoscale eddies resolved by the operational 4 1 Introduction Figure 1.3: Biological and Physical (vertical) pumps of carbon dioxide, that operate in the ocean. Diagram by Hannes Grobe, from the Alfred Wegener Institute for Polar and Marine Research, Bremerhaven, Germany. Iberian-Biscay-Ireland (IBI) ROM in the region of the Canary Islands. Also, in order to obtain an accurate modeling of ocean currents and conditions, river and fresh water discharges must be covered as well. River discharges produce plumes in the coastal ocean waters and provide a high contribution of sediments. Hence, both eddies and plumes must be accurately modeled in order to study a number of associated processes in the oceans. Data Assimilation is the process by which observations or measurements are incorporated into a computer model of a real system. This process is critical to obtain a good estimation of the ocean state, and hence it improves the accuracy of the forecast outputs. In brief, observations of the current —and also past— state of a system are combined with the forecast to produce an analysis, which is considered as the best estimate of the current state of the system. Essentially, this analysis step tries to balance the uncertainty in the data and in the forecast. The model is then advanced in time and its result becomes the forecast in the next analysis cycle. In weather forecasting there are two main types of data assimilation (Ide et al., 1997). The first data assimilation methods where 3dimensional (3DDA), in which only those observations available at the time of analysis are used. The other type of data assimilation is 4dimensional (4DDA), in which the future observations are included, i.e. the time dimension is added. Consequently, several institutions offer products that approximate with relatively high accuracy the present and future state of the ocean, i.e. the nowcast and forecasts. This topic constitutes a core task in ocean research, usually known as Operational Research. It is also a capacitating element for other studies like path planning for marine vehicles, tracking evolving structures like eddies, transport and diffusion of contaminants, etc. 1.2 Ocean Monitoring and Sampling 5 Figure 1.4: Ocean Currents forecast in the region of the Canary Islands, computed with the Regional Ocean Model (ROM) of MyOcean project for the Iberian-Biscay-Ireland (IBI) region. We can observer the presence of Mesoscale ocean eddies at the South of the islands. 1.2 Ocean Monitoring and Sampling Consequently, in order to study and model the ocean from the surface to the seafloor, monitoring and sampling techniques are required. Since the successful launch on 27 June 1978 of SEASAT satellite by NASA’s Jet Propulsion Laboratory (JPL), satellite monitoring have been an extremely powerful technique to observe the state of the Earth, and in particular the ocean. SEASAT was the first Earth-orbiting satellite designed for remote sensing of the Earth’s oceans (Fu and Holt, 1982). As many modern oceanographic satellites, it was equipped with a RADAR altimeter, a microwave scatterometer, a multichannel microwave radiometer, a visible and infrared radiometer and a Synthetic-Aperture RADAR (SAR), as shown in Figure 1.6. Such instruments allow to remotely sense several oceanographic phenomena. For instance, the Sea Surface Height (SSH) or ocean surface topography, which is the height above the sea surface, is measured with the RADAR altimeter; the microwave scatterometer allows to measure the sea surface winds; the microwave radiometer can measure the Sea Surface Temperature (SST), as Figure 1.7 illustrates; meanwhile the visible and infrared radiometer identifies clouds, land and water features; and finally, the SAR can measure wave heights and sea ice conditions. Among the most common instruments on board, most Earth-observing satellites are equipped with devices that rely on spectrophotometry and interferometry. The Moderate-Resolution Imaging Spectroradiometer 6 1 Introduction Figure 1.5: World Ocean Currents. Image made by Dr. Michael Pidwirny. (MODIS) instrument, which is on board TERRA satellite, observes up to 36 spectral bands, including the visible spectrum as shown in Figure 1.8. These instruments allows to detect —after some calibration using data samples from the monitored area— visible objects or elements like oil spills, biological organisms or chemicals properties like phytoplankton, chlorophyll A, among others, as with the Sea-viewing Wide Field- of-view Sensor (SeaWiFS) instrument on board the SeaStar satellite launched in 1997. These instruments are not only used in spacecraft systems, but also go on board aircrafts. Although a geo-localization and an Attitude Heading Reference System (AHRS) are required to retrieve the aircraft position and attitude accurately, it is possible to use higher resolution instruments because we can get much closer to the water surface; for instance, these vehicles usually carry spectrometers that sample a greater number of frequency bands than satellites. Last but not least, the Coastal Ocean Dynamics Applications RADAR (CODAR) is a type of High Frequency (HF) RADAR that permits to measure surface ocean currents in coastal waters in almost real time, as well as waves heights and estimate local wind direction. Developed between 1973 and 1983 at NOAA’s Wave Propagation Laboratory (Barrick et al., 1977), modern CODAR can measure out to 100–200km offshore with a rough resolution of 3–12km, but its main advantage over spacecraft and aircraft is that using high frequencies, it achieves resolutions as fine as 200–500m —at the expense of shorten range around 15–20km—, always in real time. However, all the techniques based on remote sensing, as the ones discussed so far, have an important drawback. They cannot observe the state of the ocean and the life it supports beneath the surface; at most, they can see only a few meters depth with good visibility conditions. Both the water itself and Suspended Particulate Matter (SPM) are responsible of that fact. First, most of the sensors on board a spacecraft or an aircraft cannot penetrate more than a few meters (∼20m) in the water column, due to the high attenuation of electromagnetic signals in water; this happens because of water’s high permitivity and electrical conductivity, so plane wave attenuation is higher than in the air (Rhodes, 2006). Secondly, particles suspended in the water reflects the signal and does not allow it to go deeper; this phenomenon is known as backscattering, and it produces a diffuse reflection of the signal, which consequently goes back to the source. Also, some physical, biological or chemical properties of the ocean are not observable with remote sensing instruments, or at least 1.2 Ocean Monitoring and Sampling 7 they are difficult to observe directly, like salinity, dissolved O2, etc. Similarly, in many cases such instruments required a calibration phase using samples taken from the observed region; typically because they estimate the property indirectly, they perform an average or simply as a consequence of the noise introduced by the several atmosphere layers. Consequently, in situ data sampling is required to study water processes along the vertical, i.e. under the surface —in particular, at relatively large depths. The importance of sampling at different depths, beyond the ocean surface, resides on the fact that it is crucial to understand and characterize a great and important number of oceanographic processes. Most of these processes have been briefly discussed previously, which can be physical like upwelling, mesoscale ocean eddies, plumes produced by river discharges, or biological like the vertical pump of CO2, stratification of the ecosystem, study of phytoplankton and vertical transport of organisms and organic components, among others. In Figure 1.9 we have most usual classical sampling technologies. They range from arrays of sensors known as rosettes to weather buoys equipped with several sensors and even Research Vessels (R/Vs) that can carry large and extremely accurate instruments. An important advantage of sampling over remote sensing is the higher resolution and the better quality of the measurements; indeed, instruments on board a spacecraft are calibrated using samples taken from the monitored region. Apart from the old techniques used for data sampling in the oceans —as hemp ropes with a weight to measure the depth, or bottles with papers to estimate the ocean currents—, the first known proposal for surface weather observations at sea occurred in connection with aviation in 1927, with the deployment of weather stations along the ocean to assist seaplanes flights (Lee Dowd Jr., 1927). Nowadays, we can find many types of buoys used to measure a great variety of properties of the ocean surface. Basically, we have moorings, of large size and equipped with accurate Figure 1.6: SEASAT bus and payload configuration. Image taken from Fu and Holt (1982). 14 1 Introduction (a) Bow nose of the SLOCUM glider with the bladder, of black rubber, partly empty. (b) Swim bladder of a Rudd fish. Figure 1.13: Analogy of the bio-inspired bladder that controls the glider buoyancy. ocean currents maps, which may include forecasts computed with the Ocean Models discussed so far, and intelligently finds the list of waypoints required to reach a particular region, despite of the ocean currents. The RU27 glider was piloted this way in the trans-Atlantic mission, which final trajectory is shown in Figure 1.14. A good glider pilot must have some knowledge of the ocean behavior, its structure and dynamics, apart from the technical details of the glider navigation and control system. Therefore, in order to analyze ocean currents forecasts appropriately, some oceanographic background is demanded. But not only that, since the temporal variability of ocean currents is high, particularly near the coast and at sub-mesoscale level, it is possible to exploit such information, as we explore in this thesis. However, for a pilot this task becomes quite complex under such conditions, because of the great volume of data and the great difficulty to establish the optimal path when currents vary drastically in short periods of time —e.g. in hours. In any case, a path planner applied to pilot gliders using dynamic ocean currents maps produced by Ocean Models, is always useful because it allows to automate the piloting. Also, in those regions of high variability and complexity, path planning algorithms can find a feasible path to the target waypoint, with the warranty of optimality, or 1.4 Autonomous Underwater Glider Piloting and Path Planning 15 Figure 1.14: Path followed by the RU27 Scarlet Knight (SLOCUM) glider in the trans-Atlantic mission, accomplished in 2010. Mission headed by the Rutgers University, with the collaboration of the Division of Robotics and Computational Oceanography (DROC), SIANI. at least it will be close to the optimal. In sum, the main advantages of glider path planning with respect to traditional manual piloting are the ability to consider all the high temporal dynamics of the ocean currents —as computed in Ocean Models forecasts— to obtain feasible and nearly optimal paths to the target waypoint automatically. Path planning techniques applied to glider piloting have a great potential for various reasons. First, it is a key element for true automatic, intelligent and efficient piloting. In the case of SLOCUM gliders, some sort of automatic waypoint modification is required, since the current software does not support it, and still requires the intervention of the pilot. The integration of such tools and a path planner would allow for less human-assisted and more autonomous glider missions to be accomplished at the ocean. Secondly, when tracking evolving features or structures like eddies, path planning techniques can incorporate the logic to obtain adaptive sampling paths that help to characterize the phenomenon. Such path planner would take into account the temporal evolution and variability or dynamics of the structure, which is very difficult to manage manually by a glider pilot. And last but not least, gliders can be considered Lagrangian driven drifters that can contribute data samples to improve Ocean Models by means of data assimilation. This thesis covers several problems —with a number of associated applications— that can be solved with path planning techniques. The most basic problem tries to find the optimal path from a start waypoint Ato a target one B, which is classical path or motion planning problem in Robotics. The classical solution is the A* algorithm (Hart et al., 1968) that, based on Dijkstra’s algorithm (Dijkstra, 1959), obtain better performance by means of using heuristics. It also allows for obstacle avoidance and there are many variants that deal with extensions of the original problem. However, even for the basic problem, when applied to ocean gliders, even the basic A* must be adapted to accommodate the particularities of glider path planning: in brief, the glider navigation scheme, and the effect of the ocean currents, which are function of the space (x, y, z)and time 16 1 Introduction t. In this dissertation, apart from the basic path planning problem, we also cover path planning for multiple vehicles with coordination constraints, path following and moving targets or evolving ocean structures like ocean eddies. Several state-of-the-art techniques have been extended to support glider path planning and novel approaches are also proposed to capture the particularities of glider’s navigation. The algorithms analyzed range from graph-based techniques as A*, to probabilistic sampling methods like Rapidly-Exploring Random Trees (RRTs) (Lavalle, 1998), and optimization approaches like Genetic Algorithms (GA), Simulated Annealing (SA) and Iterative Optimization. We have tried to design and implement all the algorithms in this work with the glider navigation pattern in mind, because here we focus on contributions to the particular field of glider path planning. However, some proposals may be applicable to similar planning problems, which lie under a category that can be defined as path planning in variable asymmetric cost environments, although still with some peculiarities, as we will later discuss. 1.5 Thesis Hypothesis This PhD work delves in the following thesis statement: Novel Path Planning algorithms designed for the problem of Autonomous Underwater Gliders (AUGs) navigation bring the possibility of computing (sub-)optimal paths automatically, and hence improve, simplify and, in some cases, enable missions in zones with strong ocean currents that exhibit a complex distribution or a high temporal variability. Put differently, our hypothesis is that the current way of piloting ocean gliders can benefit from path planning algorithms. Such benefits will be evident and remarkable in certain scenarios, which are those of high temporal variability and strong ocean currents. Although the automation of glider piloting is of interest per se, a path planner can also help in the task of finding the optimal trajectory to reach a point, stay at a given position, among others tasks. Therefore, it can improve many factors of the mission —e.g. time, autonomy, safety, etc.— and what is best, it might turn into feasible some kind of missions that were particularly difficult to perform formerly. Our intention is also to show that classical path planning techniques, and some of the concepts they are based on, can be exploited to adapt them or design novel approaches for ocean gliders. Indeed, we will introduce several methods that are inspired in graph-based methods, probabilistic search and optimization. This dissertation tries to show that these techniques manage the problem properly, since they consider the peculiarities of the problem, and hence are susceptible of being incorporated in real missions/conditions. Also, the experiments will allow to categorize the methods depending on the complexity of the scenario —obstacles, strong currents, high temporal dynamics, etc. Finally, a special effort is made to reduce the computational time of our techniques, so they can be run during the short time intervals the gliders are at surface to localize themselves and communicate. The path planners are therefore able to find a path within this time, and the resulting bearing command can be uploaded to the vehicle before it submerges again. Similarly, we explore the applicability of these techniques to concomitant problems. This is the case of multi-glider coordination, obstacle avoidance, navigation under constraints, path following, area surveillance, tracking evolving ocean structures like ocean eddies, among others. Then, we discuss how these methods can be extended to support other problems, and further generalization concerns. 1.6 Limitations and Scope In this thesis we try to answer the following questions, which together define the scope and extension of the present work. 1.6 Limitations and Scope 17 •In the field of Robotics, the Path Planning literature gathers an important number of algorithms that are generally used to solve the problem of finding the (quasi-)optimal sequence of state configurations that allows a robot to move from one pose or position to another. It is of great interest to study whether these methods are applicable in the field of gliders path planning or not. For instance, is A* search applicable? Can it be adapted to deal with the problem? or is there some particularity that prevents it to be done, or does it turn to be an inefficient approach? •We will see that classical or common path planning methods are not directly applicable to the problem at hand, unless they are adapted —sometimes significantly. At this point, we will try to answer which are the particularities of path planning for Autonomous Underwater Gliders (AUGs) that justify such need for adaptation. Consequently, it will be possible to give some insight to the following questions: –Which are the differences with respect to other problems that are solved with classical path planners? Here, we refer to problems like path planning in mazes, cost maps —e.g. relief maps—, etc. –What reasons explain why classical techniques are not applicable or useful in this case? Or what impede them to manage the problem efficiently? •The study of the literature and the state-of-the-art should allow us to find out which kind of problem we are trying to solve, i.e. within which category is taxonomically classified by other authors, or at least to establish the most similar. •From a more pragmatic point of view, we want to investigate and engineer several methods to address the problem. In the present work we will implement several novel techniques to give some evaluative assessment for a representative sample of glider path planning scenarios. This assessment will be twofold. First, evaluate the optimality of the solution or how far from the optimum is it —or how much does it improve other state-of-the-art methods. Secondly, the computation time and the usage of memory resources. •In connection with the previous question, we will be able to compare our results with other approaches that might already exist in the literature of this topic. We could answer then, how other authors deal with the problem and which simplifications and assumptions do they make. And hence, we will try to see whether the algorithms designed for glider path planning scale and are generalizable or not, i.e. if they can be apply to more general path planning problems. •Regarding the dimensionality of the problem, we will see that the ocean modeled processes have 4 dimensions from the point of view of glider path planning, neglecting the vehicle configuration and dynamics. Being underwater vehicles, gliders navigate through the three-dimensional water mass, which also moves significantly over time. Also, we could consider, or just neglect, some characteristics of the vehicle dynamics and the navigation, as the gliding angle, the minimum and maximum depths of the yo-yo profiles, the nominal speed, and so on. How to manage all this complexity and high dimensionality of the problem efficiently is also a concern of the present work. Similarly, we want to see whether it is possible to ensure the optimality of the solution found, or just to some extent and under certain assumptions. And also, analyze in which cases is more difficult to ensure such optimality. •From the implementation and evaluation of different techniques we will obtain some intuition of which ones are more suitable for certain conditions or scenarios. Some categorization of the scenarios will reveal as well, e.g. clutter areas that demand obstacle avoidance logic, high temporal variability zones, strong currents, etc. The questions above define the scope of the present thesis, since it tries to answer each of them. But it is also important to put clear the limitations or assumptions made in this work, which are there to reduce the complexity of the problem and tackle it adequately. 18 1 Introduction •Regarding the high dimensionality of the problem, we will have to reduce it to some extent. For this reason, we will assume a simplified motion model for the glider. Also, in some cases path planning will be done considering 2D surface currents, hourly spaced in time, while in others we will take the 3D ocean currents, although they will be daily means. We will see that this reduction in the dimensions of the problem is often acceptable, while it reduces the complexity substantially. •Some of the particularities of typical glider missions and piloting are neglected often. In some cases it is not possible to observe some phenomena, like biofouling, which affects the glider speed and trimming. As a consequence, the glide angle, and even roll change, and it might produce some bias in the heading. Similarly, the weight, the mass center and the glider’s buoyancy varies, with an important reduction on the glider nominal speed. In others we can only estimate with some error a certain parameter, like the time the vehicle stays at surface. Also, sometimes we do not model such aspects because we want to analyze the rest of the system, ignoring their effect. Indeed, we have implemented simple models for them, although it is still difficult to obtain the real values of a given mission in advance, before path planning. •The embedded systems and software that state-of-the-art gliders have on board is still very restricted in capabilities. Hence, in practice, automatic piloting is not straightforward. Although not strictly a limitation, we have covered this fact in our simulations. Similarly, since the quality of the deadreckoning is quite bad, communications are not possible, and the drift produced by ocean currents is not observable while submerged, a path planning approach with discrete commands widely separated on time is required. If that not were the case, we could formulate a different path planning scheme, in which we could vary the vehicle heading —or even other navigation parameters— more frequently. However, even in that case, the current vehicles would not be able toi have the ocean currents maps on board to update its heading accordingly, neither the computational power to handle them. Path planning would be of interest even in such case, hence. 1.7 Thesis Outline Before we describe the outline of this dissertation, it is worth mentioning that this thesis is not about developing the differential equations of ocean models, neither the initialization and resolution of them. Here we simply take their results as inputs. We will call such results ocean model products, and we will describe the most common ones, what they represent, and what are they useful for, as well as their connection with path planning methods later in Appendix A. In brief, it will give an introductory overview of ocean modeling and data assimilation. Also, the discretization resolution of the output is relevant when doing path planning, so we will introduce an ocean model taxonomy based on their scale, and will discuss the importance of Regional Ocean Models (ROMs) in coastal zones. The present document is composed of three main chapters that explain and explore the field of Ocean Research with Autonomous Underwater Gliders, along with the results and contributions of this thesis to the area. The first two chapters begin with a review of the state-of-the-art at the time of writing this dissertation. Then, a thorough analysis of some techniques suitable for the problem is included and validated with extensive simulations and experiments, as well as field trials. Given the introduction to the field of Ocean Research of this chapter, we will start the next chapter by discussing the sampling technologies based on underwater vehicles. We connect the dissertation with the field of Underwater Robotics, and hence with Autonomous Underwater Vehicles (AUVs). Autonomous Underwater Gliders (AUGs) are briefly described in the first sections, bringing into focus their tight relation with ocean sampling and the great versatility they incorporate into this topic. This is a consequence of the great autonomy and the ability to move of these sampling platforms, as a main difference with respect to oceanographic buoys or propelled AUVs. 1.7 Thesis Outline 19 In Chapter 2 we also delve into the details of AUGs, that we will indistinctly called ocean gliders or just gliders in the sequel, as well. Since path planning methods have to model the vehicle that is going to navigate the maps, we must study thoroughly the principles that govern the kinematics and —to some extent— the dynamics. We will describe how gliders operate on water, the phases of a typical oceanographic mission, and the communication and navigation mechanisms. Regarding the glider’s dynamic model —which also depends on the particular vehicle and its setup—, we will show different alternatives that we have considered; a punctual model, a more elaborated force balance model, and even dynamic models. At the time of writing this thesis, there exists some remarkable models of gliders that deserve to be mentioned and discussed in detail. We will dedicate some lines to the description of Teledyne Webb Research’s SLOCUM glider, Bluefin’s Spray glider2and iRobot’s Seaglider3. It is also worth mentioning the great interest on this vehicles, which have boosted up several glider network initiatives, like the European Glider Observatory (EGO), organizations and universities that are actively working with gliders, like the National Oceanography Centre Southampton (NOCS), University of Southern California (USC), Queensland University of Technology (QUT), Balearic Islands Coastal Observing and Forecasting System (SOCIB), Oceanic Platform of the Canary Islands (PLOCAN), among others. Ocean gliders are nowadays a successful tool for long-term oceanographic surveys, they are used to retrieve ocean parameters that help in climate change studies, the industry and the navy are using them for their daily tasks, and much more. These vehicles have become a proven technology to operate in the sea and a robust, efficient and relatively low-cost tool for many tasks. We will enumerate some of them and how they are accomplished. In particular, we will elaborate on the piloting of ocean gliders with the software capabilities and applications provided by the manufacturers, like SLOCUM’s DockServer. We will introduce the concept of automatic piloting in this area, what advantages it incorporates to the missions, describing which systems have still to be developed, and how it turns into feasible some specific types of missions that would not be possible otherwise. In Chapter 3 we give a list of glider path planning problems and applications. We will start with different objective functions, for the two atomic optimization problems we identify in the field of glider path planning, being the minimal time path and the minimal distance to the target problems. Multiple gliders and constraint path planning is covered, since it is of great interest to study large ocean structures at several points simultaneously, or just for a cross-validation of the vehicle sensory suite. Apart from this sort of coordination, we also include the problems of path following or hold-track, and tracking of evolving ocean structures. An exhaustive analysis of ocean eddies is included, with their description, techniques to detect and characterize them, and their relevance and connection with Harmful Algal Blooms (HABs). From the point of view of glider path planning this introduces a variety of approaches to assist in the process of finding the centroid and boundary of the eddy over time, which requires a search for the optimal navigation pattern around the structure. We will finish these first chapters with the list of the path planning techniques developed and a thorough description and comparison of them in Chapter 4. At that point, we will start with an introduction to Path Planning in the area of Robotics and Artificial Intelligence, in order to settle down into the general problem, and finally cover the specific case of AUGs. The different approaches designed to tackle the problem will be described in detail. Also, other techniques are explained and reasons are given to show why they are difficult to adapt for gliders. The experimental results derived from the application of the techniques developed in this thesis is covered in Chapter 5. The Regional Oceanic Models (ROMs) used, and the scenarios or zones considered in the experiments are listed and described in terms of their temporal variability, ocean currents strength, presence of obstacles or low bathymetry depth, among other relevant features. Similarly, the glider motion model employed —from the ones available— in the path planners is defined and how the dead-reckoning is computed inside the planner kernel. 2The Spray glider was originally developed at Scripps Institution of Oceanography (SIO) under Dr. Russ Davis. 3The Seaglider was originally developed at the Applied Physics Laboratory (APL) of the University of Washington. 20 1 Introduction The results obtained with several techniques —novel and classic— appear in this document sorted by problem or application. That is, for each application —e.g. go to a target, path following, obstacle avoidance, multi-glider coordination, etc.— we show the solution found with different algorithms, which are compared then. Finally, we also discuss the field tests performed, starting with the mission setup, to later explain the data acquired and evaluate the path planning methods in real conditions. Also, some sort of validation of our path planners and the input products —i.e. ocean currents maps— computed by ROMs is included. Finally, the last chapter of this thesis discusses the contributions, puts clear the conclusions and enumerates the conference papers and journal publications derived from this work. Also, further work is proposed to continue the research explored here. In brief, this covers more experiments, including field tests. Apart from the main matter of this dissertation, a few appendices are included at the end to provide complementary information and details. Chapter 2 Ocean Gliders In the introduction we have justified the great potential of ocean gliders for Ocean Research. They constitute an effective vehicle to monitor large regions for long periods of time, at a relatively low-cost investment. It is the particular propulsion system they use what confers on them such a large autonomy to operate at the oceans. However, it is also the origin of the slow speed they can generate to move underwater. Since the speed of the ocean currents can be equivalent —or even greater— to such speed, the vehicle drifts while it moves, and an intelligent and planned strategy is required to reach certain locations at the sea. In the next chapters we will address this particular task and the problems or applications it can help to solve. Before we described the most common glider path planning problems and the algorithms developed in this thesis, we will see here that the motion model of the vehicle plays an important role in the design of the path planner, particularly in the case of AUGs. For this reason, the next sections give a thorough description of ocean gliders, the piloting and navigation, and the mathematical formulation of different glider motion models. Three motion models are presented: a simple, but practical, point model; a force balance motion model; and references to dynamics motion models that, as we will see, are not required for path planning and, consequently, are out of the scope of this thesis. 2.1 Autonomous Underwater Gliders We have already described briefly ocean gliders in the introduction. Here we will give a more detailed explanation, from the perspective of Underwater Robotics. After a succinct categorization of underwater robots, we describe the principle of operation of ocean gliders. Later, this will be the basis of the glider motion models described in Section 2.2. These motion models are an essential element of the glider path planning algorithms developed in this thesis, since they will integrate the glider motion in order to evaluate the cost of traveling from one point to another. In Underwater Robotics, we distinguishe different types of vehicles depending on their autonomy and target applications. On one side we find Remotely Operated Vehicles (ROVs), which are tele-operated vehicles that are connected to the surface vessel or pilot with an umbilical. The umbilical cable transmits the commands sent by the human operator, and sends back the data gathered underwater; it also provides power to the vehicle. On the other side, we have truly Autonomous Underwater Vehicles (AUVs), which navigate and perform some tasks autonomously. Both ROVs and AUVs are known as Unmanned Underwater Vehicles (UUVs), since there is no human on-board, reducing the risk, cost and size of the vessel. Two representative examples of ROVs and AUVs are shown in Figure 2.1 (a) and (b), respectively. Depending on the target application, we find different types of AUVs. Generally, they are propelled by several thrusters, so their autonomy is limited to a few hours —e.g. 100h at 4knot for the Hugin 1000 AUV (Konsberg, 2013). However, we can distinguish between cruising and intervention vehicles. Torpedo-shape 21 22 2 Ocean Gliders (a) AC ROV. (b) SPARUS AUV. Figure 2.1: Examples of Unmanned Underwater Vehicles (UUVs): (a) AC ROV property of QSTAR, and (b) SPARUS AUV designed by the Centre d’Investigaci´ o en Rob` otica Submarina (CIRS). Images taken at (a) FIMAR 2013 and (b) the 2nd Field Training School in Autonomous Underwater Robotics Intervention. AUVs operate offshore in long-range cruising or survey missions, while intervention vehicles can also perform tasks in confined environments and even do some sort of manipulation (Ribas et al., 2012). Autonomous Underwater Gliders (AUGs) lie within the first category, although they are not propelled vehicles. They incorporate an efficient propulsion system that allows them consume very low energy to navigate in the ocean, so the autonomy is increased to several months. 2.1.1 Description AUGs, or ocean gliders, propel themselves by changing their buoyancy and using wings to produce forward motion. Here we follow the description of the principle of operation of gliders given in the work of Bishop (2008). The mechanism of propulsion is known as a buoyancy engine, which in the case of the SLOCUM glider (see Figure 2.2) can ingress or expel ∆Vbp = 250cc of fluid. In Section 2.2.3 we will see the balance of forces in the vehicle and the resulting speed for ∆Vbp and other parameters like the pitch θ. In fact, a primary pitch control is achieved by placing the buoyancy engine in the nose cone of the vehicle. A more precise tuning of the pitch is given by the movement of the internal batteries. Figure 2.2: SLOCUM glider designed by Teledyne Webb Research. 2.1 Autonomous Underwater Gliders 23 Figure 2.3: Diagram of the yo-yo profile and saw-tooth pattern followed by a glider while it navigates underwater using the oil bladder and pump. The most common depth interval for an underwater stint and the time spent at surface are given. Note that in the figure the dimensions are not proportional, and the pitch angle is exaggerated. The travel distance for a 6–12h yo-yo profile is ≈10 –20km, gliding at Ug= 0.4m/s = 1.44km/h, and the pitch angle is ≈35◦. Also, depending on the glider model, the depth interval can be 20 –200m or 20 –1000m, in the most general case nowadays. Basically, the pitch allows the wings and the hull to produce the hydrodynamic lift required to propel the glider horizontally, while it dives or climbs as a consequence of the change in buoyancy. As a result, the vehicle describes a vertical saw-tooth pattern while it moves, as shown in Figure 2.3. Each cycle of consecutive dive and climb movements is referred as a yo, hence the trajectory underwater is known as a yo-yo profile. This propulsion system produces an effective but low horizontal speed Ug, usually below Ug≤0.4m/s. Consequently, gliders are strongly sensitive to ocean currents Uc, so they might have to adapt the bearing ψg to the ocean current velocity field in order to travel along the desired/commanded heading ψe.1 In terms of power consumption, the glider saw-tooth profile is very efficient, since the gravitational force is used as the power source for propulsion, that is the most critical task for AUVs persistence. Besides processing and communication, the batteries are only used intensively during a small fraction of the cycle time to change the vehicle buoyancy, by means of an electric buoyancy pump; and, much less demanding, to modify the vehicle attitude and bearing angle ψgwhile underwater using low consumption actuators. Going one step further, the thermal gliders replace the electric pump by thermo-active materials that react to the temperature gradient of the ocean, extending the vehicle range to allow, theoretically, planet circumnavigation. 1We follow the notation of Keay (1995) for the bearing and heading, where bearing is equivalent to course, being the orientation of the forward movement of the vehicle. 30 2 Ocean Gliders Longitude (◦) Latitude (◦) Figure 2.8: Unconstrained Point motion model applied to a series of trajectories varying Ugfrom 0.01m/s to 0.40m/swith 0.01m/sincrements . Given the heading error ˆ ψeifor each stint i, we may analyze the effect of Ugfor different surfacing points of the RU27 glider path (ground truth) xi. The trajectories for Uc= 0m/s,Uc= 0m/sand ˆ ψe= 0◦, and a drifter (Ug= 0m/s) are shown too. is small, as shown in the first figure. As we will later show formally for the constrained motion model, if we impose the vehicle to follow a given heading ψe, in many cases that will be unfeasible because of the ocean currents. In the presence of strong ocean currents, this will lead to situations in which many trajectories are simply discarded because the heading cannot be followed. On the contrary, here with the unconstrained motion model we just compute the effective speed Ue, regardless of the resulting trajectory and heading followed, which will probably be non-constant, as in the figures. The effective speed Ueis computed for the unconstrained motion model using Ue=Ug+Uc(2.1) where Ugis the glider nominal speed and Ucis the speed of the ocean current through the path Pdescribed by the glider. Here, the speeds are in vector form, and correspond to the two-dimensional case, in which the overall effect of underwater ocean currents is projected onto the surface. Since Ucis different at each point in the environment, we must integrate the velocity through P. Hence, we have Ue=Ug+Zxi xi−1 Uc(x)dx(2.2) for a path Pstarting at xi−1and ending at xilocations, that will correspond to surfacing points. The integral along the path Pis typically discretized and integrated numerically for a fixed time tsbetween surfacings. Such integration allows to obtain the glider trajectory under the ocean current field conditions. Therefore, we implement the following recursion Ue(t) = Ug+Uc(x(t), t)(2.3) x(t+ 1) = x(t) + Ue(t)·∆t(2.4) 2.2 Glider Motion Model and Dynamics 31 Algorithm 2.1 Trajectory integration. Require: Surfacing time tsand integration step dt. Glider nominal speed Ug, ocean currents velocity field Uc(x)for all locations x, and initial location x0. Ensure: Final location xtsafter integrating the trajectory for tstime. Algorithm: trajectory(ts,dt,Ug,Uc(x),x0)return xts 1: x=x0.Initial location 2: for all t= 0 to tswith step dt do 3: Ue=Ug+Uc(x) 4: x=x+Ue·dt 5: end for 6: return x where ∆tis the integration step and x(0) is initialized with the initial location of the vehicle. The integration algorithm is summarized in Algorithm 2.1. The time tis discretized according with ∆t, and the position of the glider is integrated until we reach the surfacing time ts. We actually do not have to select ∆t, since this Ordinary Differential Equation (ODE) can be solved numerically using fourth and fifth order Runge- Kutta formulas (Dormand and Prince, 1980). In this process, we generally need to interpolate the ocean currents Uc(x(t), t)at every location x(t)of the trajectory, and time t. Although we can simply use the Nearest Neighbor ocean current, a decent simulation of the glider trajectory requires at least some linear interpolation, in 2,3or 4dimensions —including the time t, for dynamic ocean currents. If more accurate results are required, we can use more precise techniques like the tricubic interpolation in 3dimensions of Lekien and Marsden (2005), which addresses the precise interpolation of ocean currents measured with CODAR. It is straightforward to extend the unconstrained motion model to the 3spatial dimensions, i.e. including the depth motion. In 3dimensions the model also requires the pitch angle θas an input. Therefore, a glider modeled as a moving point follows these differential equations ˙x=u+Ugcos θcos ψ(2.5) ˙y=v+Ugcos θsin ψ(2.6) ˙z=w+Ugsin θ(2.7) where Ug,ψand θare the glider’s nominal surge speed, heading and pitch, and where u,vand ware the x,yand zcomponents of the ocean current speed at a given location (x, y, z)and time t. As usual, (x, y, z)represents the longitude, latitude and depth, respectively. The pitch θcan take any angle in the range [−π/2, π/2], where positive values indicate a dive, and negative indicate a climb, in the yo-yo profile. Although the ˙zdifferential equation above accommodates any θ, the pitch is actually a function of the time t. Indeed, it changes at the minimum zmin and maximum zmax depth points in which the glider’s pump actuates on the oil bladder. At these points, the pitch changes its sign. Hence, we have a piecewise function θ=fθ(t) = (θdive if diving θclimb if climbing (2.8) Consequently, we must integrate each piece separately, and to do so we must know the integration time Tfor each piece —i.e. for each dive or climb. Although θ∈[−π/2, π/2], it is easier to assume that we have a flag to indicate whether the glider is diving or climbing, and we always have θ∈[0, π/2], i.e. |θ|. This trick allows as to obtain T, but now the differential equations above are only valid when the vehicle goes down. On the contrary, when it goes up, (2.7) changes sign; meanwhile (2.5) and (2.6) remains the same, since the pitch θonly affects the depth zcomponent. ˙z=w−Ugsin θ(2.9) 32 2 Ocean Gliders We still have piecewise differential equations, for each ˙z, so we must compute the integration time Tfor each, taken the solution of the previous as initial value. The integration time Tis computed from the depth interval, which is T=∆z ˙z=z(t0+T)−z(t0) w±Ugsin θ(2.10) We assume null vertical ocean currents w= 0, which is generally the case, so T=z(t0+T)−z(t0) ±Ugsin θ(2.11) Hence, according with the yo-yo profile, the depth interval can only take two different values: ∆z=(∆zout =zmax for (outer) first and last yos ∆zin =zmax −zmin for inner yos, if any (2.12) Now we can take the absolute value of the depth speed ˙z, and hence the integration interval is simply T=∆z Ugsin θ(2.13) Also, in order to ensure that the vehicle is at surface when the stint is done, the following equation must be used to compute the time Tuunderwater, given the number nof yos and the depth interval [zmin, zmax], assuming that we start at z= 0 and finish at the surface as well. Tu=2 (∆zout + (n−1)∆zin) Ugsin θ(2.14) We can also estimate the position at surface given the time drifting tdthere, in order to simulate with more precision the trajectory of a glider during a real mission. In this case we use the equations of a drifter at surface, i.e. we set ˙z= 0 in place of (2.7). This is exactly a bi-dimensional unconstrained motion model with Ug= 0m/s, that can be included in the path planning algorithm to take into account the td≈15min the glider spend at surface. 2.2.2.2 Constrained Motion Model A constrained point motion model works radically different from the unconstrained one described in the previous section. Now we basically solve the navigation problem of going from a start location x0to an ending location x1. The angle between x0and x1defines a heading ψethat we want the vehicle to follow. Therefore, given the ocean currents vector Ucand the glider nominal horizontal speed Ug, the navigation problem consists on finding the bearing angle ψgrequired to move in ψe, if possible. Indeed, when the ocean currents are stronger than Ug, there exists a range of heading angles ψewhich are infeasible, i.e. there is not bearing ψgthat allows the vehicle to reach x1heading in ψe. Given the glider nominal speed Ug, the desired course or heading ψe, and the ocean current speed Ucand direction ψc, we can compute the drift correction that the glider must apply to keep such heading. Thus, we obtain the bearing ψgwith ψg=(ψe+ arcsin sif |s| ≤ 1 @otherwise (2.15) and the resulting speed Uewith Ue=(Ug√1−s2+Uccos ψec if |s| ≤ 1 0otherwise (2.16) 2.2 Glider Motion Model and Dynamics 33 where s=Uc Ug sin ψec (2.17) and ψec =ψe−ψc. Regardless of the angle difference ψec, we can defined the speed ratio SR as SR =Uc Ug (2.18) which allows to categorize ocean currents as strong or weak, depending on whether SR > 1or SR < 1, respectively. Consequently, if Ug> Ucthe set of feasible heading angles ψeis unbounded. Otherwise, this set is delimited by a so called accessibility cone with an arc angle ψrgiven by ψr= 2 arcsin Ug Uc (2.19) For the special case of Ug=Ucwe have ψr=π 2. Thus, a heading ψeis physically feasible if and only if it falls in ψe∈[−ψr 2,ψr 2]. Note that in the particular case of Ug=Ucthe condition |s| ≤ 1is always true, since s= sin ψec. Operating, (2.15) and (2.16) are reduced to ψg=(2ψe−ψcif |ψec| ≤ π 2 @otherwise (2.20) and Ue=(2Ugcos ψec if |ψec| ≤ π 2 0otherwise (2.21) respectively, satisfying Ue≥0. Uc Ug Ue x ψc ψe ψg Figure 2.9: Vector composition for drift correction. A bearing ψgmust be commanded to obtain a heading or course ψethat can beat a current of direction ψc. The resulting effective velocity Uedepends on the glider speed Ugand the ocean current speed Uc. In Figure 2.9 is depicted the vector composition of the drift correction process. Notice that all this velocities U·are not vectors, but magnitudes kU?k. We assume Ue= 0 when it is not possible to keep a particular heading ψe. This is usually a consequence of a low glider speed Ugrelative to the ocean current speed Uc, which forces the glider to navigate following the ocean current direction ψc. Soulignac et al. (2008) develop an alternative deduction of this motion model in his work, which does not use trigonometric functions. The resulting expressions are completely equivalent to the ones shown thus far, but are faster to compute in general. 34 2 Ocean Gliders According to Soulignac et al. (2008) the temporal cost tof the movement dverifies d= (Ug+Uc)·t. Projecting this equality on xand yaxis yields (dx= (Ugx+Ucx)t dy= (Ugy+Ucy)t=⇒(dx−Ucxt=Ugxt dy−Ucyt=Ugyt(2.22) The relation U2 g=U2 gx+U2 gyallows us to eliminate Ugxand Ugyin (2.22), leading the relation (dx−Ucxt)2+ (dy−Ucyt)2=U2 gt2(2.23) that rearranging for tyields (U2 g−U2 c)t2+ 2hd·Ucit−d2= 0 (2.24) where d2=d2 x+d2 y. Solving this second degree equation of (2.24), we have t=     √∆−hd·Uci U2 g−U2 c if ∆≥0 ∞otherwise (2.25) where ∆ = U2 gd2−(Ucxdy−Ucydx)2and h·iis the scalar product. Note that tis defined only if ∆≥0, in order to satisfied that t≥0. Here, in the particular case of Ug=Ucthe second degree equation of (2.24) becomes the one degree equation 2hd·Ucit−d2= 0 (2.26) and solving, we simply have t=d2 2hd·Uci(2.27) The main application of this constrained motion model is concerned with the implementation of graphbased path planning algorithms. This type of methods uses a grid search space which must be explored for the optimal solution. In order to move from one node ni—that represents a surfacing point— to its neighbor nodes ni+1 in the grid, we must apply the constrained motion model described here; see the A* algorithm in Section 4.3 for instance. It is possible to extend the motion model to 3dimensions, but for gliders it is not really required because underwater they move non-holonomically following the saw-tooth pattern that restricts the vehicle maneuverability considerably. That is, we only need to look into the search space defined by the surfacing points. Anyway, in order to obtain a good simulation of the glider motion while underwater, we must average the ocean currents from nito ni+1. In practice, if the search space grid resolution is sufficiently precise, the ocean currents are similar in the region around niand ni+1, so even a single value may suffice, i.e. it is considered constant. Therefore, we can take the ocean current vector Ucat ni, or the depth average from nito ni+1 in order to represent the fact that the gliders are actually affected by the underwater ocean currents while they navigate performing yo-yo profiles. 2.2.3 Force Balance Motion Model A more elaborated —but still kinematic— motion model is the one proposed by Merckelbach et al. (2010). It is based on the equilibrium of the forces actuating in a glider while it dives or climbs. Figure 2.10 depicts these forces and the angles that describe the motion and the vehicle attitude in the xz plane for a climb motion. As we will see in the equations below, this model depends on a number of parameters associated with the vehicle shape and the navigation system, i.e. the buoyancy pump and the wings. With this model 2.2 Glider Motion Model and Dynamics 35 we have a good approximation of the glider vertical and surge speed, which allow for a better dead-reckoning than the simple point model. However, the main drawback of this model is that we must identify a great number of parameters that depends on each vehicle and are usually unavailable. The constraints imposed by the surfacing points and vertical speed estimated from the depth measurements of the pressure sensor, help in such identification, but it is usually not enough, and flow simulations or water tank tests are generally required. Anyway, here we develop the equations of this force balance model and show some results that evaluate the model characteristics and dependence with respect to the most remarkable parameters, like the buoyancy change and the pitch angle. x z ysea surface γ θ α γ GC FD FL FB Fg Figure 2.10: Force balance diagram that represents a glider moving in the xz vertical plane along with the forces involved and the definition of angles. This diagram follows the one in (Merckelbach et al., 2010). The forces working on a glider vehicle are the buoyancy FB, which goes up to the surface; the gravity Fg, which goes down in opposite direction to FB; the lift FL, which goes perpendicular to the movement, and consequently points down or up, when the glider climbs or dives, respectively; and the drag FD, which goes backwards, against the movement. The lift is responsible of generating the forward movement of the vehicle, as long as it is enough to compensate for the drag force FD. The pitch angle θrepresents the angle of the vehicle’s horizontal axis with respect to the horizontal plane. The glide angle γrepresents the angle of the climb/dive plane with respect to the horizontal plane, and it includes the angle of attack α, which is produced by the wings and the hull design dynamics. Hence, the difference between the glide angle γand the pitch θis the angle of attack α. According with the diagram of Figure 2.10, the vertical and horizontal force balances are FB−cos γFL−sin γFD−Fg= 0 (2.28) −cos γFD+ sin γFL= 0 (2.29) respectively, where FBis the (net) buoyancy force, Fgis the force due to gravity, FLis the lift force, FDis the drag force and γis the glide angle, defined as the sum of the pitch angle θand the angle of attack α, i.e. γ=θ+α. The force due to gravity is given by Fg=gmg(2.30) where mgis the mass of the glider and gis the acceleration due to gravity. 36 2 Ocean Gliders The net buoyancy force is given by FB=gρ(Vg(1 −εP +αT(T−T0)) + ∆Vbp)(2.31) where ρis the in-situ density, Vgis the glider volume at atmospheric pressure, εis the compressibility of the hull, Pis the water pressure, αTis the thermal expansion coefficient, Tis the water temperature, T0is a reference water temperature and ∆Vbp is the buoyancy change produced by the buoyancy engine. The drag and lift forces are given by FD=1 2ρCDSU2(2.32) FL=1 2ρCLSU2(2.33) where CDand CLare the drag and lift coefficients, respectively, Sis the wing surface area and Uis the glider velocity through water along the glide path. The total drag is the combined effect of the parasite drag and the induced drag, and can be parameterized as CD=CD0+CD1α2(2.34) where CD0is the parasite drag and CD1a coefficient determining the induced drag. Decomposing the total drag into drag due to the hull and wings, respectively, we write CD0=CD0,h +CD0,w and CD1= CD1,h +CD1,w . The induced drag due to the wings can be parameterized as CD1,w =a2 w πAe(2.35) where e≈0.8is the span efficiency parameter. The other drag coefficients can be measured directly. The total lift is modeled as the sum of the lift generated by the hull and the lift generated by the wings. However, under normal flight conditions the angle of attack is generally small, so the lift coefficient can be parameterized as CL= (ah+aw)α(2.36) where ahand aware the lift slope coefficients for the hull and wings, respectively. A semi-empirical formula for the lift slope coefficient for the wings, accounting for the lift reduction due to the wing sweep angle Ωand the aspect-ratio A, simplifies to aw=2πA 2 + pA2(1 + tan2Ω) + 4 (2.37) On the other hand, the slope coefficient for the hull ahcan be measured directly. Substituting (2.34) and (2.36) into (2.32) and (2.33), respectively, yields FD=1 2ρ(CD0+CD1α2)SU2(2.38) FL=1 2ρ(ah+aw)αSU2(2.39) An implicit expression for the angle of attack is found by substituting (2.38) and (2.39) into the horizontal 2.2 Glider Motion Model and Dynamics 37 force balance (2.29) and solving for α, −cos γFD+ sin γFL= 0 −cos γ1 2ρ(CD0+CD1α2)SU2 + sin γ1 2ρ(ah+aw)αSU2= 0 α= cos γ1 2ρ(CD0+CD1α2)SU2 sin γ1 2ρ(ah+aw)SU2 α=cos γ(CD0+CD1α2) sin γ(ah+aw) that yields the implicit equation α=CD0+CD1α2 (ah+aw) tan (θ+α)(2.40) from which αcan be solved numerically. Combining (2.28), (2.38), (2.39) and (2.40) gives FB−Fg−cos γFL−sin γFD= 0 FB−Fg−cos γ1 2ρ(ah+aw)CD0+CD1α2 (ah+aw) tan γSU2 −sin γ1 2ρ(CD0+CD1α2)SU2= 0 FB−Fg−1 2ρ(CD0+CD1α2)SU2cos γ tan γ+ sin γ= 0 FB−Fg−1 2ρ(CD0+CD1α2)SU2cos2γ+ sin2γ sin γ= 0 that yields FB−Fg−ρSU2(CD0+CD1α2) 2 sin γ= 0 (2.41) from which, once αis solved, Ucan be evaluated with U=s2 sin γ(FB−Fg) ρS(CD0+CD1α2)(2.42) Given the glider heading ψe, as we had for the point motion model in Section 2.2.2, the horizontal and vertical components of the velocity vector follow from ug=Ucos γcos ψe(2.43) vg=Ucos γsin ψe(2.44) wg=Usin γ(2.45) respectively, where γ=θ+α. The speed ugcorresponds to the x-axis or longitude, and vgmaps to the y-axis or latitude. Also note that the glider surge speed Ugis just the compound of the horizontal speeds ug and vg, which yields Ug=Ucos γ(2.46) 38 2 Ocean Gliders With this expression of the glider speed, the highest surge speed Ugis obtained at θ≈35◦. The maximization is not trivial because of the dependence of αin the drag coefficient CD, but we can compute it numerically to obtain a more precise approximation of θ. Given α, the pitch θcan be computed with CD0+CD1α2=α(ah+aw) tan (θ+α)(2.47) tan (θ+α) = CD0+CD1α2 α(ah+aw)(2.48) θ= arctan CD0+CD1α2 α(ah+aw)−α(2.49) Table 2.1: Parameters required by the glider force balance motion model. Parameter Description γGlide angle γ=θ+α θPitch angle in BODY frame, usually measured with an IMU αAngle of Attack (AoA) VgGlider volume at atmospheric pressure mgGlider mass εCompressibility of the hull αTThermal expansion coefficient T0Reference temperature for αT ∇Vbp Buoyancy change due to the buoyancy engine CDDrag coefficient (2.34) CLLift coefficient (2.36) SWing surface area UGlider velocity through water along the glide path ahLift slope coefficient for the hull awLift slope coefficient for the wings (2.37) ΩWing sweep angle (at 1/4chord line) AAspect Ratio A=b2 S bWingspan CD0,h Parasite drag for the hull CD0,w Parasite drag for the wings CD1,h Induced drag for the hull CD1,w Induced drag for the wings (2.35) eSpan efficiency parameter e≈0.8 The three-dimensional speed vector defined by ug,vgand wgmust be compound with the ocean current speed at each point and time to obtain the actual vehicle speed underwater. Such computation is straightforward and follows the unconstrained three-dimensional point motion model explained in Section 2.2.2. Nevertheless, contrary to the point models, the force balance models requires much more parameters to be configured adequately, which are summarized in Table 2.1. It is possible to create an spider plot for the force balance motion model, as shown in Figure 2.11 and 2.12 for the diving and climbing states, respectively. These glider plots —also known as glide polar plots— represent the horizontal surge speed Ugagainst the vertical speed wgfor several changes of buoyancy ∆Vbp of the bladder. Interestingly, along with the curves for different ∆Vbp we obtain iso-lines of same angle of attack 2.2 Glider Motion Model and Dynamics 39 Figure 2.11: Spider plot for the force balance motion model during a dive. It shows the surge Ugvs. vertical wgspeeds of the glider for different changes of buoyancy ∆Vbp —typically the bladder or buoyancy pump capacity. The values above the Ug>|wg|line corresponds to the highest surge speeds Ug, and the most common values of pitch θare picked up from that side. In fact, the greatest Ugis obtained at θ≈ −35◦, that yields Ug≈0.5m/sfor ∆Vbp =−200cc, which is in agreement with the usual gliding speed of SLOCUM gliders, for such pitch and buoyancy pump configuration. α. Furthermore, we can also obtain the pitch θusing the fact that λ=θ+α. In both figures we have ugand vgfor ∆Vbp ∈[50,300]cc —which is negative during the dives. A typical common value of ∆Vbp =±200cc for the SLOCUM gliders gives the usual glider nominal surge speed Ug. Its value is generally measured at the optimal pitch θangle, i.e. the one that provides the highest glider nominal surge speed Ugmax , which 46 3 Ocean Glider Path Planning Problems and Applications now +1 +2 +tmin ··· +T travel time departure time Figure 3.3: Diagram of the minimal departure time problem. Intuitively, the minimal time path problem is solved starting from x0now and at different later times t={+1,+2,...,+T}, using some discretization step ∆t. Then, the optimal departure time is just the global minimum of the resulting travel time curve, at +tmin in the figure. surfacings lasts always almost the same time ts, so t=nts(3.2) Consequently, the number of inflections in the yo-yo profiles is also proportional to the travel time. Since most of the energy consumption employed in the navigation happens at those inflection points, it seems reasonable to say that we will obtain the same path for the minimal time and minimal energy consumption problems —for the same number of yos and depth limits. On the contrary, if the vehicle were a propelled AUV, since they have the ability to adjust their speed, the minimal energy consumption path is usually different from the minimal time one, clearly. For instance, Inanc et al. (2005) propose an objective function built as a weighted sum of the travel time and energy consumption for AUV path planning. Gliders, however, can only travel at a constant nominal surge speed Ug, and it is the number of inflection points what determines the energy consumption in terms of the navigation system. Therefore, only if we include the number of yos —or similarly, their depth limits— in the path planning algorithm, the minimal energy consumption path will differ from the minimal time one. However, it is very uncommon to change the number of yos during a glider missions. In fact, this could be in conflict with other requirements of the scientific mission. In the literature of ocean glider piloting and planning there is a number of works that address additional optimization objectives and applications. The optimal departure time is covered in (Soulignac et al., 2009) with a Symbolic Wavefront Expansion (WE) algorithm. In Figure 3.3 a plot shows the travel time for several runs of the minimal time path problem. Each run starts at a different departure time, from now to a given maximum departure time +Tin discrete intervals ∆t. As a result, we have several travel times that form a curve. Its minimum corresponds precisely to the optimal departure time, since it yields the minimal path time of all. Clearly, we can solve this problem by solving the minimal time path problem iteratively, although more efficient solutions may exist, as the Symbolic WE. 3.1 Path Optimization 47 3.1.2 Path of Minimal Distance to the Target The minimal distance to a target problem pursues the minimization of the remaining distance d= kxgoal −xn−1kfrom the ending point xn−1to the target xgoal for a given travel time tt, as depicted in Figure 3.4. Since the travel time ttis given for this problem, the number of bearings |B| =nis fixed and known in advance as well, being |B| =n=tt ts(3.3) where tsis the surfacing time. More formally, this minimization problem can be expressed as min Bkxgoal −xn−1k(3.4) where |B| =n. As we will see later in this chapter, using optimization methods (see Section 4.6), this particular problem has a more direct solution than the minimal time path problem discussed thus far. d=kxgoal −xn−1k xgoal x1x2xn−1 x0 min Bkxgoal −xn−1k:|B| =n Figure 3.4: Diagram of the minimal distance to the target problem. We look for the path Pdefined by a set of nbearings Bthat minimizes the distance d=kxgoal −xn−1kfrom the ending point xn−1to the target xgoal. In this problem the number of bearings |B| =nis fixed and known in advance. In practice, the minimal distance to the target is usually required in short-term missions, with a maximal duration of 3to 5days and a typical trajectory length below 150km. For this temporal horizon, state-of-the-art ROMs provide ocean currents in the form of predictions with a high space and temporal resolution. Indeed, most ROMs solve the ocean model hourly, and compile forecasts from now up to 3days ahead. Consequently, the problem is generally solved using dynamic ocean currents, although it is also valid for the simpler case of static ocean currents. A concomitant problem was addressed by Thompson et al. (2010) using a three-dimensional grid to optimize an earliest valid arrival criterion. The idea here is to reach the target waypoint xgoal not before a given time tmin. This problem can also be solved by compiling several solutions of the minimal distance to the target problems, or by imposing a constraint such that the valid arrival time condition t≥tmin is satisfied. The actual implementation will depend on the path planning algorithm. Indeed, a possible approach consists on solving the minimal distance to the target problem for the number of bearing |B| such that the path lasts at least tmin. Then we iteratively test paths of greater length; although the inverse approach is also possible, i.e. we can start with a larger |B| and reduce it up to tmin as long as the distance to the target is within a radius that establishes the vehicle arrives to it. To some extent, and depending on the approach, this is actually a solution of the minimal time path (see Section 4.6.1). 48 3 Ocean Glider Path Planning Problems and Applications 3.2 Obstacle Avoidance Any of the previous optimization problems are supposed to perform adequately not only in offshore, obstacle free environments, but also in troublesome scenarios where the obstacle avoidance problem must be solved. We find this kind of environments mainly in coastal areas, where we have static and dynamic/moving obstacles such as land areas, shallow waters, and heavy traffic shipping routes. Also strong ocean currents against the heading to the target waypoint xgoal can be regarded as obstacles, since gliders —with their low surge speed Ug— cannot beat them; note that with the inclusion of strong ocean currents as possible obstacle, even in offshore environment the obstacle avoidance must be solved. Figure 3.5: Obstacle Avoidance in glider path planning optimization problems. Obstacles in the ocean can appear in different forms: strong ocean currents against the desired heading, land areas —like the islands in the figure—, shipping routes, shallow waters, and basically any area where the glider cannot navigate doing its characteristic yo-yo profiles underwater. In Figure 3.5 we have a typical coastal scenario with land obstacles —e.g. islands. Without any sort of obstacle avoidance logic in the glider path planning algorithm, the path gets easily trapped. In other words, by solving the obstacle avoidance problem we are actually trying to avoid local minima in the optimization process, which is also a consequence of the large number of optimization variables involved and the complexity of the environment. In general, a wide exploration of the search space allows to avoid the obstacles and find an initial rough path that can be optimized later. However, regarding ocean currents, it is also possible to segment the environment to avoid unstable regions. We will address this problem in Section 3.5, where we study different techniques to extract structures from the ocean currents, so we can reduce the high dimensionality of the problem. 3.3 Path Following The path following problem was introduced by Eichhorn (2010) with the equivalent name of Hold Track problem. In brief, it consists on finding the path with the lowest deviation from an user-defined trajectory 3.3 Path Following 49 Pd, but still reaching the target waypoint xgoal. Regarding the objective of reaching xgoal, it is solved as the minimal time path problem discussed thus far. Meanwhile, the path following requirement can generally be integrated as a constraint in the optimization framework. P=f(B) x1 x2 xk Pd A1A2 A2Ak AkAgoal x0 xgoal min BP|B| i=1 Ai(f(B),Pd) Figure 3.6: Diagram of the path following problem. We look for the path Pdefined by a set of bearings B that minimizes the deviation from a desired path Pd. Such deviation can be measured as a distance dor an area function A. This path following problem is solved as a constraint on the minimal time path problem, that allows to reach the target waypoint xgoal. Figure 3.6 illustrates the path following problem, where the desired path Pdgoes from x0to xgoal. The problem can be easily understood as the minimization of the area covered by the resulting path found P around Pd. This is a piecewise area made of right trapezoids areas Aifor i= 1,...,|B|, i.e. for each stint —that is one unit less than the number of bearings |B|, or surfacing points. Note that there are different ways to compute these areas, but the right trapezoid formula is valid also when the path Pcrosses Pd. l:ax +by +c= 0 dj m di xi xj (a) Right trapezoid. l A0 c A1 m dj di xi xj (b) Right trapezoid (crossing). Figure 3.7: Right trapezoid diagram, for the computation of the area between the desired path Pdand the path found P, in the path following problem. The right trapezoid area is computed for every two consecutive surfacing points xiand xj. In (a) xiand xjlie in the same semi-plane, divided by the line lthat defines P. When they lie in different semi-planes (b), Pcrosses Pdand two sub-areas must be subtracted from the right trapezoid area. 50 3 Ocean Glider Path Planning Problems and Applications Given the equation of the desired path Pdsimplified as a line lfor 2dimensions in the following form l:ax +by +c= 0 (3.5) and 2consecutive surfacing point locations xiand xjthat define the two-dimensional coordinates xi= (xiyi)>(3.6) xj= (xjyj)>(3.7) we can compute the distance from the points xiand xjto the line las follows di=axi+byi+c √a2+b2(3.8) dj=axj+byj+c √a2+b2(3.9) assuming an Euclidean metric space. Using the normal vector nof the line l, n= (ab)>(3.10) and the distances diand djof the points xiand xj, respectively, we can compute their projection onto lwith pi=xi−ndi(3.11) pj=xj−ndj(3.12) The distance of the projected points piand pjcan now be computed as the norm of their difference, which yields the base mof the right trapezoid of Figure 3.7. That is, m=kpj−pik(3.13) The distances shown thus far are signed distances, so we take their absolute value to obtain the heights hiand hjof the right trapezoid, hi=|di|(3.14) hj=|dj|(3.15) Consequently, the area of the trapezoid is defined as A=1 2mh (3.16) where h=hi+hj(3.17) When two consecutive surfacing points xiand xjin Pcross Pd, we must subtract the two sub-areas A0and A1depicted in Figure 3.7 (b), from the right trapezoid area. In this case, the trapezoid polygon is complex. We can detect whether the trapezoid is a simple or complex polygon by checking the signed distances diand dj. If they have different sign, the trapezoid is complex, and we must do the subtraction correction. We can see the following similar triangles equivalence in the figure, a h=c hj (3.18) where hj=|dj|. 3.3 Path Following 51 Hence, c=ahj h(3.19) We have two areas to subtract. First, a triangle of area A0=1 2(a−c)hi =1 2a−ahj hhi =1 2ahi1−hj h =1 2 ah2 i h(3.20) and, secondly, a rectangle of area A1=chi =ahihj h(3.21) They sum A0+A1=1 2 ah2 i h+ahihj h =ahi h1 2hi+hj =ahi hh−1 2hi =ahi1−hi 2h(3.22) which is one of the several arrangements of this equation. Therefore, for complex right trapezoid, we compute the right trapezoid area Aand then subtract A0+A1, so we actually have A−(A0+A1). Instead of the right trapezoid areas, we can simply use the distance from each surfacing point xi= (xiyi)> to the line l, d=axi+byi+c √a2+b2(3.23) or a pseudo-distance, d=axi+byi+c(3.24) which is defined as a simplified version to speed up the computations. We can also choose between computing these distances for the two consecutive surfacing points xiand xj, or just to the last one, i.e. xj. In Section 5.7 we will compare all these deviation metrics, in order to show that the simplified versions can be used in place of the actual right trapezoid area or the XTE formulas of Eichhorn (2010). 3.3.1 Relaxed Path Following The problem of reaching a target waypoint xgoal in the minimal travel time while keeping the path Pas close as possible to the desired path Pdis shown in Figure 3.8. A glider holds the track of a straight line along an anti-cyclonic (clockwise) eddy, where the minimal time path will not follow the desired path. It is also 52 3 Ocean Glider Path Planning Problems and Applications Figure 3.8: Path following example for gliders. The figure shows the closest path Pfound to follow the desired path Pdfrom the start x0to the target xgoal waypoint. The glider bearings Bof the path P at each surfacing point are shown along with the ocean currents (ocean currents that exceed the glider speed Ug= 0.4m/sare highlighted ) from the start to the target waypoint . possible to relax the path following constraint. This means that we can allow the path found Pto deviate from Pdup to some given distance. This way we define a corridor of a certain width, so it is possible to find paths of less travel time to reach xgoal, but still close to Pd, as shown in Figure 3.9. Therefore, the travel time can be reduced at the expense of a small deviation from Pd. Indeed, this relaxation of the constraint allows us to obtain a set of different solutions that define a Pareto curve, as we will show in Section 5.7. 3.3.2 Summary In short, by solving the path following problem it is possible to obtain paths that reach the target waypoint, while they also remain close to an arbitrary trajectory defined, for example, according to a certain scientific interest. It is straightforward to extend the problem to arbitrary curves by a piecewise linear approximation, using the line desired paths shown before as a basis. It is also possible to use other functions directly, as far as we are able to compute the deviation between it and the path found —the area enclosed, or a distance from each surfacing point xito the curve. In oceanography, gliders are useful for long-term missions and data assimilation campaigns, which are demanded by climate change research, to improve our knowledge of ocean processes and so on (Dobricic et al., 2010). In this kind of missions it is crucial that the vehicle samples the ocean across a given transect, i.e. it follows an usually linear path that goes from the start x0to the target xgoal waypoint. For instance, it is common to cross the eddy from one side to another passing through the center, in order to estimate its dimensions and measure its properties (Martin et al., 2009). With gliders, due to their relative slow nominal 3.4 Multi-Glider Path Planning and Coordination 53 Figure 3.9: Path following example for gliders. The figure shows the closest path Pfound to follow the desired path Pdfrom the start x0to the target xgoal waypoint, within a corridor around Pd—i.e. the path following problem is relaxed. The glider bearings Bof the path Pat each surfacing point are shown along with the ocean currents (ocean currents that exceed the glider speed vg= 0.4m/sare highlighted ) from the start to the target waypoint . speed, the path following problem described here cannot be solved with control theory techniques. The problem is such that it requires a global vision of the environment and some memory in order to take the best path and avoid situations in which the vehicle could get trapped and not reach the target. 3.4 Multi-Glider Path Planning and Coordination In the last years a line that has received a good deal of attention by many researchers is the use of multiple vehicles in coordinated missions. Some relevant examples include the works of Zhang et al. (2007) and Bhatta et al. (2005), which face the problem of adaptive sampling of oceanic variables by means of a glider fleet, maximizing the area covered and hence improving the spatial and temporal resolution. The multi-glider problem is concerned with the coordination of multiple vehicles at the path planning phase to accomplish coverage tasks that are solved more efficiently by a fleet of gliders navigating in certain formation or according 54 3 Ocean Glider Path Planning Problems and Applications to some constraints. In fact, it is possible to implement a glider path planning algorithm by imposing coordination constraints to the objective function solved for each vehicle in the fleet. dleft vt left vt vt+1 left ˆvt+1 left vt+1 dmin dmax Figure 3.10: Multi-glider coordination constraint diagram, in which each glider sets its trajectory according to a constraint. In this case, at a given time t, for a particular glider or vehicle vtin the fleet, we impose that the distance dleft with respect to the left glider vt left must fall within the range [dmin, dmax]. Also, note that for a given time twe check that the stints do not intersect —i.e. they do not cross each other. For this reason, the stint from vt left to ˆvt+1 left is discarded. We will proceed similarly for a right glider vt right, if present. Basically, this task can be defined as an extension of the atomic problems explained thus far to multiple gliders. In the example shown in Figure 3.10, these gliders are forced to travel within a distance range among them. To be more specific, given a glider v, at each surfacing point we should check that its neighbors lie in the range [dmin, dmax]. Only those paths in which that condition is satisfied are considered as valid. Also, another check for segment intersections is required, to prune stints that cross others. In the example of the figure, only the stint in which the glider vleft surfaces at vt+1 left is valid then. These constraints must be applied during the optimization phase, so the paths found for each glider vare still optimized for the given objective function, but they also satisfy the coordination constraint. This constitutes a form of coordinated path planning, that solves a multi-glider problem for the whole fleet simultaneously. In the example of the figure we have considered a particular constraint that keeps the vehicles close to each other navigating in formation, but we might have adopt other constraints. In fact, in the next section we address a common problem in real missions that consists on minimizing the time to recover a fleet of gliders. 3.4.1 Efficient Recovery The efficient recovery is a multi-glider path planning problem in which a fleet of kgliders must be recovered by a ship s. The problem is depicted in Figure 3.11, where the starting location of the gliders at t= 0 is represented by the surfacing points v0 i, and the ship sis waiting at the harbor for a time Tbefore it goes to recover them. Therefore, the vehicles have a time Tto reach the locations vT ithat will allow to minimize the recovery time. That is, the locations vT isuch that the ship recovery route Prwill be the shortest —or minimal time one, which are generally the same because we assume the ship travels relatively fast with respect to the winds and ocean currents. 3.5 Tracking Evolving Ocean Structures 55 Pr t=f(Pr) v0 0 v0 1 v0 2 v0 k−1 s vT 0 vT 1 vT 2 vT k−1 min ∪k i=0Bi f(Pr) : Pr={s, ∪k i=0f(Bi), s} Figure 3.11: Diagram of the efficient recovery problem. A fleet of kvehicles moves to the most appropriate location vT iduring a given time T, for each vehicle i= 0, . . . , k −1, so the path Prto recover them with a ship stakes the minimal travel time tt=f(Pr). There exist different ways to solve the efficient recovery problem. Apart from the individual path planning case, in which each glider solves the minimal distance to the target problem independently for the given time T, trying to reach the harbour or the ship location s, we can identify two coordinated, multi-glider path planning approaches. First, we can impose a constraint such the vehicle end almost together after the time T. This way we have a meeting point —which is found by the path planner, not given by the user—, so the ship only have to go there and back to the harbour. However, the optimality of this approach is usually dominated by the glider that is further from s, as we will see in the experiments of Section 5.8. A second approach actually minimizes the recovery time, i.e. the travel time tt=f(Pr)required by the ship to departure from the harbour sand recover each glider viin sequence at their ending locations vT i, and comes back to s. This is exactly the problem we want to solve, so this approach will provide the optimal solution, and will produce a solution similar to the one shown in Figure 3.11. 3.5 Tracking Evolving Ocean Structures Ocean gliders have proven to be also useful in the opportunistic short-term characterization of dynamic structures. Among these, mesoscale eddies are of particular interest due to the relevance they have in many 62 4 Ocean Glider Path Planning localization mapping path planning & motion control integrated approaches SLAM active localization exploration Figure 4.1: Diagram of the tasks that must be solved by a robot in order to acquire accurate models of the environment; figure reproduced from (Stachniss, 2009). The overlapping areas represent combinations of the main tasks, which cover mapping, localization and path planning. with dynamic ocean currents are also covered by glider path planning techniques, as we will see along this chapter. For the sake of space below we only explain in detail the techniques applicable to glider path planning, which are actually, the ones analyzed in this thesis, including adaptations or extensions for some of them and even some novel proposals. Path planning for Autonomous Underwater Gliders (AUGs) has been a subject of interest for researchers since the introduction of these robotic platforms. Different approaches have been developed applying techniques that include searching algorithms based on Artificial Intelligence, potential field modeling, multi-objective optimization, etc. Some of the most relevant, in our opinion, are summarized in the following sections. 4.1.1 Graph-based methods Graph-based methods are a classical path planning approach that lies in the category of Discrete Optimal Planning (LaValle, 2006). A grid-shape graph represents the search space with the edges labeled indicating the cost of traveling from a vertex to one of its neighbors. A* (Hart et al., 1968) is probably the first graph method adapted to the problem at hand (Garau et al., 2005), with the strong assumption of static ocean currents; although it can be run with dynamic ocean currents at the expense of losing the guarantee of optimality in the general case. Also Pˆ etr` es et al. (2005) and Soulignac (2010) apply A*, with a thorough analysis of the cost function in the latter. Note that some authors call this method Wavefront Expansion (WE), which actually does not use any heuristic and therefore it is Dijkstra’s algorithm basically (Dijkstra, 1959). In this paper, our implementation of A* is equivalent to Garau et al. (2005, 2009). In another paper, Soulignac et al. (2009) 4.1 Glider Path Planning Survey 63 address time-varying winds, combining WE and local optimization for each path explored. As most graph-based path planning methods, A* discretizes the search space using an uniform grid. As a consequence, the cost function must compute the travel time to go from one node nito its neighbors, using the constrained glider motion model of Section 2.2.2.2. The inconvenient of this approach is twofold. First, we only find the optimal path that lies on the search grid, while the actual optimum lives in the continuous space defined by the differential equations of the unconstrained glider motion model described in Section 2.2.2.1. Secondly, in the presence of strong ocean currents, many neighbors are unreachable, and the search gets easily trapped or discards many paths prematurely. Although we can increase the resolution of the search grid, the problem is actually associated to the heading angles ψedefined by the topology of the grid, as the set of headings is restricted to ψe∈Mπ/4for M= 0,...,7in an 8-connected grid. Carroll et al. (1992) apply A* on a quad-tree search space, which is adapted to the ocean currents field, i.e. it has higher resolution where the ocean currents vary more spatially; or more formally, where the gradient of the ocean currents is greater. Similarly, the Fast A* of Walsh and Banerjee (2010) claims to mitigate the discretization problem as well, by varying the search map resolution as needed and calling A* repeatedly; it has not been applied for glider path planning though. There exists a number of variants of A* that are worth to mention. Any-angle methods, like Theta* (Daniel et al., 2010; Nash et al., 2007), try to obtain shorter paths alleviating the angle discretization problem caused by the search grid. However, a visibility concept require by this technique is not applicable in the presence of ocean currents, as their effect on the trajectory must be taken into account. Incremental methods, like D* (Stentz and Mellon, 1993), D* Lite (Koenig and Likhachev, 2002) or Incremental Phi* (Nash et al., 2009), aim to reduce the exploration time using previous solutions when partial changes are produced in the map. In the case of ocean currents the change is global and therefore it is not possible to exploit already computed solutions. Finally, post-smoothing techniques have the drawback that small changes in the path found might produce very different, even unfeasible, paths due to the influence of ocean currents. Indeed, with different locations in the smoothed path, the whole path must be integrated again using the glider motion model from the start location x0. 4.1.2 Probabilistic Sampling-based methods Probabilistic Sampling-based methods have been applied to overcome the combinatorial explosion of the optimal path planning search to some extent. Rapidly-exploring Random Trees (RRT) (Lavalle, 1998; LaValle and Jr., 1999; Simmons and Urmson, 2003) constitute an incremental sampling and searching approach that has been applied to both AUVs (Tan et al., 2004) and gliders (Rao and Williams, 2009). The main drawback of this method in our context is the inability to handle time-dependent ocean currents (see Section 4.5). The RRT algorithm is very fast, but it does not assure the optimality of the paths found and often requires further refinement, which is not straightforward in the problem at hand. More precisely, we cannot separate the path planning procedure into a coarse search followed by a post-processing refinement, as it is common practice in classical Robotics. Post-smoothing techniques rely on some sort of continuity in the distance or cost within the search space. However, the presence of ocean currents in the glider path planning problems produce important changes in the vehicle resulting trajectory if we modify it, since it becomes influenced by different ocean currents —when it travels through different locations. This happens because the ocean currents field is defined on a continuous space, so any change on a given path —as the one found with the RRT algorithm— implies that the path is affected by different cost values, which are neither homogeneous, nor predictable without actually recomputing the whole path. That is, we must run the path planning algorithm again. In the case of RRT this is a serious drawback, since this algorithm is thought to find paths fast, but they are generally sub-optimal, rough solutions. 64 4 Ocean Glider Path Planning 4.1.3 Optimization methods Bio-inspired optimization solutions can also be found for this problem. Genetic Algorithms (GAs), for example, are used in (Alvarez et al., 2004) for AUV path planning in the presence of variable currents. The main problem is that it has execution time limitations, however, prevent the use of a high number of generations, reducing the quality of the path found. Ant Colony Optimization (ACO) algorithms constitute another interesting alternative used for ship route obstacle avoidance (Tsou and Hsueh, 2010), but is not directly extensible to highly dynamic environments. Simulated Annealing (SA) is a global optimization technique applied to path planning, usually as a post-processing refinement over previously generated results (Kirkpatrick et al., 1983). It is very sensitive to the initial guess, which must be selected wisely. As an example, in (Witt and Dunbabin, 2008) it is incorporated as part of a swarm optimization method. Some authors have addressed the problem using System Theory and Analytical Methods (Techy et al., 2010). In this field, optimal paths are obtained solving a Boundary Value Problem (BVP). Ocean gliders can be modeled as a Dubins car, so Dubins curves are suitable in the case of steady flow —i.e. static ocean currents—, with some variants allowing for turn constraints. Furthermore, Zermelo’s optimal navigation formula is applicable for unsteady flow —i.e. dynamic ocean currents—, but without turn constraints. In either case, these are local path planning methods that perform poorly with strong currents, so only propelled vehicles might benefit from them. These techniques are thought for short-term motion control, rather than long-term path planning, and they do not reflect the concept of constant time surfacings, since they control the vehicle heading at a higher rate. The approaches based on minimization of Energy Functions are also worth commenting. As good examples, we can cite the work of Kruger et al. (2007), that includes the time as an extra dimension in the search space, or Witt and Dunbabin (2008), which incorporate modeling of time-varying obstacles using Potential Fields. The main drawback of potential fields is that they often get trapped in local minima. The problem of local minima has been tackled by means of strategies based on particle swarms, simulated annealing, or genetic algorithms. Another problem with potential field methods is their adaptation to dynamic ocean currents. It is very inefficient to re-compute the potential field for the whole map for each time instant. Furthermore, we must select a time step ∆tequal to the surfacing time tsto do so, and even in that case it will not cover the ocean currents variability while the glider navigates underwater. In other proposals, the currents are modeled as continuous time functions, as is the case of the Nonlinear Trajectory Generation or NTG method (Milam et al., 2000) applied over B-Splines of Zhang et al. (2008). These approaches use numeric optimization techniques to solve the differential equations that model the glider motion under the effect of ocean currents. This models are extensions of the three-dimensional unconstrained motion model described in Section 2.2.2.1. Similarly, Yilmaz et al. (2008) models problem in such a way that Mixed Integer Linear Programming (MILP) is applied to find the optimum path. Also, He et al. (2009) propose an iterative optimization process for glider path planning. However, the focus of that work is centered on the waypoint precision enhancement, and not in optimal path planning. Furthermore, only static ocean currents are considered. Special mention require the Level Set Methods (LSMs) (Lolla et al., 2012), which are a numerical technique for tracking interfaces and shapes using an Eulerian approach. LSMs are applicable to many different problems, including robotic path planning, where the interface or shape they track is the wavefront expanded by the cost function from the starting location x0. By solving a Partial Differential Equation (PDE) it finds the cost from the source x0to any location in the search space, so a gradient descend procedure can be used to retrieve the optimal path. The Fast Marching (FM) method, which lies in the LSM family, have been recently applied for AUV path planning by Pˆ etr` es et al. (2007, 2005). FM can be regarded as a continuous version of Dijkstra’s algorithm. Indeed, from the algorithmic point of view, it belongs to the class of Breadth-First Search (BFS) algorithms. However, the neighbors are updated according to a numerical scheme based on the Eikonal equation k∇uk=τ, where urepresents the costmap —e.g. the ocean currents— and τis the cost of moving 4.1 Glider Path Planning Survey 65 2005 2008 2009 2010 2004 2009 2004 2008 2010 2010 2007 2008 2005 2008 2010 A* Sliding WE (A* & Optim.) Symbolic WE (dep. time) A* (Zermelo’s) RRT (AUVs) RRT (gliders) GA Swarm Optim. (w/ SA) ACO BVP (Dubins curves) Energy functions Potential fields FM* NTG MILP Optim.-based Figure 4.2: Temporal diagram with some of the most relevant glider path planning approaches contributed to the field thus far. The year of publication and the technique are assembled in the diagram, which is divided by categories according with the type of path planning approach used (in top-down order): Graph-based methods ; Probabilistic Sampling-based methods ; Bio-inspired optimization methods ; System Theory approaches ; Energy functions ; and numeric optimization methods . The thin lines that connect different categories represent algorithms that combine ideas from different types of approaches. to a neighbor location. Therefore, the discretization problems disappear with this continuous motion model. In its original form, the FM only addresses static isotropic costmaps, as in the SPP. In his PhD Thesis, Pˆ etr` es (2007) extended this technique to dynamic anisotropic —or asymmetric— costmaps, as in the Minimal Time Path problem. Also, an heuristic version called FM* is proposed, equivalent to A*. This approach, however, has not been applied to gliders yet, in which the bearing ψecan only be changed every surfacing time ts. Many authors use some sort of graph-based method for glider path planning, usually with A* at its core, but with some additional methods to alleviate the problems derived from its discretization (Sathyaraj et al., 2008; Thompson et al., 2009, 2010; Wang, 2007). Indeed, one approach to the problem consist on combining the graph-based search with some kind of local optimization (Soulignac, 2010). However, all these techniques still do not represent adequately the restriction on the modification the bearing ψgat discrete times because the travel time between neighbor nodes is still variable, rather than constant. Similarly, Eichhorn (2010) combines A* and Zermelo’s optimal navigation formula to the path following problem. Other alternatives that also make use of continuous models are described on the works of Pˆ etr` es et al. (2007, 2005). Later, this 66 4 Ocean Glider Path Planning line of work was extended to deal with strong currents in the works of Soulignac et al. (2008). 4.1.4 Summary The time lines in Figure 4.2 show the most representative techniques in the glider path planning field. The figure summarizes the state of the art by arranging the original contributions for each type of path planning approach. Some categories are connected in order to illustrate the relationship between certain techniques. In fact, FM* (Pˆ etr` es et al., 2005) can be seen as the continuous version of the graph-based method A* (Garau et al., 2005); the Sliding Wavefront Expansion (WE) (Soulignac et al., 2008) combines A* with local optimization methods; and Eichhorn (2010) also combines a variant of A* known as Time Varying Environment (TVE) with Zermelo’s optimal navigation formula, from System and Control Theory. In the next sections we will explain the different approaches developed in this thesis. They are described in detail, highlighting their advantages, drawbacks and assumptions. From the survey of path planning techniques above, we have selected the most promising ones, including those already in use by others, as well as novel approaches. This comprises graph-based methods like A*, the probabilistic sampling method RRT, and optimization techniques. Along with the description of the algorithm, we try to put clear how certain techniques solve or alleviate the drawbacks or assumptions imposed by others. For instance, we will see how we address the discretization problem of A* with a novel approach that integrates probabilistic sampling techniques, or with optimization methods. Later, in the experimental results (see Chapter 5), we evaluate each of these approaches for the glider path planning problems discussed thus far in Chapter 3, so we can compare the computing time and path optimality against a naive Direct to Goal strategy that resembles the manual glider path planning. 4.2 The Direct to Goal Approach Before we start with the glider path planning techniques developed in this thesis, we are going to discuss a simple approach that can be considered equivalent to the control algorithm on board the glider, which is used to reach a waypoint. We have termed it the Direct to Goal —DtG for short— approach, since it tries to go directly to the goal/target waypoint from any surfacing point, regardless of the ocean currents. In fact, it is a blind technique, in the sense that it does not take into account the speed and direction of the ocean currents nearby. It is extremely fast to compute, but the path is usually far from the optimal, as we will see in Chapter 5. Even worse, in many cases, it does not find any path to the target waypoint, at all. ψg=ψd xi−2 xi−1xi xgoal Figure 4.3: Diagram of the Direct to Goal approach, which sets a bearing ψgequal to the heading ψdto the goal/target xgoal waypoint from the current location xi. The basic operation of the DtG approach is depicted in the diagram of Figure 4.3. At each location xi, it commands the glider to set the bearing ψg=ψd, where ψdis the direction from xito the target waypoint xgoal. The locations xicorrespond to the surfacing points, because only when the vehicle surface it is possible 4.3 Adaptation of the classical A* algorithm 67 to reconfigure its bearing, since the new precise GPS position is available and we can communicate with it. In fact, once the pilot has set the target waypoint xgoal, gliders operate exactly this way. Every time they emerge, the bearing is recomputed in order to head to xgoal. Additionally, some gliders —e.g. SLOCUM— can estimate the ocean current in the last stint and assume it will be the same for the next, so it is used to correct the next bearing in order to actually head to the target. This behavior can also be activated in the DtG. However, in sum it does not make any significant difference, because if we do not perform such correction at xi−1, in the next surfacing point xithe drift will be reflected in the next bearing set to head to the target from xi. In practice, glider pilots usually set a waypoint for some days, according with their knowledge of the region and the ocean currents dynamics for the season, as well as some intuition. A waypoint may not be changed during days, and during this slot of time the vehicle tries to reach it by running a Direct to Goal approach as the one described here, with or without ocean currents corrections. For this reason, DtG will be used as the basis for comparison, since in this work we try to contribute practical approaches to improve current path planning or piloting methods for ocean gliders. Consequently, while the DtG strategy sets the bearing ψg=ψdin the straight direction to the target, path planning algorithms explore several paths starting from the current location xi, trying to find an optimal plan for the particular problem at hand. The next sections describe the glider path planning algorithms developed in this thesis: the adaptation of A* using costmaps, i.e. the ocean currents velocity field; our novel CTS-A* (Constant Time Surfacing A*) algorithm that uses the unconstrained motion model within the A* search in order to model the problem adequately by ensuring a constant time between consecutive surfacing points; and Adaptive Bearing Sampling (ABS) method to focus the CTS-A* search and hence reduce its computing time; the RRT algorithms; optimization-based methods, including our novel Optimization scheme on the configuration space of the bearing angles B, the Iterative Optimization approach, and an Intelligent Initialization based on a coarse version of the CTS-A* for obstacle avoidance. We also explain how to model the problem in favorable scenarios with as a Boundary Value Problem (BVP), and give some insight in glider path planning using ocean evolving structures. 4.3 Adaptation of the classical A* algorithm One of the most common path planning algorithms in Artificial Intelligence is the graph-based algorithm A* (Hart et al., 1968), shown in Algorithm 4.1. In its original form, it solves the Shortest Path Problem (SPP). More precisely, A* solves the single-pair SPP, in which we have to find the shortest path from the single source/start node nstart to the single destination/goal/target node ngoal. This is exactly the kind of problem described thus far in Section 3.1, but requires some adaptation of the cost function to deal with a time cost instead of distances. Here, we explain the algorithm, how we model the search space, the cost function and the heuristic, as well as some implementation details, extensions, and important implications of the nature of A* in glider path planning. A* finds the optimal path from nstart to ngoal in a graph, which in our case consists on a N×Mgrid of nodes with 8-neighbor vicinity. Or, in other words, a directed graph G=hV, Ei, with |V|=N×M vertices/nodes that represent a location in a metric space, and |E|= 8 |V|—ignoring the grid boundaries— edges/arcs that connect the nodes. The nodes disposition is a grid in which they are connected to their surrounding nodes with a weighted edge. That weight c(ni, ni+1)represents the cost of traveling from the current node nito the nearby one ni+1. In the SPP, c(ni, ni+1)represents the distance from nito ni+1, but in the minimal time —or the minimal distance to a target problems— explained in Section 3.1, that cost is the travel time. Such cost is computed with the constrained glider motion model of Section 2.2.2.2. By using the unconstrained motion model, we are computing the bearing required to travel from the current node ni to any of its neighbors ni+1. The gridded 8-vicinity topology establishes a set of fixed headings ψe=kπ/4 for M= 0..7, that gives the 8neighbors. In glider path planning problems, we are actually looking for such 68 4 Ocean Glider Path Planning ψe xi−2 xi−1xi xgoal fmin Figure 4.4: Classical A* algorithm operating on an uniform grid that defines the search space domain Ω. The heading angles ψeare constrained by the grid, producing straight line trajectories between nodes and nonconstant surfacing times for glider path planning problems. The distance between nodes can be parameterized, but a high resolution would increase the computing time. Also note that the nodes do not represent surfacing points because they are not separated a constant time, so we must compute the actual surfacing points afterwards, setting the bearing found for the previous node. list of bearings, rather than the location of each node (see Figure 4.4), since the ocean currents at each node affect this computation. To focus its search, A* uses h-values h(n)that approximates the distances to the target node from each of the nodes n∈Vusing an heuristic function. The heuristic function h(n)is admissible if it never overestimates the actual minimal cost of reaching the target node ngoal —otherwise, we cannot guarantee that the path to the target is the optimal one. In the special case where h(n) = 0 ∀nwe have Dijkstra’s algorithm (Dijkstra, 1959), whose main drawback is the fact that it does a blind search; indeed, for this reason it is considered as a greedy algorithm. Therefore, the ultimate purpose of the heuristic is to reduce the computational cost of the search. According with Sniedovich (2006), Dijkstra’s algorithm can be seen as a successive approximation that solves the dynamic programming functional equation for the SPP by means of the Reaching method (Denardo and Fox, 1979). In fact, Dijkstra (1959) uses the fact that, “if Ris a node on the minimal path from Pto Q, knowledge of the latter implies the knowledge of the minimal path from Pto R”, which is in accordance with Bellman’s Principle of Optimality. Bellman (2003), widely known as the father of Dynamic Programming, establishes that this programming method is applicable to problems that exhibit overlapping subproblems and optimal substructure. This means that Dijkstra’s algorithm actually solve the single-source SPP, not just the single-pair one. In the single-source SPP, we find the best path from the source node nstart to all other nodes in the graph. And therefore, it turns out that there is no algorithm more efficient for the single-pair SPP, than for the single-source SPP. Similarly, the Wavefront Expansion method of Dorst and Trovato (1989) —repeatedly used in the glider path planning literature—, operates like Dijkstra’s algorithm. One possible implementation of Dijkstra’s algorithm uses a node set Qthat contains all the undiscovered nodes so far. Initially it has all but the start node nstart, and the algorithm proceed by exploring each node at a time —starting with nstart. The next node selected for expansion is extracted from Q, being the one with the minimum cost. The computational cost of the Dijkstra’s algorithm is defined as O(r|E|+m|V|), where rand mare the number of operations to insert and extract the minimum from the node set Q, respectively. By using a min-priority queue implemented by a Fibonacci heap the algorithm runs in O(|E|+|V|log |V|) (Fredman and Tarjan, 1984, 1987). Although Fibonacci heaps are theoretically better than binary heaps, in practice the latter exhibit less overhead, and they are common in standard libraries, like the C++ STL std::priority queue template; in our implementation we have used a binary heap, indeed. As it has been previously said, A* introduces an heuristic function h(n)to speed up the search of Dijkstra’s algorithm. Basically, h(n)is added to the cost of the nodes inserted into the node set Q, so their priority 4.3 Adaptation of the classical A* algorithm 69 Algorithm 4.1 A* algorithm pseudo-code for implicit graph search. Require: Start nstart and target ngoal nodes. Heuristic function h(n)that estimates the cost from node nto ngoal. The heuristic h(n)is assumed to be consistent, so we use a closed set Cto make the search more efficient. Function parents(ni)that retrieves the path Pby extracting the parents of ni=ngoal from the parent(·)map recursively, until it reaches nstart. Ensure: Optimal path Pfound from nstart to ngoal. Algorithm: A*(nstart,ngoal)return P 1: g(nstart) = 0 .assume g(ni) = ∞for the rest 2: parent(nstart) = ∅.assume parent(ni) = ∅for the rest as well 3: O=C=∅.empty open and closed sets 4: O.insert(nstart, g(nstart) + h(nstart)) 5: while O 6=∅do 6: ni=O.pop .extract node niwith minimum cost 7: if ni=ngoal then .target ngoal reached 8: return parents(ni).path found (extracted from parent(·)) 9: end if 10: C=C ∪{ni}.close node ni 11: for all ni+1 ∈successors(ni)do .for each successor ni+1 12: g0=g(ni) + c(ni, ni+1).tentative g-value 13: if (ni+1 /∈ C ∪O)∨(g0< g(ni+1)) then .undiscovered or better g0 14: g(ni+1) = g0.update 15: parent(ni+1) = ni 16: O.insert(ni+1, g(ni+1) + h(ni+1)) .decrease key (update, or insert if undiscovered) 17: end if 18: end for 19: end while 20: return ∅.no path found is changed. At this point is important to say that our A* implementation manages implicit graphs. It is common to use implicit graphs when the search graph is such huge that it is better to generate the adjacency list of each node during the exploration. In Algorithm 4.1, the successors method is responsible of retrieving all the children nodes ni+1 of the current node ni, according with the 8-neighbor topology. As the algorithm shows, A* maintains for every node n: 1. The g-value g(n), that is the distance of the shortest path from the start node nstart to the node n found so far. 2. The parent node of n, which is used to retrieve the path after the search ends. Recall that for the problem on hand, the path consists on a sequence of bearing angles ψgthat are to be commanded to the glider, and the computed surfacing locations x. This is a consequence of using the constrained motion model of Section 2.2.2.2, as mentioned before. There are two general implementations for AI search methods: tree and graph search algorithms. A* can be implemented with any of them. In a tree search, the topology of the graph already guarantees that no node is rediscovered during the search. On the contrary, searching on a graph may expand nodes already explored. As it was previously mentioned, for glider path planning problems we use a directed graph with a gridded topology. Therefore, we use the graph search version of A*. In this case, since we can rediscover nodes already explored from alternative paths, we need to use an additional set, not only Q. Indeed, we have to maintain two data structures: 70 4 Ocean Glider Path Planning 1. The open set O, which consists on a priority queue that contains the nodes to be considered for expansion, along with the expected cost f(n) = g(n) + h(n)to reach the target ngoal. The open set O is equivalent to Dijkstra’s node set Q. 2. The closed set C, which contains nodes that have already been expanded in order to ensure that each node is expanded only once, unless we find a better cost g(n)from nstart, coming from an alternative path. Since there are different ways of interpreting the A* algorithm, below we provide the equivalence between node states, coloring and the open and closed sets. The nodes can take three different states during the A* search: undiscovered: It is a white node, which is neither in the open O, nor in the closed Cset, i.e. n /∈ O ∪C. discovered: It is a gray node, which is in the open Oset, i.e. n∈ O. explored: It is a black node, which is in the closed Cset, i.e. n∈ C. Note that the case of n∈ O∧n∈ C is not valid. The implementation with the open and closed sets attends to the fact that we search an implicit graph, so they are used to mark the nodes discovered and explored thus far. As in Dijkstra’s algorithm, for the open set O, we use a binary heap to obtain the best efficiency. For the closed set Cwe need a hashmap to store the information of whether the node is closed/explored or not; note that we can use a single hashmap to store the nodes with further information, including an attribute to indicate whether the node has been explored or not, which is what we do in our implementation. A* updates the g-value and parent of an unexpanded successor ni+1 of node niby considering the distance g(ni)of the path from nstart and the distance c(ni, ni+1)from nito ni+1, resulting in g(ni) + c(ni, ni+1). It updates the g-value and parent of ni+1 if the new path distance g(ni+1)is shorter than the shortest path from nstart to ni+1 found so far (see line 13 of Algorithm 4.1); undiscovered nodes are also updated. The algorithm minimizes the cost to the target, which in our case consists on a temporal cost based on the maximum speed a glider can achieve within the ocean current field and the great circle distance between a pair of locations xiand xjfor i6=j, represented by the nodes of the gridded search graph. The great circle distance is the shortest distance on a sphere or ellipsoid that in this case approximates the Earth surface, but a simpler metric distance might be used (see Section A.2). In spherical geometry, the shortest distance between two points is an arc of a great circle. In this case, the triangle inequality holds provided the restriction that the segment covers less than half a great circle (Brock et al., 2009; Ramsay and Richtmyer, 1995). Even for large missions, we can assume this restriction is met. Consequently, since the triangle inequality holds, in glider path planning we are still working in a metric space, as in our experiments. This is important in order to guarantee that the heuristic is consistent, and the problem has optimal substructure. To compute the heuristic we estimate the maximum velocity Ucmax = max x∈P (kUc(x, t)k)of the ocean currents through the path Pthe glider will follow. Since Pis unknown in advance, we estimate Ucmax using a domain Ωspatial and temporally centered at the current location and time. Given Ucmax and the glider nominal speed Ug, we compute an underestimated temporal cost to reach the target from the current location x, of node n, using the straight distance d=kx−xgoalkto the target, h(n) = d Ug+Ucmax (4.1) which is a conservative but admissible heuristic function. Furthermore, as long as we use the same estimate of Ucmax for every node nin the graph, this heuristic is also consistent. Given the 8-connected grid of A*, Rao and Williams (2009) proposes a simplified heuristic, where dis not computed as an Euclidean distance, but rather as an almost Manhattan distance considering also the Mπ/4 4.3 Adaptation of the classical A* algorithm 71 connections. For a given location x= (x, y)and target waypoint xgoal = (xgoal, ygoal), in 2dimensions, we compute the width wand length lvalues as w= min |xgoal −x|,|ygoal −y|(4.2) l= max |xgoal −x|,|ygoal −y|(4.3) Now, the distance dturns into d= ∆x(√2−1)w+l(4.4) which can be directly plugged into the the previous heuristic h(n)definition (4.1). Also note, that for the Euclidean distance, it is sufficient to use the squared distance d=kx−xgoalk2, which makes (4.1) as efficient in terms of operations as (4.4), and hence it is what we use in our implementation. Regarding the time complexity of A*, Pearl (1984); Russell and Norvig (2010) establish that in the worst case the number of nodes expanded is exponential on the length of the optimal path, but it is polynomial if the search space is a tree, there is a single goal, and the heuristic meets the following condition: |h(n)−h∗(n)|=O(log h∗(n)) (4.5) where h∗(n)is the optimal heuristic, i.e. an admissible heuristic that gives the exact cost to get from the node nto ngoal (Russell and Norvig, 2010). Unfortunately, in our case the search space is not a tree, but a gridded graph, and the heuristic h(n)(4.1) is presumably far from the optimal. Therefore, the time complexity of A* applied to glider path planning problems is not polynomial. However, it expands less nodes than Dijkstra’s algorithm, since it is not an informed search as A* —that uses an admissible h(n). So far, we have said that the heuristic used for the search must be admissible. This is required to guarantee that we find the optimal path. However, we can impose a more strict condition on the heuristic. It is said that a consistent, or monotone, heuristic function is defined as h(ni)≤c(ni, ni+1) + h(ni+1)(4.6) h(ngoal)=0 (4.7) Indeed, (4.6) establishes that it is necessary and sufficient for a heuristic to obey this triangle inequality to be consistent (Pearl, 1984). By definition, a consistent heuristic is also admissible, i.e. it never overestimates the cost of reaching the target from any node ni. However, the opposite is not always true. Although it is unusual to have an admissible heuristic hwhich is not consistent, it can be made into a consistent heuristic h0using the pathmax equation (Russell and Norvig, 2010): h0(ni+1) = max {h(ni+1), h(ni)−c(ni, ni+1)}(4.8) A* is complete and optimal provided that h(n)is admissible (for a tree search) or consistent (for a graph search) (Russell and Norvig, 2010). Indeed, the pseudocode of Algorithm 4.1 assumes that the heuristic function is consistent, which is a frequent case in most practical problems. However, if the assumption is not true, nodes in the closed set may be rediscovered and their cost improved. In other words, the closed set can be omitted —yielding the tree search algorithm— if a solution is guaranteed to exist; or if the algorithm is adapted so that new nodes are added to the open set only if they have a lower f(n)value than at any previous iteration. For static ocean currents, the heuristic h(n)(4.1) is consistent, for the reason of the analysis presented here. However, for dynamic ocean currents, since the cost of going from any node to another changes, the triangle inequality is violated, and h(n)is no longer consistent. Consequently, we may rediscovered explored nodes from alternatives paths with an improved cost g(n). Fortunately, h(n)remains an admissible heuristic in these scenarios as well, so we can apply A*. 78 4 Ocean Glider Path Planning where s=Uc Ug sin ψec (4.14) and ψec =ψe−ψc. Consequently, if Ug> Ucthe set of feasible heading angles ψeis unbounded. Otherwise, this set is delimited by a so called accessibility cone with and arc angle ψrgiven by ψr= 2 arcsin Ug Uc (4.15) For the special case of Ug=Ucwe have ψr=π 2. Thus, a heading ψeis physically feasible if and only if it lies in ψe∈[−ψr 2,ψr 2]. This constitutes a summary of the constrained motion model explained in Section 2.2.2.2. It is used here to compute Ue, which is employed to build part of the informed PDF distribution of the ABS strategy, as we will see in the sequel. Figure 4.8 (a) and (b) show the effective speed vectors Uefor different heading angles ψe, computed with (4.13). The speed values Ueobtained for each ψe∈[−π, π]might be thought as weights wor importance factors that constitute a PDF distribution. This PDF fψc(ψe)establishes the heading angles with a higher probability of producing a greater Ue—i.e. those which are aligned with ψc. Indeed, the highest probability is always assigned to ψe=ψc, with a value of Ue=Ug+Uc. Depending on the relation between Ugand Uc, defined as the speed ratio SR = 100Uc Ug, we have different distributions (see Figure 4.8 (c)). However, it is not enough to follow the directions ψewith greater Ue, since this information is local. We have to take the direction ψdto the goal into account, which constitutes a global guess. An additional PDF distribution fψd(ψe)is built accounting the difference between the heading ψeand ψd. We propose the following Normal distribution to model it, N(ψe;µ, σ2) = 1 √2πσ2exp −(ψe−µ)2 2σ2ψe∈[0,2π](4.16) with mean µ=ψdin rad and variance σ2. A realization of this Normal distribution on ψdis shown in Figure 4.9. The composition of the PDF distributions discussed so far yields a PDF fΘ(ψe) = fψc(ψe) + fψd(ψe) that models both factors simultaneously (see Figure 4.10). This new PDF fΘ(ψe)allows to sample several heading angles ψedirectly. However, the PDFs used so far, being discrete distributions, require a normalization satisfying Pk i=1 wi= 1 to ensure a correct sampling —i.e. one that produces samples distributed according to the PDF distribution. A powerful way to sample from nonparametric distributions is the Sequential Importance Sampling (SIS) algorithm, a Monte Carlo (MC) method that forms the basis for most sequential MC filters (Doucet and Johansen, 2008; Fishman, 1996; Hammersley and Handscomb, 1964). Developed by Madow (1949, 1953); Madow and Madow (1944) in a series of papers, the Sequential sampling algorithm is a method commonly used for this purpose. Figure 4.11 depicts the operation of the SIS algorithm. Instead of selecting samples independently of each other, the selection involves a sequential stochastic process. This is achieved by drawing a random number r∈[0, M−1], where Mis the number of samples to draw. Samples are selected by repeatedly adding M−1to rand choosing the sample that corresponds to the resulting number. Any number U=r+ (m−1)M−1∈[0,1] points to exactly one sample, namely the sample ifor which i= arg min j j X k=1 wk≥U(4.17) The advantage of the SIS algorithm is threefold. First, it covers the space of samples in a more systematic fashion than an independent random sampler, and it tends to not provide ill-suited samples that an uniformly 4.4 A novel Constant Time Surfacing A* (CTS-A*) approach 79 Ue=Uc Ue=Uc+Ug Ue=Uc−Ug −0.2 0 0.2 u[m/s] 0 0.2 0.5 v[m/s] (a) 50% speed ratio Ue=Uc Ue=Uc+Ug −0.2 0 0.2 u[m/s] 0 0.2 0.5 (b) 150% speed ratio −π− π 2 ψc= 0 π 2 π ψe[rad] Ue=Ug+Uc (c) PDF distributions fψc(ψe)given by Ue Figure 4.8: Effective speed vectors Uefor heading angles ψe∈[−π, π], considering different speed ratios in (a) and (b); (c) PDF distributions fψc(ψe)for SR ∈[50,150]% centered at ψc. distributed set of samples would. Secondly, if all samples have the same importance factors, the resulting sample set will follow the same PDF distribution. Third, this low-variance sampler has O(M)complexity. The SIS algorithm might produce repeated headings, as Figure 4.12 shows. Duplicated headings are replaced by uniformly distributed samples using the interval (ψei−dl, ψei+dr)around the duplicated heading 80 4 Ocean Glider Path Planning −π− π 2 0ψd=π 2 π ψe[rad] Figure 4.9: PDF distribution fψd(ψe)that considers the heading ψd=π 2direct to the goal, modeled with (4.16). −π− π 2 ψc= 0 ψd=π 2 π ψe[rad] ω= 1 Figure 4.10: Combination of the PDF distributions fψc(ψe)shown in Figure 4.8 (c), and a PDF distribution fψd(ψe)that considers the direct heading ψd=π 2to the goal, modeled with (4.16). SR ∈[50,150]% . ψei, where dl=ψei−ψei−1 2(4.18) dr=ψei+1 −ψei 2(4.19) 4.4 A novel Constant Time Surfacing A* (CTS-A*) approach 81 w1w2. . . wN r r+1 M r+2 M . . . r+M−1 M Figure 4.11: Sequential Importance Sampling (SIS) of Msamples from Noriginal weighted samples, where M < N, i.e. subsampling. When M=Nit is usually known as resampling, while it performs an oversampling when M > N. −π− π 2 ψc= 0 ψd=π 2 π ψe[rad] ω= 1 2samples (repeated) Figure 4.12: Proposed PDF distribution fΘ(ψe)for SR = 100% and samples obtained after applying the SIS algorithm for M= 100 samples. Samples are shown with an histogram count of Mbins to show repetitions, which are eliminated creating new samples in a post-processing step. are the midpoints of each side of ψei. Once the set of heading samples ψeiis drawn from fΘ(ψe)in Figure 4.10 with the appropriated speed ratio, the bearing angles ψgifor each ψeiare given by (4.12), for i= 1, . . . , M. Recall that (4.12) is undefined for |s|>1, where s, given by (4.14), depends on SR. On those cases, we assume UgUc, so s→0and therefore ψgi=ψei. In Section 5.4.3 we will compare the uniform sampling with the ABS sampling discussed here. We consider the PDF distribution proposed here, although different distributions may be defined as well, and the influence of the number Mof bearing samples is analyzed. With the ABS strategy we pretend to mitigate the exponential growth of the computing time with M, by keeping it small using an informed, intelligent sampling strategy that allows to obtain nearly optimal paths in better time using less Mbearing samples. 82 4 Ocean Glider Path Planning 4.5 Extension of Rapidly-Exploring Random Tree algorithm The Rapidly-exploring Random Tree or RRT technique (Lavalle, 1998) is based on a random generation of test cases on the problem domain, building up an exploring tree with nodes that tend to cover the search space. RRT is included in the Rapidly-exploring Dense Tree (RDT) family of methods, which were originally developed for handling differential constraints (LaValle, 2006). In fact, the glider path planning problems can be modeled by the differential equations and constraints of the vehicle motion model, considering the ocean currents (see Section 2.2). Contrary to other algorithms, which focus on finding an optimal path, RDTs are aimed at returning only feasible trajectories, not necessarily optimal. Their main advantage is that they produce a solution trajectory with relatively less sampling than other methods, and consequently they run much faster. Indeed, this performance gain is enabled in part by the lack of concern for optimality. Algorithm 4.3 RRT algorithm pseudo-code. Require: Start x0and target xgoal locations, and number of iterations K. Ensure: Tree or graph G, that will connect x0with xgoal. Algorithm: RRT(x0,K)return G 1: G.init(x0).add start location 2: for all 1to Kdo 3: xrand =rand .new random location 4: xnear =NN(S(G),xrand).Nearest Neighbor location in the swath S(G) 5: xnew =new(xnear,∆x).new location 6: G.add vertex(xnew) 7: G.add edge(xnear,xnew) 8: end for 9: return G In Algorithm 4.3 the basic RRT algorithm is presented; note the the RDT algorithms are considered as RRT when they use random samples in the configuration/search space, rather than a deterministic sequence. In brief, the algorithm builds a graph G, which is actually the exploring tree. The root of the tree is the start location x0. The pseudo-code shown in the algorithm is the original version of Lavalle (1998), but adapted to the notation of the space configuration of glider path problems. Then, for a given number of iterations K, the RRT algorithms sample randomly a new location xrand. In the general case, this random location must be validated, in order to check that it is a feasible location —e.g. it does not collide with an obstacle. Fortunately, in the case of glider missions, we usually do not have this problem because they operate offshore. Then, the nearest neighbor NN node in the swath S(G)of Gis chosen; the swath of a graph G= (V, E)is simply the reachability of all edges e∈E, since they define a path, that is S(G) = ∪ e∈Ee([0,1]) (4.20) where e([0,1]) is the image of the path e(LaValle, 2006). The nearest neighbor node xnear is used to generate a new location xnew by moving from xnear an incremental distance ∆qin the direction of xrand. That new node xnew is added to Galong with and edge that connects xnear with it. After a certain number of iterations, the RRT algorithm exhibits its innate biased towards exploration, filling the configuration space. In Figure 4.13 (a), after K= 50 iterations, we observe an example run of the RRT algorithm on a bi-dimensional search space. Even at this early stage, we observe how the search space is almost uniformly sampled. It is after K= 500 iterations in (b), when we see a more dense tree that covers almost all the search space, with some gaps that would be filled in further iterations. It is also easy to observe that despite of the good exploration capabilities of this approach, the solution —if found— will not be optimal and will require further refinement or some sort of smoothing procedure. However, it is important 4.6 Analysis and Applicability of Optimization techniques 83 (a) 50 iterations. (b) 500 iterations. Figure 4.13: Example of an RRT tree after (a) 50 and (b) 500 iterations. to note that in the case of differential problems like glider navigation, a small change in the location of any node of the path found will result in a different trajectory, because the ocean currents may be different at the new locations, and hence the motion model will yield a new ending location. This is an important drawback of this approach for glider path planning. When applied to navigation, a bias is used to direct trajectories towards the goal location (Rao and Williams, 2009; Tan et al., 2004). In fact, our implementation is based on the work of Rao and Williams (2009), which biases the RRT growth. They point out that the probability distribution for any RRT implementation is a critical aspect. On one hand, the growth of the tree must be extensive enough to ensure optimal solutions are not overlooked, but on the other hand, it must be small enough to avoid expanding into unnecessary areas. They propose applying the adjusted Iterative k-Nearest RRT (IkRRT) algorithm of Simmons and Urmson (2003) which weights the Voronoi regions of each node by some heuristic cost, and adjusts the RRT implementation to consider the k-nearest neighbors rather than a single neighbor. Additionally, to apply the RRT algorithm to glider path planning, they advice to generate RRTs bidirectionally, i.e. one from the start x0and one from the target waypoint xn−1; the latter is generated in reverse to simulate the actual glider motion. In our preliminary experiments we have observed that at least two RRTs must be generated simultaneously, in order to obtain good results. With a single RRT from the start waypoint x0the path cost is very poor, or we simply do not reach the target. The drawback of requiring at least 2RRTs is that one of them must be run from the target waypoint xn−1, and in the case of dynamic ocean currents we need to know the time when the glider will reach it. Clearly, we do not know this information, unless we solve the problem. Therefore, we cannot generate a RRT from xn−1, since we do not know the time to retrieve the ocean currents corresponding to it. For this reason, the RRT algorithm is only used with static ocean currents in the experiments of this thesis. 4.6 Analysis and Applicability of Optimization techniques Apart from the graph-based search methods discussed thus far, it is possible to apply optimization methods to minimize an objective function that models the glider path planning problem at hand. This objective function will clearly depend on the particular problem we are solving. In this thesis, we have seen that it is possible 84 4 Ocean Glider Path Planning to solve all the problems enumerated in Chapter 3 using a single objective function that solves the minimal distance to the target problem (see Section 3.1.1). For the rest of the problems, we build a more elaborated algorithm on top of this one. To solve the minimal distance to the target problem we define an objective function based on the ending point xn−1of the integration of the glider trajectory for all the bearing angles Bcommanded from the starting waypoint x0, xn−1=f(x0,B,C,G)(4.21) where Cis the ocean currents map and Gis the glider setup —i.e. the nominal speed Ugand other parameters used in the unconstrained motion model of Section 2.2.2.1. Since we want to minimize the distance to the target waypoint xgoal, we build our objective function as the remaining distance between xn−1, given by (4.21), and xgoal. That is, the objective function f0is f0(x0,B,C,G) = kxgoal −f(x0,B,C,G)k(4.22) where k·kis a distance metric, which in our case is the length of the arc of the great circle that passes through xn−1and xgoal, since we are navigating the spherical geometry that approximates the Earth; for short-term missions, with small distance, we can use another approximation or even an Euclidean distance (see Section A.2) though. Indeed, to avoid computing square roots during the optimization process, we can take the squared distance k·k2, so the final objective function implemented is f0(x0,B,C,G) = kxgoal −f(x0,B,C,G)k2(4.23) It is important to note that the number of bearing angles in Bmust be known in advance. For the minimal distance to the target problem, this is given a priori, since we want to leave the glider as close as possible to the target xgoal in a given time T. The number of bearings |B| is obtained as T/ts, where tsis the so called surfacing time, also known in advance hence. On the contrary, for the minimal time problem |B| is unknown a priori —indeed, it is the output of the objective function. Therefore, we will use an iterative scheme (see Section 4.6.1) on top of the Optimization method explained here. Regarding the optimization method kernel, we have tried several techniques, in order to analyze how they perform with glider path planning problems. Most of these kernels solve the following minimization problem, min xf(x)(4.24) which in some cases can be subject to constraints. Another alternative formulation is the Least Squares (LS) one, which solves this slightly different problem, min xkf(x)k2(4.25) where f(x)might be a non-linear function. It is easy to adapt our objective function (4.23) for both formulations. In the first case, we minimize our objective function directly. That is, min Bf0(x0,B,C,G)(4.26) which yields the best path as a sequence of bearings B. We can observe that by plugging the value of (4.23), we actually have the formulation of a LS optimization problem, min Bkxgoal −f(x0,B,C,G)k2(4.27) Therefore, if we use this kind of optimization kernels, we only have to pass the difference between the target waypoint xgoal and (4.21), xgoal −f(x0,B,C,G)(4.28) 4.6 Analysis and Applicability of Optimization techniques 85 which provides the remaining distance to xgoal. It is important to highlight that in any case, the optimization is in the space of the bearing angles B, which makes the problem scale well for long-term missions. All optimization kernels require an initial guess, in order to iterate numerically to the optimal solution. Therefore, we have an initialization phase concerned with the generation of a feasible path that can be used as an initial guess. We need this phase to be extremely fast, so it does not introduce an excesive overhead on the whole algorithm. Therefore, we use very simple approaches. In fact, we could use two strategies. First, we simply set all the bearings B=ψd, where ψdis the direction direct to the goal, regardless of the actual glider trajectory if it would follow them. With this first strategy we assume that Bwould produce a straight line trajectory from x0to xgoal. The main advantage of this approach is that it is extremely fast, but the solution may not be feasible in some cases, since it can lead the optimization kernel to local minima, far from the actual global minimum. A second strategy consists on applying the DtG approach discussed in Section 4.2, which in most cases gives a sub-optimal, but feasible solution. Only when the scenarios are very complex —with strong ocean currents and many obstacles—, this approach fails, and we need a more intelligent and elaborated initialization phase, as it will be explained in the sequel in Section 4.6.2. The next Section 4.6.1, extends the Optimization method explained in this section, to the minimal time path problem. With this problem, contrary to the minimal distance to the target problem covered here, the number of bearings Bis unknown. However, an iterative approach uses the optimization kernel to solve the problem by successive optimization runs. Then, we improve the initialization phase explained above in order to avoid obstacles. The details of this intelligent initialization phased are explained in Section 4.6.2. Finally, we evaluate different optimization kernels with the Iterative Optimization method in Section 4.6.3; note that this iterative approach calls the kernels several times, so it allows for a more representative evaluation of the kernels. 4.6.1 A novel Iterative Optimization scheme When the number of bearings |B| is unknown in advance, the previous Optimization approach is not sufficient. However, we can build an iterative approximation in which we basically start with an optimistic, small |B| that is incremented in successive calls to the optimization kernel, until we reach the goal xgoal. Consequently, we will end up reaching xgoal in the minimal time. In fact, with this Iterative Optimization approach we solve the minimal time path problem described in Section 3.1.1. The iterative approximation of this method is described in the pseudo-code of Algorithm 4.4. As in the previous Optimization method, in a first initialization step performs the computation of a coarse, optimistic underestimation of the number of bearings  ˆ Brequired to reach the target waypoint xgoal. The function length in line 4 provides  ˆ Bby taking the line-of-sight trajectory from the current ending location x— which initially is the starting location x0— to xgoal. This function establishes the estimate number of stints —and consequently  ˆ B— of duration ts, required to reach xgoal assuming an ocean current Ucmax . In our implementation we consider the maximum of all ocean currents around the mission area, to set Ucmax . Since this might be quite pesimistic, in many cases we have reduced the area used to compute it, to a patch around the start and target waypoints. Once we have the estimate  ˆ B, the problem is solved as with the Optimization approach. Therefore, we obtain an initial guess with the function init of line 5. This function includes two options to obtain the list of bearings ˆ B; that is, it considers the bearing angles in the direction from xto xgoal, or it applies the DtG approach for them. Then we extend the list of bearings Bfrom x0to the ending location x, with the guess ˆ Bfrom xto the target xgoal (see line 6). Once the initial bearings ˆ Bhave been computed, the optimization kernel is run with this initial guess, starting at the last ending location x. If the target waypoint xgoal is not met with the desired precision tmax, the loop iterates again, expanding the list of bearings Bwith a new guess starting at the ending location x 86 4 Ocean Glider Path Planning Algorithm 4.4 Iterative Optimization algorithm pseudo-code. Require: The start x0and target xgoal points, the ocean currents map C, the glider setup Gand the target precision time radius tmax. Ensure: List of bearing angles Bfor the path of minimal cost found. Algorithm: iterative optimization(x0,xgoal,C,G,tmax)return B 1: x=x0.last surfacing point so far 2: B=∅.set of bearing angles that represent the path solution 3: repeat 4:  ˆ B=length(x,xgoal,C,G).# bearings required to reach xgoal from x 5: ˆ B=init(x,xgoal, ˆ B).initialize  ˆ Bnew bearing angles 6: B=B∪ ˆ B 7: hB,xi=optimize(x0,B,C,G) 8: Ucmax = max xi∼xC(xi).max current around x, e.g. a rectangle 9: t=kxgoal −xk Ucmax .time distance from last surfacing point to the target 10: until t<tmax 11: return B of the last optimization iteration. The termination condition is computed on the remaining time t. To calculate t, we divide the distance between the last ending location xand the target xgoal, by Ucmax . In the algorithm, the distance computation is represented by k·k, which can be a great circle distance for long-term missions, or the Euclidean distance for short-term ones, or another distance metric approximation (see Section A.2). This process iterates until the precision time radius tmax is met, yielding the optimal path in the list of bearings B, and its ending location x. Since the stints have a constant time duration ts, the termination condition must be defined for a time radius tmax ≥ts; otherwise the optimization will probably oscillate around the minimum. 4.6.2 Intelligent Initialization and Obstacle Avoidance The initialization approaches described thus far, produce acceptable results for offshore areas, which are only affected by moderately strong ocean currents at most, and where we do not have any obstacles. However, as indicated previously, for short-term coastal navigation, the naive initialization using a straight line to the target or the DtG approach fails in these scenarios. As a consequence of the complexity of these environments, and the coupled nature of the process variables, the Optimization method can easily get trapped in local minima or lead to wrong, non-optimal solutions, including paths with collisions. The Figure 4.14 illustrates this problem for a couple of test cases. For both of them we have run the naive initialization phase described thus far, and then the optimization method, for the figures (a) and (c), on the left. In both cases, the path does not reach the target waypoint because it gets trapped in an obstacle —the land, in the examples. On the contrary, with the intelligent initialization phase described here in the sequel, we obtain a rough feasible path which is successfully optimized later, as shown in the figures (b) and (d), on the right. Here, our intention is only to show that the naive initialization approach fails to find a path, so an intelligent initialization phase is required. The quality of the results will be later evaluated in the Chapter 5 by experimental comparison with graph-based path planning algorithms. To overcome the limitation of the naive initialization when it is required to have some sort of obstacle avoidance logic in the path planning algorithm, we have developed an intelligent initialization phase which is run before the optimization method, in order to provide a feasible and good initial guess. Of course, being 4.6 Analysis and Applicability of Optimization techniques 87 (a) Naive initialization. Case #1. (b) Intelligent initialization. Case #1. (c) Naive initialization. Case #2. (d) Intelligent initialization. Case #2. Figure 4.14: Path found for 2test cases with obstacles, using the Optimization method for the minimal distance to the target problem during 4days. Each figure shows the resulting path for the glider bearing angles Bfound for each surfacing point, along with the dynamic ocean currents , from the start to the target waypoint . The naive initialization approach is shown in (a) and (c), where no path that reach the target is found; meanwhile, (b) and (d) shows the successful result with an optimal path that reaches the target, by using the intelligent initialization phase. an initialization phase, it must run fast. The advantage is that the initial guess does not have to be optimal, so a rough path is enough. For the sake of clarity, we termed our method (Iterative) Optimization with Intelligent Initialization, or just (Iterative) Optimization-CTS-A* for short. Hence, the initialization phase can be thought as a bootstrap module, which is inspired on a coarse version of CTS-A* Section 4.4 and ND algorithms (Minguez et al., 2004), and that generates an appropriate initial set of bearing angles Bto start 94 4 Ocean Glider Path Planning where L2×2=uxuy vx−ux(4.51) M2×2=α2Ug−pxsin ψ pysin ψ pxcos ψ−pycos ψ(4.52) N2×2=−pxuxx −pyvxx −pxuxy +pyuxx pyuxx −pxuxy pyuxy −pxuyy (4.53) Finally, the Jacobian of the boundary conditions is G(a) =   I2×202×3 02×5 ∂˙g5 ∂x(a) ∂˙g5 ∂y(a) ∂˙g5 ∂px(a) ∂˙g5 ∂py(a)0 (4.54) G(b) =   02×5 I2×202×3 01×5 (4.55) where g5refers to (4.49) and ∂˙g5 ∂x(a)=px(a)ux+py(a)vx(4.56) ∂˙g5 ∂y(a)=px(a)uy−py(a)ux(4.57) ∂˙g5 ∂px(a)=u+Ugcos ψ+α2px(a)(py(a)Ugcos ψ−px(a) sin ψ)(4.58) ∂˙g5 ∂py(a)=v+Ugsin ψ+α2py(a)(px(a)Ugsin ψ−py(a) cos ψ)(4.59) 4.7.3 BVP solvers Both Zermelo’s and Hamilton’s equations can be solved numerically with the following BVP methods or solvers: Collocation: Requires reformulation in order to have a fixed time interval t∈[a, b], so a trick is used, by adding an additional ODE function τ. Shooting: This solver is direct, i.e. it requires no reformulation of the ODE system. We have accomplished a preliminary study of these methods with ocean currents generated with anaylitic streamfunction equations. The main drawback of the BVP solvers is that it fails with complex environments. Only with weak ocean currents we are able to find a solution. For this reason, we cannot include this approach in the experiments of this work, since we usually have test cases with strong ocean currents and obstacles. Anyway, for some synthetic test cases used for the path following problem (see Section 5.7), we have observed that for this particular problem and test, the Collocation solver performs better than the Shooting one. Also, Zermelo’s optimal navigation formula works better than Hamilton’s, since the latter fails before when the glider nominal speed Ugis reduced. In any case, optimal control (BVP) is very sensitive to the start/target waypoint location, Ug, the ocean currents function or model, and the BVP solver parameters. Thus, it is difficult to find a solution in many cases. Therefore, this family of methods are only useful to obtain the optimal solution in those cases were SR < 1, i.e. with weak ocean currents, and also without obstacles. 4.8 Glider Path Planning on Structures Extracted from the Environment 95 4.8 Glider Path Planning on Structures Extracted from the Environment Apart from the glider path planning algorithms discussed thus far, it is also possible to simplify the complexity and dimensionality of the problem by means of extracting features or structures from the environment, or by finding regions which are unstable, dangerous or for some reason it is better to avoid navigating on them. Then, we can run the path planning algorithms only on the regions outside such structures —or on the contrary, only on those structures if they are the interesting regions. In the next sections we discuss some intelligent ways to segment the ocean in different regions, so we can use them for feature-based path planning. One way to segment the ocean is by the stability analysis of the ocean currents vector field. Also, we can track Lagrangian structures like eddies, by detecting and characterizing them. Here we will present an algorithm that detects, characterize and track mesoscale eddies, which is an illustrative example and also an important application in Ocean Research, modeling and data assimilation. 4.8.1 Stability Analysis The stability analysis is concerned with the temporal stability of every region on the ocean domain. The ocean currents define a dynamic system, in which we study the transport of particles within it. In fact, the stability analysis measures how these particles separate after a given interval time T. When applied to fluids, these particles are known as tracers. Clearly, the ocean currents define the vector field v(x, t)of the ocean flow at any given point xand time t. This is exactly the output of the ROMs, which computed the ocean model equations in order to obtain such time-dependent velocity field v(x, t). In time-dependent flows, there exist emerging patterns that influence the transport of the tracers, according with the work of Shadden et al. (2005), which is followed here. The emerging patterns that are detectable in v(x, t)are often referred as coherent structures. When they are studied in terms of fluid trajectories, they are named Lagrangian Coherent Structures (LCS). Formally, they are local extrema of the Finite-Time Lyapunov Exponent (FTLE) field, which quantifies the asymptotic behavior of infinitesimally close particles in a dynamic system (Shadden et al., 2005). Hence, it provides the stability analysis of the ocean flow on the ocean currents vector/velocity field. Then, LCSs are simply ridges in the FTLE field. Shadden et al. (2005) define such ridges as special gradient lines of the FTLE field that are transverse to the direction of minimum curvature. Here we will reproduce the mathematical background of FTLEs and will show how to compute them in order to extract LCSs, which being unstable regions should be avoided by glider path planning algorithms. Paraphrasing Shadden et al. (2005), the FTLE is a finite time average of the maximum expansion rate for a pair of particles advected in the flow. Using the notation of their paper, when a point xis advected, it moves to φt0+T t0(x)after the time T, starting a t0. This advection is simply the unconstrained motion model of a drifter, described in Section B.1.1. Although here we consider bi-dimensional FTLEs for surface ocean currents, it is easy to extend this stability analysis to 3dimensions (Lekien et al., 2007). Consider the temporal evolution of a perturbed point y=x+δx(0) where δx(0) is an infenitesimal perturbation at t=t0, i.e. we have a point nearby x. After the advection for the time T, this pertubation becomes δx(T) = φt0+T t0(y)−φt0+T t0(x) = ∂φt0+T t0(x) ∂xδx(0) + Okδx(0)k2(4.60) using Landau notation (Marsden and Hoffman, 1993). The growth of linearized perturbations is hence kδx(T)k=phδx(0),∆δx(0)i(4.61) 96 4 Ocean Glider Path Planning where ∆ = ∂φt0+T t0(x) ∂x ∗∂φt0+T t0(x) ∂x(4.62) being M∗denotes the adjoint (transpose) of M. The maximum stretching occurs when δx(0) is aligned with the eigenvector associated with the maximum eigenvalue of ∆, i.e. if λmax(∆) is the maximum eigenvalue of ∆, then max δx(0) kδx(T)k=pλmax(∆) kδ¯ x(0)k(4.63) where δ¯ x(0) is aligned with the eigenvector associated with λmax(∆). We can recast this equation to make explicit the Lyapunov exponent, max δx(0) kδx(T)k=eσT t0(x)|T|kδ¯ x(0)k(4.64) where σT t0(x) = 1 |T|ln pλmax(∆) (4.65) which represents the largest FTLE for a finite integration time T, associated with the point xat time t0. Interestingly, we can use both positive and negative integration times T. We can use backward-time integration to locate attracting LCSs, and forward-time integration for repelling LCSs. Once we have the FTLE field σT t0(x), LCSs are defined as ridges on the field. A possible definition uses the second derivative ridge (Shadden et al., 2005), which uses the Hessian of the FTLE field, H=∂2σT t0(x) ∂x2(4.66) Algorithm 4.5 FTLE field computation pseudo-code. Require: Start location x0of a set of particles X0at time t0, to be advected for the integration time T. Ensure: FTLE field σT t0(x). Algorithm: FTLE(X0,t0,T)return σT t0(x) 1: for all x0∈ X0do 2: xT=φt0+T t0(x0) : xT∈ XT.advect particle x0for time T 3: end for 4: J=∇XT.gradient of flow map XT 5: ∆ = J∗J 6: σT t0(x) = 1 |T|ln pλmax(∆) .apply (4.65) 7: return σT t0(x) The computation of the FTLE field for a list of particles or tracers x0∈ X0at time t0is summarized in Algorithm 4.5. All the particles are advected with φt0+T t0(x)for an integration time T, i.e. their trajectories on the ocean currents velocity field are integrated with the unconstrained motion model of a drifter described in Section B.1.1. As a result, we obtain the location of each particle xT∈ XTafter the time T. Then, we compute its gradient, which yields the Jacobian Jthat is used to compute ∆. Finally, the FTLE is a straightforward evaluation of (4.65). In Section 3.5 we have already seen the output of the FTLE field of a dynamic double eddy, which can be generated with the analytical ocean model of Section 5.1.2.4. Here we illustrate it again for a Stuart vortex (see Section 5.1.2.5), for an integration time T= 10. This produces a forward-time FTLE field, shown in Figure 4.17. Recall that the forward-time FTLE field shows the repelling 4.8 Glider Path Planning on Structures Extracted from the Environment 97 Figure 4.17: Stability analysis by computing the FTLE field of a Stuart vortex. The unstable regions correspond to LCSs, which appear in red tones at the boundaries of the eddies/vortexes. LCSs of the ocean currents velocity field, so we observe that the unstable regions localize at the boundary of the eddies/vortexes. In terms of glider path planning, the LCSs define regions which are inherently unstable. Due to the uncertainty of the ocean model and the vehicle localization, if the vehicle crosses an unstable region, a small error on the estimation of its position may yield a resulting trajectory very different from the expected one. Therefore, we can incorporate LCSs in the path planner as obstacles, in order to avoid such regions. The great interest of the LCSs is that they can be computed for both static and dynamic ocean currents, revealing unstable regions that are not evident at first sight. 4.8.2 Feature-based Path Planning Instead of using the whole vector field defined by the ocean currents, we can find optimal paths on a low dimensional search space populated by features. Such features can be extracted from the ocean currents, with some algorithm. For instance, we may want track ocean evolving structures, like the LCSs discussed previously, or the aforementioned mesoscale eddies. Here, for feature-based path planning we simply referred to include information from such structures within the path planning algorithm in order to reduce the search space. In the next section we will see an example of this sort of feature-based path planning. We track mesoscale eddies, a particular kind of evolving structures very common on the ocean. 4.8.2.1 Detection, Characterization and Tracking of Mesoscale Eddies Here we propose a path planning algorithm meant to track eddies or similar evolving structures. The approach comprises three phases: detection and identification of eddy model parameters, definition of objective function and path generation. The algorithm uses a discretized version of the eddy model proposed by Jimenez et al. (2008) for the Canary Islands eddies system, which originates from a combination of wind and topographic forcing. The eddy model divides the structure volume into several sectors rotating at different velocities. Each sector is defined by its min/max limits in depth, radius and angle dimensions (see Figure 4.18). As a first phase, the eddy parameters are identified by combining the ocean currents, altimetry and temperature maps in a semi-automatic process. The centroid and the boundary of the eddy are annotated 98 4 Ocean Glider Path Planning Figure 4.18: Mesoscale eddy model used for the path planning algorithm developed to detect, characterize and track this kind of evolving ocean structures. The figure shows the volume segmentation of an eddy. manually on the SSHA maps and then refined using the ocean currents and temperature maps. Additionally, the eddy annotation is assisted by an automatic detection run at pre-processing step. It highlights potential eddy candidates, using the vorticity of the vector field or an eddy detection algorithm (Nencioli et al., 2010). Once the eddy has been detected and modeled, the objective function is expressed in terms of the eddy sectors (see Figure 4.18) that should be sampled and the desired mission duration. This way it is possible to define different sampling strategies: track the centroid of the eddy, navigate at the boundary, maximize the sampled volume, flight at a given depth, and so on. Finally, in the last phase, a Genetic Algorithm optimization is run in order to find the trajectory that best meets the specifications. At this step, we use the three-dimensional unconstrained point motion model of Section 2.2.2.1. 4.9 Glider Path Planner Library and Tools Apart from the algorithmic contributions of this thesis to the problem of glider path planning, as a result of this work we have developed as set of tools and a library. We have termed this library and tools Pinz´ on, after the Spanish navigator and explorer Vicente Y´ a˜ nez Pinz´ on, who came back from America and faced strong opposing ocean currents near the North coast of Spain, as we faced at the end of the RU27 trans-Atlantic mission, when we assisted on the piloting with our path planning tools. The library developed comprises all the path planning algorithms presented in this chapter, along with the point and force balance motion models. We can also use Pinz´ on to simulate/integrate the glider trajectory, given the real surfacing points xiof a glider at the ocean. Additionally, we can simulate other vehicles like drifters and floats, under both motion models (see Appendix B). The software allows to run and compare the DtG approach, A*, (ABS) CTS-A*, RRT, (Iterative) Optimization —with or without the intelligent initialization phase for obstacle avoidance. The Figure 4.19 4.9 Glider Path Planner Library and Tools 99 Figure 4.19: Output that shows the path found with the CTS-A* algorithm. The figure draws the glider trajectory from the start to the target node/waypoint. The blue arrows on the background show the ocean currents vector field at the starting time, while thick red and green arrows are the bearing ψg and heading ψeangles, respectively. depicts a typical path planning output. It shows the path found, which consists on a sequence of waypoint locations xi, and the bearing angles ψgithat must be commanded to the glider. The bearing angles, along with the resulting heading angles ψei, are shown as arrows emanating from each surfacing point located at xi. The glider trajectory due to the drift is drawn to illustrate the important effect of time-varying ocean currents. Bear in mind that the background ocean currents vector field of Figure 4.19 corresponds to the first time snapshot, because it is not possible to show it over time in a single frame. Thus, Pinz´ on produces movie clips to sort this issue out. Finally, for graph-based algorithm the explored nodes —or even discovered— by the algorithm are marked, for debugging and evaluation purposes as in the figure for the CTS-A* algorithm. This gives some insight on the searching process, that might be exhaustive or not depending on the problem on hand. Equivalent debugging capabilities are offered for the rest of the algorithms supported. The tools in Pinz´ on also allow to visualize the output of the ROMs. We can download the nowcast and forecast maps for a given date and analyze the different parameters computed by the ocean model. This include scalar water properties like the Sea Surface Temperature (SST), the Sea Surface Height Anomaly (SSHA), which are both defined for the surface, and three-dimensional data like the temperature and salinity —from which we can compute the density at every depth. And also include the ocean currents vector field, typically with the uand vcomponents for the surface or at depth; see Appendix A for more information on Ocean Models and their products. Furthermore, our Pinz´ on path planner is capable of producing a movie to illustrate the temporal dynamics of the ocean currents vector field and how the glider trajectory is affected, for the path found. Pinz´ on also generates Google™Earth animations in Keyhole Markup Language (KML) format, as the one in Figure 4.20 that allows to analyze the path found overlaid on the glider mission data, or even the weather, on the map where the mission takes place. 100 4 Ocean Glider Path Planning Figure 4.20: Example of path planned by Pinz´ on in the ESEOAT region of the ROM of the ESEOO project using the RU27 surfacing points, to reach a goal specified as crossing a meridian. The output is a KML animation that can be run in Google™Earth; in the figure we see a snapshot. Chapter 5 Experimental Results This chapter shows the experimental results obtained for the glider path planning algorithms developed in this thesis. They are evaluated and compared with each of the problems or applications explained in Chapter 3. Here, we start by describing the default experimental setup, which is used for most of the algorithms and problems; any minor variation with respect to this base configuration will be explicitly mentioned though, along with any particular setup of a given experiment. The experimental setup gives an overview of the ocean model products and the glider motion model used for path planning. Although we mostly use real ROM products in our experiments, we have also developed a number of analytic ocean model equations. They constitute a complementary contribution of this work, being useful to evaluate the algorithms in environments that exhibit a particular structure or dynamics —e.g. constant ocean currents, sinks, sources, eddies, etc. Before we show and discuss the results, the evaluation metrics are described in detail. In brief, they comprise the computational time and path optimality assessment. The first should be in agreement with the algorithm complexity, as described in Chapter 4. The path optimality depends on the particular problem though. If a clear and simple objective function is available, such function itself gives the path optimality directly, as in the minimal time and minimal distance to the target problems. The path following problem is evaluated using a Pareto curve for the path following and minimal time path objectives. In the case of multi-glider path planning problems, we evaluate the proximity of the gliders flying in formation, or the time required for their recovery, which are the two problems covered here. For the atomic problems minimal time path and minimal distance to the target, all the path planning algorithms developed in this thesis are evaluated. For the rest of the problems —which are build as an aggregation of the atomic ones— we only want to check and assess the applicability of the most promising technique for such problem. This is the case of multi-glider coordination using constraints, path following —to some extent—, and tracking evolving ocean structures. For the sake of clarity, we present the experimental results organized by problem or application. Note that some techniques are not applicable for some problems, so this seems a reasonable way to compare them. Furthermore, this way we can evaluate each method with its best configuration for a given problem, and answer one of the questions addressed in this thesis, i.e. which technique performs better for a certain problem/application. Finally, along with that comparison, we discuss several field glider missions in which our algorithms have been used aiding piloting and path planning. 5.1 Experimental Setup Before we show the experimental results, we are going to indicate here the default and basic configuration of the experiments. This comprises the glider motion model, some assumptions or simplifications on the glider navigation behavior, and the characteristics of the ocean currents provided by the ocean model employed in 101 102 5 Experimental Results the test cases. Unless stated explicitly, the test cases later presented for each glider path planning problem will adopt the experimental setup described here. In Section 2.2 we explored the three main options to model the glider motion. First, the point model, which considers the glider as a 0-mass point moving with a certain nominal speed ugin a given bearing ψg. Secondly, the force balance model, which compounds the vehicle buoyancy, gravity, drag and lift forces to obtain the glider speed, which also depends on the angle of attack αof the wings with respect to the hull, and the pitch θand glide γangles. And third, dynamic motion models that solve the differential equations of the vehicle dynamics. In our experiments we use the point motion model described in Section 2.2.2, since for the accuracy obtained with the other models is not really required given the large errors and the uncertainty of some parameters of the glider motion model and the ocean model itself. Furthermore, for the relatively large missions performed, it makes no sense to use precise motion models in most of the cases. Moreover, given the large dimensionality of the problems, it is common to consider certain assumptions. A common simplification consists in using only surface ocean currents to find the optimal path. However, the glider navigates underwater doing yo-yo profiles, and affected by the ocean currents at the depth it is flying. We can compute the depth average ocean currents though, if we want to work in 2dimensions but still reflect the effect of underwater ocean currents. In fact, it is straightforward to use such depth average ocean currants as in Thompson et al. (2010), where the total ocean current force experienced by the glider underwater is taken to be a constant Cxyτ within each grid cell. Anyway, it will be better to consider the ocean currents in 3dimensions, in order to obtain the most accurate estimation of the glider trajectory underwater, and hence the next surfacing point location xi+1. We have detected that the decision depends on the algorithm designed to solve the problem. So far we have mentioned that the A* algorithm uses the constrained motion model of Section 2.2.2.2, while others like the CTS-A*, RRT or the Optimization method integrate the unconstrained motion model of Section 2.2.2.1. Recall that in the constrained motion model we do not integrate the glider trajectory while it navigates underwater. We simply compute the bearing ψgto follow a given heading ψe, using the glider nominal surge speed Ugand the ocean currents vector Uc. Since the trajectory is not integrated, we do not really use the depth ocean currents. Therefore, for the constrained point motion model we use the two-dimensional surface ocean currents in our experiments; we use depth average ocean currents if the ROM provides the ocean currents at different depths, but this depends on the temporal resolution, as we will later see in Section 5.1.1. On the other hand, for the unconstrained point motion model we integrate the glider trajectory underwater, which is affected by the ocean currents at each depth computed by the integration method. Therefore, if the ocean currents below the surface are provided by the ROM, we use three-dimensional ocean currents with the algorithms that use the unconstrained motion model, i.e. the CTS-A*, RRT and (Iterative) Optimization methods —and the DtG approach as well. Notice that we do not simulate the drift during the surfacing interval (see Section 2.1.2). We have chosen to isolate its effect, assuming it distributes as a constant added cost for all the algorithms evaluated. Only when we are assisting in the glider piloting we will include the surfacing intervals of ≈15min in the path planning algorithm —stating it explicitly—, so the path Pfound can actually be followed on the field. Note that to simulate the drift produced by the surface ocean currents for this slot of time, we use the drifter motion model, which is simply runs the two-dimensional unconstrained point motion model, or its three-dimensional version with no pitch θ= 0◦(see Section B.1.1). In our experiments we generally set the glider pitch to θ= 25◦, which is the typical value set for the SLOCUM glider. However, we could also set the optimal value θ= 35◦, which give the maximum glider nominal speed Ugmax according with the equations of the force balance motion model (see Section 2.2.3). Anyway, for the same group of test cases we use the same pitch θ. Moreover, we do not include θin the path planning optimization, since it is rarely changed during real glider missions. Similarly, we neither modify the depth limits [zmin, zmax], which are set to [20,200]m in most of the test cases run here. The number of yo-yo profiles done for the surfacing time ts—while the glider navigates underwater— is not set and neither 5.1 Experimental Setup 103 change in the path planner. Its value is determined from the depth limits and ts, as shown in Section 2.2.2.1. Although we will indicate it explicitly, we consider two main values for the glider nominal surge speed Ugin our experiments. We set Ug= 0.2m/sas a slow glider speed, which is equivalent to navigate with strong ocean currents, i.e. SR > 1; and Ug= 0.4m/sas a fast glider speed, which is equivalent to navigate with weak ocean currents. This constitutes a sub-division of the test cases in the experiments as well. We also categorizes them as offshore or coastal, in order to separate obstacle free environments from the ones populated by many of them, respectively. And similarly, we distinguishes between long-term and short-term missions, which are associated with the use of static and dynamic ocean currents, respectively. Also, the former is generally the type of mission for the minimal time path problem, while the latter type of mission if more common for the minimal distance to the target problem. Unless stated explicitly, these categories obey this criteria. 5.1.1 Regional Ocean Model Scenarios In the present work, we have fed our path planning algorithms with the ocean currents computed by Regional Ocean Models (ROMs). Although we have also used non regional Ocean Models, this ones have less resolution than ROMs, both in space and time. Therefore, they cannot capture many phenomena that take place in the ocean. Indeed, for our firsts experiments during the last stings of the RU27 trans-Atlantic mission, when the glider traveled the Spanish EEZ, we had to use a ROM that modeled that region. We used the ROM developed by Puertos del Estado (Ministerio de Fomento, Gobierno de Espa˜ na) as part of the project ESEOO, that covers the Spanish Atlantic shore (Sotillo et al., 2007, 2008). The model is run separately for three domains in the Spanish territory. First, the ESEOAT covers the North Atlantic area close to the west coast of the Iberian Peninsula. Secondly, the ESEOMED models the Mediterranean sea nearby Spain. And third, the ESEOCAN region comprises the Canary Islands. In our experiments we have used extensively the ESEOAT model, and for the obstacle avoidance test cases we also use ESEOCAN, since the Canary Islands take the role of land obstacles in the ocean. This ROM provides temporal series hourly with 3-day predictions —or forecast maps— at 0.05◦spatial resolution for latitude and longitude. The ROM output is validated with samples taken in situ by oceanographic sensor networks. Thus, the ROM is meant to provide accurate data, capturing the high temporal dynamics of the area. It provides two types of data in regards of their dimensionality and temporal resolution. First, bi-dimensional surface ocean currents for every hour. We consider them dynamic ocean currents in the experiments. Secondly, three-dimensional ocean currents for every day; more precisely, the model provides the daily means. For long-term missions we usually need more days than the 3-day forecast maps generated by the ROM. We use a single, representative map of the seasonal period when we are running the experiment. We use three-dimensional ocean currents, which represent the average ocean currents in such period of time. Although the ROM provides several data, it is possible to plan paths using ocean currents only, because they are not geostrophic ocean currents simply, i.e. they incorporate the effect of other phenomena, like tides. Anyway, additional physical parameters might be incorporated easily, as the density —obtained from the depth, temperature and salinity scalar maps— if we were to use the force balance motion model, the Sea Surface Height Anomaly (SSHA) —tightly related with the ocean currents vector field— or the Chlorophyll concentration (CHL) to avoid dangerous areas in regards of the bio-fouling and its impact on the vehicle autonomy. Apart from the ESEOAT and ESEOCAN regions, for the next experimental results we also use the output of the IBI ROM, which also covers the North Atlantic and the Canary Islands. Nevertheless, we have also run our algorithms for several path planning problems on different regions in the oceans. We have used global, mesoscale ocean models of less resolution, like NCOM, NLOM, and HYCOM, to mention some. All these ocean models are enumerated and described briefly in Appendix A. In Figure 5.1 several plots illustrate the high temporal variability of ocean currents in the area covered by the ESEOAT ROM, which was crossed by the RU27 glider in its trans-Atlantic mission. Paths planned 110 5 Experimental Results (a) t= 0. (b) t= 0.33. (c) t= 0.66. (d) t= 1. Figure 5.6: Snapshots for the analytical double eddy ocean currents at (a) t= 0, (b) t= 0.33, (c) t= 0.66, and (d) t= 1. 5.1.2.5 Stuart vortex A Stuart vortex is a dynamic eddy-like structure (Kasten et al., 2012) defined for any location x= (x, y)and time tas follows u(x, y, t) = 1 + sinh (2y) A(5.21) u(x, y, t) = sin (2(x−t)) 4A(5.22) where A= cosh (2y)−cos (2(x−t)) 4(5.23) In Figure 5.7 (a)-(d) we have 4snapshots at t={0,0.33,0.66,1}for the double eddy vector field in the region (x, y)∈[0,2] ×[0,1]. We observe how the eddies stretch and expand together over time, conforming a dynamic vector field. We have set A= 0.1,= 0.25 and ω= 2π. 5.1.2.6 Tiled eddies Interestingly, we can create a tile of eddies of the same size for any location x= (x, y)by using these simple equations, u(x, y) = −sin y(5.24) v(x, y) = sin x(5.25) Similarly, we can make the tiled eddies a dynamic vector field by simply moving one of the coordinates x or y(Robel, 2010). In fact, we are just translating the equations of the tile in such direction. For instance, if 5.1 Experimental Setup 111 (a) t= 0. (b) t= 5. (c) t= 10. (d) t= 15. Figure 5.7: Snapshots for the analytical Stuart vortex ocean currents at (a) t= 0, (b) t= 5, (c) t= 10, and (d) t= 15. we make such translation to depend on the time t, we have dynamic tiled eddies. Therefore, in the case of a translation on ywe have u(x, y, t) = −sin (y+t)(5.26) v(x, y, t) = sin x(5.27) (a) t= 0. (b) t= 2. (c) t= 4. Figure 5.8: Snapshots for the analytical dynamic tiled eddies ocean currents at (a) t= 0, (b) t= 2, and (c) t= 4. In Figure 5.8 (a)-(c) we have 3snapshots at t={0,2,4}for the dynamic tiled eddies vector field in the region (x, y)∈[7,18] ×[7,18]. 112 5 Experimental Results 5.1.2.7 Sinusoidal Eichhorn (2010) uses a time-varying ocean flow streamfunction that has a dynamic sinusoidal shape (Alvarez et al., 2004; Cencini et al., 1998), to test the path following problem. Indeed, we also use this same streamfunction in part of our preliminary experiments (see Section 5.7). The streamfunction is defined as Ψ(x, y, t)=1−tanh (Q)(5.28) where the quotient Q=N/D is defined by N=y+A(5.29) D=p1 + A2 x(5.30) where, with a slightly abuse of notation for the sake of clarity, A=A(x, t, k, c) = −B(t, , ω, θ) cos (k(x−ct)) (5.31) and Ax=∂A(x, t, k, c) ∂x =kB(t, , ω, θ) sin (k(x−ct)) (5.32) where B(t, , ω, θ) = B0+cos(ωt +θ)(5.33) with B0= 1.2,= 0.3,ω= 0.4,θ=π/2,k= 0.84 and c= 0.12. This are the values used in (Eichhorn, 2010) and in our tests in Section 5.7 as well. (a) t= 0. (b) t= 0.33. (c) t= 0.66. (d) t= 1. Figure 5.9: Snapshots for the analytical sinusoidal ocean currents at (a) t= 0, (b) t= 0.33, (c) t= 0.66, and (d) t= 1. In order to compute the vector field (u, v)from the streamfunction, we need the first partial derivatives 5.2 Evaluation Metrics 113 of (5.28), i.e. the Jacobian JΨ=   ∂Ψ(x, y, t) ∂x ∂Ψ(x, y, t) ∂y   =−sech2Q D Ax−QAxx D 1!(5.34) where Axx =∂2A(x, t, k, c) ∂x2=−k2A(x, t, k, c)(5.35) In Figure 5.9 (a)-(d) we have 4snapshots at t={0,0.33,0.66,1}for the dynamic sinusoidal vector field in the region (x, y)∈[−12,12] ×[−4,4]. 5.2 Evaluation Metrics In order to evaluate the different algorithms developed in this thesis we will use a series of metrics. Here we enumerate and describe them in detail, since they will be used intensively in the following sections. Although these metrics are generally applicable to all the glider path planning problems addressed, in some cases the evaluation is rather qualitative. This is the case of problems like path following, some multi-glider problems and tracking evolving ocean structures, where the assessment of the technique depends tightly on the objective function that the problem aims to optimize. In these problems, we simply try to validate it can solve the problem adequately in a reasonable amount of computing time. We distinguish two type of metrics. First, those that evaluate the quality of the result, that in the case of path planning is the optimality of the path found. Secondly, the computing time on average or the worst case. In order to obtain representative values for these evaluation metrics we will run a number of test cases with representative scenarios, divided in different categories. Such categories allow for a fine evaluation at different types of environments, like weak or strong ocean currents, static or dynamic ocean currents, offshore or coastal regions —which are usually populated by more obstacles—, and long-term or short-term missions. Regarding the optimality of the path found, the actual evaluation metric depends on the glider path planning problem at hand, since it defines a specific objective function to optimize. However, for the problems discussed in this thesis, we identify two main optimality metrics, which are associated with each of the atomic glider path planning problems (see Section 3.1). On one hand, for the minimal time path problem we evaluate the travel time, which is the time required to go from the starting waypoint x0to the target one xgoal, for a given glider nominal surge speed Ugand the ocean currents Uc—of the map used in the tests— along the path Pfound. On the other hand, for the minimal distance to the target problem we evaluate the remaining distance to the target xgoal, from the ending point xn−1of the path Pfound for the travel time ttgiven. In the case of the minimal time path problem, we have also used an alternative evaluation metric. This metric is the glider effective speed Ueof the path found. It provides a more relative value, rather than the travel time tt, which is an absolute value. In fact, Ueis computed as Ue=kxgoal −x0k tt (5.36) which gives a quasi-normalized metric of the distance d=kxgoal −x0kfrom x0to xgoal divided by the travel time tt. However, this metric still depends on the distance dof a given test case, so we must categorized the test cases according to din order to facilitate the comparison of the algorithms, as we do in Section 5.4 and 5.6 In glider path planning, the computing time is often ignored as a priority due to the typical long duration of glider missions and immersion periods of tstime between surfacings. For this reason, the computing time of the results shown in the sequel is given simply as a relative reference. We have tried to use the best 114 5 Experimental Results implementation and configuration for each algorithm in our programming environment, but the computing time still depend strongly on the codification, compiling and executing efficiency, and it is not the central focus of this thesis. Although this is generally true, in some cases the path planner must respond inside a short temporal window to face an unforeseen situation, and provide the glider with a new path before it dives again, during the short time it stays on surface for ≈15min. In fact, this is very common in short-term missions, where the minimal distance to the target problem is usually solved at each surfacing point xiin order to update the actual xiin the path planner and obtain the optimal path for the next stints using the —possibly updated— dynamic ocean currents. Consequently, we evaluate the computing time of the techniques for a sufficient number of tests, and adopt the best configuration for each algorithm at the problem at hand. 5.3 Experiments In the next sections we show the experimental results of the present thesis work. For each application or glider path planning problem we evaluate the algorithms discussed in Chapter 4. The results shown here have been obtained in simulation, but using ocean currents provided by ROMs that actually represent —up to some uncertainty— the state of the ocean, by means of the computation of ocean models fed and tuned with data assimilation. Therefore, the test cases run can be considered close to real field tests. Indeed, we have used some of the results to assist on the piloting of several gliders operating in long-term mission. This is the case of the RU27 trans-Atlantic missions, as we will see in Section 5.4. In Chapter 3 we have described the glider path planning problems addressed in this work. They cover the atomic optimization problems of finding the minimal time path and the minimal distance to the target, along with a series of more elaborated problems. These two atomic problems are analyzed first, in order to validate the applicability of each technique in the basic problems that are later required to implement the others. Being the minimal time path problem the first one covered, we include the preliminary results we obtained at the start of this work. Similarly, we explain how we applied it for the piloting of the RU27 using the ocean currents of the ESEOAT region provided by the ROM of the ESEOO project. Apart from the feasibility of the techniques and the optimality of the path found, we also analyze the computing time, as mentioned previously. For this reason, we study the influence of the ABS strategy (see Section 4.4.3) for the CTS-A* algorithm at the beginning. Then, all the methods presented in the thesis are compared in long-term missions using static ocean currents, as this is the common scenario for minimal time path problems. On the other hand, for the minimal distance to the target problem, we address short-term missions, and we use dynamic ocean currents provided by the ROM forecast maps; note that in this case some methods are not applicable, like the RRT. Then, we analyze how all the techniques perform in the presence of obstacles. We have run test experiments for both atomic problems in both types of missions —i.e. long-term and short-term, with static and dynamic ocean currents, respectively. Then, for the rest of the glider path planning problems, the most promising techniques are evaluated. For the path following problem we validate the different objective functions developed to measure the deviation of the path found Pfrom the desired path Pd(see Section 3.3). Next, we apply our Iterative Optimization method to solve this problem as a constraint imposed on the minimal time path problem. We also relax the path following constraint with a corridor around Pdin order to obtain several non-dominated solutions for each objective. And finally, we illustrate how to scale this problem to more complex paths Pd, as a windmill pattern to sample mesoscale eddies. Later, we coordinate multiple gliders to solve several multi-glider path planning problems. Here we cover the navigation in formation, and the efficient recovery of the glider fleet with a ship. Finally, we conclude our experiments by showing our preliminary results on tracking evolving ocean structures. In particular, we model mesoscale eddies as described in Section 4.8, and apply a Genetic Algorithm to optimize the sampling strategy of certain regions of the eddy. 5.4 Minimal Time Path 115 5.4 Minimal Time Path As we have previously mentioned, we are going to start the presentation of our experimental results with the minimal time path problem. This basic problem, in the field of glider path planning, is the equivalent to the shortest path problem for ground robots. It constitutes a minimal capacity required to perform other sorts of glider path planning, and it will be used in several applications at the ocean. Here, we compare the algorithms proposed in this thesis with the manual direct to goal piloting approach, and later among them. We consider two main cases for evaluation. The first case is the short-term path planning with dynamic ocean currents, where we have used the ROM forecast maps as input. The other one is the long-term path planning —in the order of ≈1month traveling— using static ocean currents, since no ROM provides predictions for such number of days in advance. Indeed, we consider test cases in which the path does not last longer than the seasonal period, which can be represented with an average map. In the first case, with dynamic ocean currents, we illustrate the viability of graph-based methods. The A* algorithm adapted to glider path planning (see Section 4.3) is compared with the novel CTS-A* approach (see Section 4.4). With our first experiments we do not want to evaluate these methods in accord with the metrics shown thus far. On the contrary, our intention is to put clear that the A* adaptation of authors like Garau et al. (2005); Pˆ etr` es et al. (2005); Soulignac (2010) —and ours as well—, still does not reflects the glider motion model adequately. Later, using static ocean currents we will evaluate all the techniques presented in this dissertation using the evaluation metrics of Section 5.2, for the minimal time path problem in long-term scenarios. At this point, we want to draw the attention to the central difference between A* and CTS-A*. Such difference comes from the fact that the cost function is based on the time rather than on the distance traveled. Furthermore, the effect of ocean currents on the glider motion model —whatever it is— creates a manifold that is confined to the accessibility cone shown in Section 4.4.3, i.e. the region where the vehicle is able to move according with the speed ratio SR. The A* algorithm defines an uniform grid in advance, where the nodes —or vertex— of the grid are placed at a given constant distance from each other. Consequently, the time required to reach a node is not constant, and it may even be impossible to follow the bearing to go from the current node to certain adjacent ones. Therefore, the cost function, which incorporates the constrained glider motion model and yields a time value, has a twofold negative impact on the A* algorithm. First, in the presence of large ocean currents —i.e. a high speed ratio— the number of feasible bearings plummets. The path search is then reduced to a small number of adjacent nodes in the graph. Sometimes, it may even happen that the feasible bearings neither fall in any of these nodes, and no path is found. Clearly, we need to search in the bearing configuration space. This is a first consequence we conclude from the analysis of A* algorithm. The second negative impact is on the fail to remain faithful to the glider navigation pattern (see Section 2.1), in particular, regarding the constant time between successive surfacing points. Trying to reach the nodes on the grid, the time underwater is not constant anymore. Our CTS-A* approach, although still based on A* search, solves the two problems of A* aforementioned. CTS-A* does it by exploring different bearing angles starting from the current node, and applying the unconstrained glider motion model of Section 2.2.2 for a constant integration time. Consequently, all bearings are explored and they produce a constant time stint underwater. Recall that the final location of these trajectories is then taken to a gridded search space, as explained in Section 4.4. 5.4.1 RU27 trans-Atlantic mission In Figure 5.10 we show the output of A* and CTS-A*, along with the DtG approach and the path followed by the “Scarlet Knight” RU27 glider in the trans-Atlantic mission (Glenn et al., 2009). We developed our first path planning techniques —A* and CTS-A*— to assist in the glider piloting of RU27 when it entered in the area of the ocean modeled by the ESEOAT region of the ROM maintained by the ESEOO project, highlighted in Figure 5.11, which includes the Spanish EEZ (Exclusive Economic Zone) and the coast of Portugal and 116 5 Experimental Results Figure 5.10: Comparison of paths planned with different path planning strategies from the start node to the target node for the 21-Nov-2009: DtG , A* and CTS-A* , along with the RU27 path ; the ocean currents provided by ESEOAT in an area of ≈100km, close to the coast of Galicia (Spain), were used by the path planning algorithms. some part of France and Marocco. We run our algorithms to obtain the path plan that would allow the glider to reach the waypoint of Figure 5.10 starting at its actual surfacing point location on November 21, 2009. At this time —after almost 221 days of travel, as it took finally—, the ocean currents where very strong and highly time varying nearby. After several months flying the Atlantic Ocean, barnacles had attached to the glider’s hull, as shown in Figure 5.13. Such accumulation of organisms on wet surfaces is known as biofouling. Its impact on the glider dynamics is an added mass and extra drag that reduces the vehicle horizontal speed; recall the spider plots shown for the force balance motion model in Section 2.2.3. More than 500 years ago, in 1493, a similar historic episode happens when the Spanish navigator Pinz´ on was coming back from the discovery of America. His caravel class ship named the Pinta was very damaged and the weather conditions were bad, as they were in our experiments with RU27. Our path planner proposed, for the glider, a path similar to the one Pinz´ on followed to reach the coast of Spain. For that reason, we coined Pinz´ on to our path planner. For our experiments with RU27, we used the ROM forecast maps of ESEOAT, which predicts up to 3days. The paths found with DtG, A* and CTS-A* techniques are plotted in Figure 5.10, assuming a glider horizontal speed of Ug= 0.35m/s. However, according with the RU27 path, also shown in the figure, the glider was traveling at a lower speed of Ug≈0.15m/s, as a consequence of the biofouling. Although simulated with a higher speed, the DtG approach follows a path similar to RU27, since the strategy is equivalent to manual piloting (see Section 4.2). Note that with Ug= 0.15m/sit was not possible to reach the target, as shown in Figure 5.12 (b); the same happened to the real glider, indeed. For this reason, we try to take the glider as close as possible to the target, and we even found a path that reached the target for certain situations at the end of the mission, as shown in the figure (a). The blind approach of DtG executes very fast, but the path found takes more time than our graph-based path planning methods. While the DtG strategy sets the bearing in the straight direction to the goal, the other two methods explore several paths starting from the current location. Later, with long-term scenarios we will quantify the difference among them using the evaluation metrics. 5.4 Minimal Time Path 117 Figure 5.11: Map showing the RU27 path and the ESEOAT region, where we apply our path planning techniques to assist in the glider piloting, at the end of the trans-Atlantic mission. (a) Plot output. (b) KML output. Figure 5.12: Pinz´ on paths found for the RU27 trans-Atlantic mission: (a) plot, and (b) KML output; for two different situations at the end of the mission. 118 5 Experimental Results Figure 5.13: SLOCUM glider affected by biofouling after several months flying. Barnacles have attached to the vehicle’s hull and have grown to the point that the dynamics are significantly affected. Image taken from the Atlantic Crossing blog (Glenn et al., 2009), which shows the conditions of RU27 by the end of the trans-Atlantic mission. 5.4.2 Initial Results By now, we just want to highlight that the global view of the path planners helps in finding a better solution, close to the optimal one. And they search for that solution by adequately managing the dynamic ocean currents, the glider motion model, and the time-based cost function. The limitations of A* can be observed in Figure 5.10. A* represents each surfacing point with a node in a regular grid. As a consequence, the set of bearings evaluated for the next action is reduced to the ones that connect the current node with its neighbors. The surfacing point of the path found by A* shows that gridded pattern in the figure. Also, the distance traveled is constant, but not the time. Meanwhile, the path found by CTS-A* has constant time stints, which a travel distance which is clearly different among each of them in the figure. With CTS-A*, the underwater trajectory is also computed with the unconstrained glider motion model. This can be appreciated in the bend path of CTS-A* between surfacing points. On the contrary, A* uses a constrained motion model that —apart from some improvements made in our implementation— only takes a single mean velocity to represent the ocean current speed during a stint between adjacent nodes. Consequently, it does not compute the motion accurately, neither considers the variability of the ocean currents during the stint. Although the path found by A* may have a similar cost —or even better, in some experiments— to CTS- A* one, the important point to bear in mind is the fact that A* does not model the glider motion adequately. Or, put differently, with CTS-A* the glider motion model is accurately computed, and the constant time surfacing behavior is guaranteed within the path planning algorithm. All in all, for the test run shown in Figure 5.10, both A* and CTS-A* find paths of lower cost than the DtG one, which costs approximately 8h more. As it have been previously mentioned, the improvement in the path cost is greater when the speed ratio is high. For this reason, we have analyzed the influence of the ocean currents strength, their temporal variability and the size of ocean eddies, on the results of our path planning methods and the DtG approach. The effect of the ocean current field strength actually relies on the speed ratio given by Ucmax Ug, used in the heuristic shown in Section 4.3. It determines whether the glider can beat them or not. From that speed ratio equation we have that an Ugincrease is equivalent to navigate through weaker ocean currents; or, on the contrary, a Ugdecrease is like moving in strong ones. For testing purposes we consider a given ocean 5.4 Minimal Time Path 119 current field and different values for Ug. For slow speeds (or strong ocean currents) the glider will be more sensitive to the drift —almost following the ocean currents—, as observed in the more curved trajectory of the Ug= 0.2m/scase of Figure 5.14. On the contrary, the resulting paths tend to the straight line with the faster Ug= 0.35m/sspeed (weaker ocean currents), as shown in the figure as well. Clearly, intelligent path planning is more important under strong ocean currents, or more specifically, when the speed ratio is high. In fact, for weak currents the DtG approach suffices to capture a nearly optimal path. Furthermore, the figure shows the influence of strong ocean currents on the glider trajectory while it glides underwater, as computed by our CTS-A*. It integrates the equations of the unconstrained motion model of Section 2.2, so such trajectories are accurately computed and used by the planner. In the case of A*, we do not have those trajectories, but the effect of strong ocean is more severe, because it prunes many path from the search space prematurely. Figure 5.14: Paths planned for November 21, 2009, considering fast Ug= 0.35m/s(speed ratio of 167.02%) and slow Ug= 0.2m/s(speed ratio of 292.28%) glider horizontal speeds, which is equivalent to path planning for weak and strong ocean currents, respectively. The paths were found with the CTS-A* algorithm using the ocean currents provided by ESEOAT in an area of ≈100km, close to the coast of Galicia (Spain). Similarly, it is possible to test the path planner for different structures of the ocean currents. Eddies are common structures that may vary in size; from small and short life, to large and long life ones —like mesoscale eddies. When they are large, the resulting paths are more intricate, provided that the ocean currents are sufficiently strong. Therefore, path planning proves particularly useful in such cases, as we will see throughout the experiments of this chapter. Indeed, during the RU27 flight sub-mesoscale eddies were oscillating over time in the ESEOAT region. 5.4.3 ABS CTS-A* Before we compare all the path planning techniques implemented in this thesis for the minimal time path problem, we are going to evaluate our CTS-A* algorithm in terms of computing time. Such evaluation includes the Adaptive Bearing Sampling (ABS) strategy explained in Section 4.4.3, which helps to reduce the CTS-A* computing time. Furthermore, we consider several numbers of samples Mto evaluate up to which point it can be reduced before the path quality degenerates significantly. Since we are interested in establish such value xxvi 3 Problemas y Aplicaciones de las condiciones marinas y la evoluci´ on del proceso a muestrear, de forma que se maximicen las posibilidades de obtener una buena caracterizaci´ on. Dentro de esta categor´ ıa se recogen aplicaciones destinadas a la detecci´ on y seguimiento de proliferaciones de algas nocivas, filamentos, frentes o giros oce´ anicos. 3.5.1 Estructuras Coherentes Lagrangianas Igualmente, es posible obtener Estructuras Coherentes Lagrangianas, que pueden ser est´ aticas o din´ amicas a su vez. ´ Estas se obtienen a partir del an´ alisis de estabilidad de la corrientes oce´ anicas, utilizando los Exponentes de Lyapunov en Tiempo Finito (FTLE). Figura 3.8: Exponentes de Lyapunov en Tiempo Finito (FTLE) computados sobre un campo de corrientes oce´ anicas sint´ etico que forma un doble giro —superpuesto con flechas blancas. Los valores de FTLE representan la estabilidad de cada regi´ on en el campo, tal que las regiones inestables —como los bordes de los giros— aparecen en rojo y las estables en azul —como el centroide de los giros. La Figura 3.8 muestra el campo de FTLE con las corrientes de un doble giro generado sint´ eticamente. Claramente observamos como las zonas del borde de los giros son altamente inestables. Esto es debido a que si el veh´ ıculo estuviera en estas zonas, un m´ ınimo error en su localizaci´ on podr´ ıa significar que acabar´ ıa en posiciones muy diferentes pasado un tiempo T, asumiendo el modelo de movimiento puntual de un derivador. Dada la incertidumbre en la localizaci´ on de los gliders bajo el agua, en la medida de lo posible es interesante evitar estas zonas duran la planificaci´ on de rutas. 3.5 Muestreo de Estructuras xxvii 3.5.2 Giros Mesoescalares Los giros son un tipo de estructura que se encuentra a distintas escalas espaciales y temporales en el oc´ eano. Por ello son de alto inter´ es en los estudios del comportamiento del oc´ eano. Para poder caracterizarlos es necesario muestrearlos siguiendo una trayectoria que se focalice en los caracter´ ısticas claves del giro, para un correcta caracterizaci´ on. La Figura 3.9 muestra patr´ on de muestreo en forma de molino, donde se realizan transectos en forma de l´ ıneas que cruzan el centroide del giro desde un extremo a otro de su borde. Estas l´ ıneas se seguir´ an resolviendo el problema de seguimiento de trayectorias, discutido con anterioridad. Este patr´ on de muestreo resulta conveniente para estas estructuras, frente a otros patrones comunes en exploraci´ on, como el de lawnmower. S x0 c Figura 3.9: Patr´ on de muestreo de giros en forma de molino. Para un giro circular, el patr´ on de muestreo en forma de molino define un camino que cruza el centro cdel giro sucesivamente con una serie de transectos empezando en x0. Cada transectos es un camino lineal que va desde un lado del giro al opuesto. Ah´ ı, viaja cierta distance a lo largo del borde del giro antes de volver a cruzarlo. Cap´ıtulo 4 Planificaci´on de Rutas El objetivo central de esta tesis es proponer algoritmos que permitan la optimizaci´ on de rutas para gliders oce´ anicos aprovechando las condiciones de las corrientes marinas en el entorno. 4.1 Revisi´on En la bibliograf´ ıa se han planteado diferentes soluciones al problema de la planificaci´ on de trayectorias para veh´ ıculos marinos no tripulados, en general, y gliders en particular. Como aproximaciones m´ as significativas podemos encontrar los m´ etodos basados en grafos (A* y variantes), el muestreo probabil´ ıstico (RRT) y las t´ ecnicas basadas en optimizaci´ on (bioinspiradas, teor´ ıa de sistemas, campos de potencial). La Figura 4.1 muestra un diagrama resumen con las t´ ecnicas aplicadas a la planificaci´ on de rutas para gliders por otros autores. Estas t´ ecnicas se representan en l´ ıneas temporales organizadas por categor´ ıas, que representan el tipo de aproximaci´ on adoptado. Igualmente, aquellas t´ ecnicas inspiradas en variaciones aproximaciones, se se˜ nalan con l´ ıneas m´ as finas que interconectan varias categor´ ıas. 4.2 Pilotaje Manual El pilotaje manual de un glider, explicado con anterioridad, se utilizar´ a como elemento base para comparar los algoritmos de planificaci´ on de caminos desarrollados en este trabajo. Aqu´ ı modelamos el pilotaje manual con una aproximaci´ on que fija las direcciones ψedel glider directamente hacia el destino xgoal en cada punto xxix xxx 4 Planificaci´ on de Rutas 2005 2008 2009 2010 2004 2009 2004 2008 2010 2010 2007 2008 2005 2008 2010 A* Sliding WE (A* & Optim.) Symbolic WE (dep. time) A* (Zermelo’s) RRT (AUVs) RRT (gliders) GA Swarm Optim. (w/ SA) ACO BVP (Dubins curves) Energy functions Potential fields FM* NTG MILP Optim.-based Figura 4.1: Diagrama temporal con algunas de las aproximaciones de planificaci´ on de caminos para gliders m´ as relevantes dentro del campo. El a˜ no de publicaci´ on y la t´ ecnica se muestran en el diagrama, el cual est´ a dividido por categor´ ıas de acuerdo con el tipo de t´ ecnica de planificaci´ on de caminos usado (de arriba a abajo): M´ etodos basados en grafos ; m´ etodos basados en muestreo probabil´ ısticos ; m´ etodos de optimizaci´ on bio-inspirados ; aproximaciones de Teor´ ıa de Sistemas ; funciones de energ´ ıa ; y m´ etodos de optimizaci´ on num´ erica . Las l´ ıneas delgadas que conectan diferentes categor´ ıas representan algoritmos que combinan ideas de diferentes tipos de aproximaciones. de emersi´ on. A esta aproximaci´ on la denominamos DtG (Direct to Goal). El diagrama de la Figura 4.2 ilustra el funcionamiento del DtG. Desde la localizaci´ on xide un punto de emersi´ on, se fija la direcci´ on ψgigual al rumbo ψddirecto al destino xgoal. El problema de esta aproximaci´ on es que es ciega, es decir, no tiene en cuenta el efecto de las corrientes. 4.3 Algoritmos propuestos xxxi ψg=ψd xi−2 xi−1xi xgoal Figura 4.2: Diagrama de la aproximaci´ on Direct to Goal, la cual fija la direcci´ on ψgigual al rumbo ψdhacia el waypoint de destino xgoal desde la localizaci´ on actual xi. 4.3 Algoritmos propuestos A lo largo de este trabajo de tesis se han desarrollado un conjunto de algoritmos de planificaci´ on especialmente adaptados a las caracter´ ısticas de los gliders. A continuaci´ on se incluye una descripci´ on de sus principales caracter´ ısticas. 4.3.1 Adaptaci´on del A* Se ha adaptado el algoritmo cl´ asico para operar en base a la simulaci´ on de las trayectorias posibles del glider sobre el mapa de corrientes. El A* se utiliza com´ unmente para resolver el problema del camino m´ as corto, pero utilizando el modelo de movimiento puntual restringido de la Secci´ on 2.2.1.2 es posible resolver el problema del camino de m´ ınimo tiempo. ψe xi−2 xi−1xi xgoal fm´ın Figura 4.3: Algoritmo A* cl´ asico sobre una rejilla uniforme que define el dominio del espacio de b´ usqueda Ω. Los ´ angulos de rumbo ψeest´ an restringidos por la rejilla, produciendo trayectorias en l´ ınea recta entre nodos y tiempos de emersi´ on no constantes para los problemas de planificaci´ on de caminos para gliders. El funcionamiento del algoritmo A* se ilustra en el diagrama de la Figura 4.3. Podemos ver como la direcci´ on ψgque se fija para el glider debe ser tal que permita seguir el rumbo ψe, tal que el veh´ ıculo pueda xxxii 4 Planificaci´ on de Rutas ir del nodo actual a otro nodo de la rejilla del grafo de b´ usqueda. Es por eso que se requiere del modelo de movimiento restringido. El problema fundamental de esta aproximaci´ on es que en zonas de corrientes fuertes, el cono de accesibilidad se puede estrechar hasta el punto de que no sea posible llegar a ning´ un nodo vecino desde el nodo actual. Algorithm 4.1 Pseudo-c´ odigo del algoritmo A* para b´ usquedas en grafo impl´ ıcitos. Require: Nodos inicial nstart y destino ngoal. Funci´ on heur´ ıstica h(n)que estima el coste desde el nodo n angoal. La heur´ ıstica h(n)se asume consistente, de modo que se usa un lista cerrada Cpara hacer la b´ usqueda m´ as eficiente. Funci´ on parents(ni)que recupera el camino Pextrayendo los padres de ni=ngoal a partir del mapa parent(·)map recursivamente, hasta que alcanza nstart. Ensure: Camino ´ optimo Pencontrado desde nstart angoal. Algorithm: A*(nstart,ngoal)return P 1: g(nstart) = 0 .asumimos g(ni) = ∞para el resto 2: parent(nstart) = ∅.asumimos parent(ni) = ∅para el resto tambi´ en 3: O=C=∅.listas abierta y cerrada vac´ ıas 4: O.insert(nstart, g(nstart) + h(nstart)) 5: while O 6=∅do 6: ni=O.pop .extraer nodo nicon el m´ ınimo coste 7: if ni=ngoal then .destino ngoal alcanzado 8: return parents(ni).camino encontrado (extra´ ıdo de parent(·)) 9: end if 10: C=C ∪{ni}.cerrar nodo ni 11: for all ni+1 ∈successors(ni)do .para cada sucesor ni+1 12: g0=g(ni) + c(ni, ni+1).valor gcandidato 13: if (ni+1 /∈ C ∪O)∨(g0< g(ni+1)) then .no descubierto o mejor g0 14: g(ni+1) = g0.actualizar 15: parent(ni+1) = ni 16: O.insert(ni+1, g(ni+1) + h(ni+1)) .decrementar clave (actualizar, o insertar si no descubierto) 17: end if 18: end for 19: end while 20: return ∅.ning´ un camino encontrado En el Algoritmo 4.1 tenemos el pseudo-c´ odigo del algoritmo A* utilizado. ´ Este emplea un grafo impl´ ıcito, que se construye evaluando el modelo de movimiento restringido en la funci´ on que genera los nodos sucesores —o vecinos— del nodo actual. Como se mencion´ o anteriormente, en algunos casos el n´ umero de vecinos puede ser muy bajo o, incluso nulo, debido al efecto de las corrientes oce´ anicas. El algoritmo A* emplea una heur´ ıstica para acelerar la b´ usqueda del camino ´ optimo, siendo as´ ı m´ as r´ apido que el algoritmo de Dijkstra. Para computar la heur´ ıstica h(n), estimamos la m´ axima velocidad Ucm´ax = m´ax x∈P (kUc(x, t)k)de las corrientes oce´ anicas a lo largo del camino Pseguido por el glider. Puesto que P 4.3 Algoritmos propuestos xxxiii no se conoce de antemano, estimamos Ucm´ax usando un dominio Ωcentrado espacial y temporalmente en la localizaci´ on actual y tiempo. Dada Ucm´ax y la velocidad nominal del glider Ug, computamos una subestimaci´ on temporal del coste de alcanzar el destino desde al localizaci´ on actual x, del nodo n, usando la distancia d=kx−xgoalkal destino, h(n) = d Ug+Ucm´ax (4.1) que es una funci´ on heur´ ıstica conservativa pero admisible. Adem´ as, mientras usemos la misma estimaci´ on de Ucm´ax para cada nodo nen el grafo, esta heur´ ıstica tambi´ en es consistente. 4.3.2 CTS-A* El patr´ on de movimiento del glider es recogido con precisi´ on en este algoritmo, de manera que los resultados tienen un mayor plausibilidad. A diferencia del A*, el CTS-A* genera tiempos constantes entre emersiones, al igual que los gliders. Para ello, en la generaci´ on de sucesores del grafo impl´ ıcito de b´ usqueda, emplea el modelo de movimiento puntual no restringido explicado en Secci´ on 2.2.1.1. ψg xi−2 xi−1 xi xgoal fm´ın Figura 4.4: Diagrama de funcionamiento del algoritmo Constant-Time Surfacing A*. En cada localizaci´ on de emersi´ on xidiferentes direcciones ψgson consideradas, integrando la trayectoria del glider durante el tiempo entre emersiones ts, o m´ ultiplos s·ts. El diagrama de la Figura 4.4 ilustra como ahora se considera un conjunto de direcciones ψgy para cada una de ellas se integra el modelo de movimiento no restringido. La posici´ on resultante de la emersi´ on tras el tiempo tsse lleva a una rejilla s´ olo con la finalidad de mantener constante el uso de memoria del algoritmo. As´ ı, mantenemos los tiempos entre emersiones constantes y simulamos la verdadera trayectoria del glider realizando los perfiles yo-yo mientras navega sumergido entre emersiones. En el Algoritmo 4.2 se muestra el procedimiento de generaci´ on de sucesores, en el que se considera un muestreo uniforme de direcciones ψg—con una determinada discretizaci´ on— y para cada una se integra el xxxiv 4 Planificaci´ on de Rutas Algorithm 4.2 Generaci´ on de sucesores en el CTS-A*. Require: Nodo actual n, el n´ umero kde direcciones (bearings) a muestrear y el tiempo entre emersiones ts para integrar la trayectoria. La integraci´ on de la trayectoria require el paso de integraci´ on dt, la velocidad nominal del glider vg(ψg)para una direcci´ on ψg, y el campo de velocidades de las corrientes oce´ anicas vc(x). Si un nodo vecino mtiene el mismo coste g0que la nueva trayectoria xψg, se usa una funci´ on d(x, n). Si d(x, n) = h(n), podemos usar f(n)en lugar de g(n), con una sola condici´ on. Ensure: Lista de sucesors Sy actualizaci´ on del etiquetado de nodos considerando el coste g(x)y la distancia d(x, m)de la localizaci´ on xemparejada con el nodo m. Algorithm: successors(n,k,ts)return S 1: S=∅ 2: for all 1to kdo 3: ψg∼[0,2π).muestrear bearing 4: s= 0 5: repeat 6: xψg=trajectory(ts, dt, vg(ψg),vc(x),xn) 7: m=NN(xψg).nodo mm´ as cercano a xψg 8: s=s+ 1 9: until m6=n 10: g0=g(n) + s·ts 11: if m /∈ C ∪O then . m no descubierto hasta ahora 12: mx=xψg 13: else 14: if g0< g(m)then .menor coste 15: mx=xψg 16: else if g0=g(m)then .igual coste, pero 17: if d(xψg, m)< d(mx, m)then .mejor localizaci´ on 18: mx=xψg 19: end if 20: end if 21: end if 22: S=N ∪{m}.a˜ nadir ma la lista de sucesors S 23: end for 24: return S modelo de movimiento no restringido. Este algoritmo tambi´ en controla el etiquetado de los nodos, que se encarga de guardar las localizaciones de las emersiones en los nodos. Se guardan en base al coste acumulado y una funci´ on que puede ser la distancia m´ as cercano al nodo o la propia heur´ ıstica. 4.3.3 ABS Para aliviar el coste computacional del CTS-A*, se emplea un muestreo en base a una funci´ on de densidad de probabilidad (PDF) que tiene en cuenta tanto la direcci´ on predominante de la corriente como el rumbo fijado para el glider. Esto mejora el muestreo uniforme de las direcciones ψgadoptado en la versi´ on b´ asica del 4.3 Algoritmos propuestos xxxv algoritmo CTS-A*. −π− π 2 ψc= 0 ψd=π 2 π ψe[rad] ω= 1 Figura 4.5: Combinaci´ on de distribuciones PDF fψc(ψe)y una distribuci´ on PDF fψd(ψe)que considera el rumbo ψd=π 2directo al destino, modelada con (4.5). SR ∈[50,150] % . En la estrategia de muestreo adaptativo de direcciones (ABS) es posible modelar la PDF considerando la velocidad efectiva Uey el rumbo ψdal destino. Primeramente, Uese modela con el modelo de movimiento restringido de la Secci´ on 2.2.1.2. Dados Ug,Uc,ψcy el rumbo deseado ψe, se computa la direcci´ on ψg necesaria para compensar la deriva producida por las corrientes como ψg=       ψe+ arcsin sif |s| ≤ 1 @otherwise (4.2) que da la velocidad efectiva Ue Ue=       Ug√1−s2+Uccos ψec if |s| ≤ 1 0en otro caso (4.3) donde s=Uc Ug sin ψec (4.4) xlii 4 Planificaci´ on de Rutas Figura 4.9: Modelo de giro mesoescalar usado para el algoritmo de planificaci´ on de caminos para detectar, caracterizar y seguir este tipo de estructuras oce´ anicas m´ oviles. La figura muestra la segmentaci´ on del volumen del giro. 4.5 Librer´ıas y Herramientas Finalmente, no s´ olo se han contribuidos algoritmos novedosos a la planificaci´ on de rutas con gliders, sino tambi´ en una serie de librer´ ıas y herramientas para la misma y la visualizaci´ on de las salidas de los modelos oce´ anicos y los resultados de la planificaci´ on. Bajo el nombre de Pinz´ on, nuestro software permite visualizar los caminos encontrados —junto con sus direcciones ψgen cada punto de emersi´ on— sobre Google™Earth, tal y como muestra la Figura 4.10. Asimismo, se ha automatizado la descarga de productos de m´ ultiples modelos oce´ anicos y la visualizaci´ on de sus productos, como la temperatura, salinidad, SSHA, las corrientes, etc. (v´ ease el Ap´ endice A). 4.5 Librer´ ıas y Herramientas xliii Figura 4.10: Ejemplo de camino planificado con Pinz´ on en la regi´ on ESEOAT del ROM del proyecto ESEOO usando los puntos de emersi´ on de RU27, para alcanzar el objetivo especificado como cruzar un meridiano. La salida es una animaci´ on KML que puede ejecutarse en Google™Earth; en la figura vemos una captura. Cap´ıtulo 5 Resultados Experimentales Los algoritmos desarrollados en este trabajo de tesis han sido probados para evaluar su validez y comparados entre s´ ı sobre diferentes escenarios para determinar los m´ as adecuados a cada problema. En estos experimentos se han utilizado, por un lado, mapas de modelos regionales de predicci´ on, y por otro, mapas sint´ eticos generados para reproducir condiciones particulares de test. Los principales problemas que se han analizado son los siguientes: camino de m´ ınimo tiempo, camino de m´ ınima distancia restante al destino, evitaci´ on de obst´ aculos, seguimiento de trayectorias, planificaci´ on multi-glider y, a modo preliminar, seguimiento de estructuras m´ oviles. En los problemas b´ asicos se ha analizado el rendimiento de los diferentes algoritmos sobre una bater´ ıa de casos de prueba representativos, incluyendo diferentes rangos de distancia y condiciones de corrientes. Se ha realizado una comparativa de las distintas aproximaciones aplicando las correspondientes m´ etricas de evaluaci´ on. 5.1 Camino de M´ınimo Tiempo Para el camino de m´ ınimo tiempo hemos probado los algoritmos DtG, RRT, A*, CTS-A* con M= 18 muestras, y Optimizaci´ on Iterativa. Los resultados se resumen en el Cuadro 5.1. Se han lanzado 20 casos de test que muestran como el DtG y RRT no son capaces de encontrar ninguna soluci´ on en algunos casos. Por contra, el A*, CTS-A* y el m´ etodo de Optimizaci´ on Iterativa, siempre encuentra soluci´ on, siendo la de ´ este ´ ultimo ligeramente mejor que los m´ etodos basados en grafos. xlv xlvi 5 Resultados Experimentales Cuadro 5.1: Coste del camino (tiempo viajado) en d´ ıas para el problema del Camino de M´ ınimo Tiempo. La media de 20 casos de test se muestra en la comparativa. Method All Successful DtG NA in 60 % 18,0 RRT NA in 20 % 17,7 A* 19,4 17,1 CTS-A* 19,2 16,9 ABS CTS-A* 19,2 16,9 Iterative Optimization 18,9 16,7 Figura 5.1: Comparativa del Camino de M´ ınimo Tiempo para el DtG, RRT, A*, CTS-A* con M= 18 muestras, y Optimizaci´ on Iterativa, para un ratio de velocidad alto, i.e. para corrientes oce´ anicas fuertes, fijando la velocidad del glider a Ug= 0,2m/s. La distancia viajada fue d= 861,88km. La figura muestra el camino sobre las corrientes oce´ anicas (las corrientes que exceden la velocidad del glider Ugest´ an resaltadas ) desde el waypoint inicial al de destino . El tiempo viajado tt(en d´ ıas) para cada m´ etodo fue: DtG = 53,8; RRT = 49,7; A* = 49,6; CTS-A* = 50,0; Optimizaci´ on Iterativa: 47,4. La Figura 5.1 muestra un ejemplo de ejecuci´ on para el problema del camino de m´ ınimo tiempo, utilizando una velocidad nominal del glider de Ug= 0,2m/s, lo cual equivale a navegar con corrientes fuertes en este 5.2 Camino de M´ ınima Distancia Restante al Destino xlvii ejemplo. Se observa claramente como la ruta del DtG y RRT son similares y mas largas que las de los m´ etodos basados en grafos, A* y CTS-A*, y el de Optimizaci´ on Iterativa, que encuentran caminos similares entre s´ ı. 5.2 Camino de M´ınima Distancia Restante al Destino Para el camino de m´ ınima distancia restante al destino hemos probado los algoritmos DtG, A*, CTS-A* con M= 18 muestras, y Optimizaci´ on; no se prueba el algoritmo RRT porque manejamos corrientes din´ amicas. Los resultados se resumen en el Cuadro 5.2. Cuadro 5.2: Diferencia promedio de la distancia al destino (en km) con respecto a la aproximaci´ on DtG; positivo es mejor. Valores para los 65 casos de test ejecutado para el problema de m´ ınima distancia restante al destino. Method All Strong Weak A* 0,5 4,9−6,0 CTS-A* 5,2 8,6 0,2 Optimization 8,5 12,4 2,7 Se han lanzado 65 casos de test, divididos en corrientes d´ ebiles y fuertes. La mejora respecto al DtG, que se muestra en el Cuadro 5.2, es claramente mayor con corrientes fuertes. Asimismo, el algoritmo de Optimizaci´ on es el que deja al veh´ ıculo m´ as cerca del destino, despu´ es del tiempo de misi´ on Tdado. En la Figura 5.2 se muestra un caso de test, en el que tras para el tiempo de misi´ on Tvemos la posici´ on final xn−1del camino encontrado por cada algoritmo. El DtG y el A* se quedan bastante m´ as lejos que el CTS-A* y el de Optimizaci´ on. 5.3 Evitaci´on de Obst´aculos Para la evitaci´ on de obst´ aculos se han seleccionado escenarios extra´ ıdos del mar de Canarias, donde la presencia de las islas permite definir configuraciones complejas de resolver para la planificaci´ on. Se han analizado los algoritmos tanto para misiones largas con corrientes est´ aticas, como misiones cortas con corrientes din´ amicas. Esto es equivalente a decir que se ha probado la evitaci´ on de obst´ aculos para el problema del camino de m´ ınimo tiempo y el de m´ ınima distancia restante al destino, respectivamente. A continuaci´ on se muestran los resultados para este segundo problema, resumidos en el Cuadro 5.3. xlviii 5 Resultados Experimentales Figura 5.2: Captura de un caso de test para 4d´ ıas; la ´ ultima predicci´ on se repite para rellenar las no disponibles. La figura muestra el camino sobre las corrientes oce´ anicas (las corrientes que exceden la velocidad del glider Ug= 0,4m/sest´ an resaltadas ) desde el waypoint inicial al de destino . La distancia desde el waypoint inicial al de destino es 344,6km. La distancia restante para alcanzar el destino es, para cada algoritmo: Optimizaci´ on = 68,9km; CTS-A* = 85,1km; A* = 169,4km; DtG = 217,6km. Cuadro 5.3: Diferencia de la distancia restante para alcanzar el waypoint de destino con respecto al m´ etodo Optimizaci´ on-CTS-A*, para el problema de m´ ınima distancia restante al destino. Promedio y desviaci´ on t´ ıpica entre par´ entesis, ambas en km. La tabla resume los 45 casos de test realizados para un velocidad del glider de Ug= 0,4m/s. Method Total Coast Offshore DtG 42,4(46,0)67,4(39,0)13,6(24,0) A* 8,5(18,0)5,3(7,0)9,1(6,0) CTS-A* 5,2(6,0)5,8(7,0)6,5(4,0) Optimization 10,3(21,0)19,6(26,0)0,0(0,0) Los resultados se han separado para zonas de costa y offshore, comparando cada t´ ecnica con la del m´ etodo Optimizaci´ on-CTS-A*, que aplica el m´ etodo de inicializaci´ on inteligente utilizando una versi´ on gruesa del algoritmo CTS-A*, tal y como se explica en la Secci´ on 4.3.5.2. Observamos como lejos de costa el resultado sin esta fase de inicializaci´ on es equivalente a la usada en el m´ etodo de Optimizaci´ on, lo cual indica su validez en todos los escenarios. En zonas costeras, esta inicializaci´ on mejora cerca de 20km la soluci´ on del m´ etodo de Optimizaci´ on. Adem´ as, se consiguen resultados en torno a ≈5km mejores que con las t´ ecnicas basadas 5.3 Evitaci´ on de Obst´ aculos xlix (a) Caso I. (b) Caso II. (c) Caso III. (d) Caso IV (sin obst´ aculos). Figura 5.3: Comparativa del problema de M´ ınima Distancia Restante al Destino para el problema de Evitaci´ on de Obst´ aculos. Comparativa de 4casos de test realizados Ug= 0,4m/s. La distancia restante al waypoint de destino is (SL si Stop in Land): (a) Optimizaci´ on-CTS-A* = 13,3km, Optimizaci´ on = 22,1km, CTS- A* = 20,6km, A* = 25,9km, DtG = 157,1km (SL); (b) Optimizaci´ on-CTS-A* = 0,0km, Optimizaci´ on = 69,7km (SL), CTS-A* = 3,2km, A* = 8,7km, DtG = 80,0km (SL); (c) Optimizaci´ on-CTS-A* = 46,7km, Optimizaci´ on = 54,2km (SL), CTS-A* = 60,7km (SL), A* = 58,9km (SL), DtG = 61,3km (SL); (d) Optimizaci´ on-CTS-A* = 67,4km, Optimizaci´ on = 68,8km, CTS-A* = 85,1km, A* = 169,4km, DtG = 217,6km. Respectivamente, la distancia total desde el waypoint inicial al de destino es: 176,5km,125,8km, 75,2km,343,4km. en grafos. M´ as lejos a´ un queda la aproximaci´ on DtG. En la Figura 5.3 se muestran 4casos de evitaci´ on de obst´ aculos cerca de islas. En (d) se incluye el caso l 5 Resultados Experimentales sin obst´ aculos visto previamente, a efectos comparativos. Podemos observar como en algunos casos de test la mayor´ ıa de t´ ecnicas quedan atrapadas; n´ otese que las t´ ecnicas basadas en grafos pueden verse atrapadas debido las corrientes en torno a determinadas zonas. 5.4 Seguimiento de Trayectorias En el caso del seguimiento de trayectorias se ha comprobado la capacidad de las soluciones propuestas para mantener la ruta del glider sobre la ruta deseada. Tambi´ en se ha comprobado la mejora en el rendimiento que se consigue relajando ligeramente las condiciones del seguimiento. Figura 5.4: Comparativa de caminos encontrados con un glider viajando a Ug= 0,4m/spara cruzar un giro desde un lado a otro, para el problema del Seguimiento de Trayectorias. El Camino de M´ ınimo Tiempo tambi´ en se incluye. Los puntos de emersi´ on se marcan a lo largo del camino. Las corrientes oce´ anicas (las corrientes que exceden la velocidad del glider Ugest´ an resaltadas ) y la l´ ınea de costa tambi´ en se muestran. Precisamente, la Figura 5.4 muestra los caminos relajando la condici´ on de seguimiento de la trayectoria deseada, para diversos anchos desde 0,2km a10km. El camino deseado se defini´ o como una l´ ınea recta, y el m´ etodo de Optimizaci´ on Iterativa se ejecut´ o con una restricci´ on de seguimiento de trayectoria, alrededor del camino deseado, seg´ un el rango de relajaci´ on anterior. Igualmente, se calcula la trayectoria que sigue estrictamente el camino deseado. Con la relajaci´ on de la condici´ on de seguimiento de la trayectoria obtenemos varias soluciones, que definen 5.5 Planificaci´ on Multi-glider li Figura 5.5: Curva de Pareto que muestra el tiempo viajado frente al promedio de la distancia al camino deseado, para los caminos encontrados en la Figura 5.4. la curva de Pareto mostrada en la Figura 5.5. La curva de Pareto muestra los dos objetivos contrapuestos uno frente al otro, i.e. el tiempo viajado (eje y) frente al promedio de la distancia al camino deseado (eje x) —que es la l´ ınea recta en este ejemplo. Todos los caminos intentan mantener el veh´ ıculo cerca de la l´ ınea recta, pero esta restricci´ on se relaja en cada simulaci´ on incrementando el tama˜ no del pasillo alrededor de la l´ ınea. Como muestra la figura, mientras m´ as estrecho es el pasillo, mayor es el tiempo viajado. Mientras tanto, al agrandarse el pasillo, nos aproximamos al camino de m´ ınimo tiempo de la optimizaci´ on sin restricciones. Finalmente, es posible concatenar m´ ultiples problemas de seguimiento de trayectorias, como muestra el patr´ on en forma de molino de la Figura 5.6. ´ Este est´ a compuesto por m´ ultiples trayectorias en forma de l´ ıneas rectas que deben ser seguidas. As´ ı, con la soluci´ on a este problema se pueden realizar aplicaciones de muestreo de giros siguiendo, por ejemplo, este patr´ on de molino. 5.5 Planificaci´on Multi-glider Para la planificaci´ on multi-glider se han seleccionado escenarios en los que los gliders deb´ ıan mantener una posici´ on relativa fija con respecto a un veh´ ıculo l´ ıder. Tambi´ en se han planteado problemas de optimizaci´ on del tiempo de recuperaci´ on de m´ ultiples unidades desplegadas. lviii 6 Conclusiones Finalmente, hemos avanzado en los primeros pasos en el muestreo de estructuras oce´ anicas m´ oviles. En particular, hemos desarrollado una t´ ecnica para seguir giros mesoescalares y mejorar la estrategia de muestreo (v´ ease la Secci´ on 4.4.2). Este problema tiene enorme inter´ es en la asimilaci´ on de datos, y su uso para mejorar el modelado de estas estructuras en los modelos oce´ anicos. Part II Resumen Extendido en Espa˜nol 1 Cap´ıtulo 1 Introducci´on La oceanograf´ ıa es la disciplina que se encarga del estudio de los oc´ eanos. Se trata de un ´ ambito complejo en el que convergen m´ ultiples ´ areas de inter´ es como son el estudio de las corrientes marinas, el oleaje o la din´ amica de fluidos; tect´ onica de placas y geolog´ ıa del fondo marino; organismos marinos y din´ amica de ecosistemas; difusi´ on de sustancias qu´ ımicas y propiedades f´ ısicas del oc´ eano. El estudio de los diferentes procesos presentes en el medio marino requiere la definici´ on y ajuste de modelos que permitan caracterizar su din´ amica y ayudar a predecir su evoluci´ on. Un aspecto clave, del que depende en gran medida el ´ exito de esta tarea, es la necesidad de disponer de sistemas de muestreo adecuados que suministren datos reales con los que contrastar la bondad de dichos modelos. Esta tesis se centra en los aspectos ligados al uso de dispositivos rob´ oticos en la monitorizaci´ on del medio marino. 1.1 T´ecnicas de muestreo Tradicionalmente se han empleado en la observaci´ on del oc´ eano diferentes sistemas de captura de datos como son la tele-detecci´ on basada en sat´ elite, radares, boyas o los buques oceanogr´ aficos. En las ´ ultimas d´ ecadas han surgido nuevas t´ ecnicas de muestreo que intentan suplir diferentes limitaciones identificadas en los sistemas m´ as tradicionales. Se trata de los veh´ ıculos aut´ onomos submarinos. Podemos distinguir dos tipos principales de veh´ ıculos submarinos: los operados remotamente o ROVs, y los aut´ onomos o AUVs. Dentro de estos ´ ultimos, existe un tipo especial, que son los planeadores submarinos o gliders. El presente trabajo est´ a enfocado a proporcionar herramientas destinadas a este tipo de veh´ ıculos. 1.2 Planeadores Submarinos Aut´onomos Los Planeadores Submarinos Aut´ onomos, tambi´ en denominados com´ unmente planeadores o gliders — atendiendo al t´ ermino en ingl´ es—, son un tipo de veh´ ıculo aut´ onomo submarino que se desplaza usando un mecanismo de propulsi´ on ´ unico basado en modificar su flotabilidad. Estos veh´ ıculos poseen un sistema que emula el funcionamiento de la vejiga natatoria de los peces para provocar movimientos de ascenso y descenso c´ ıclicos. Dichos desplazamientos verticales se traducen en una lenta pero efectiva velocidad de avance gracias a la interacci´ on de los planos de control y sustentaci´ on con el medio acu´ atico. Se generan de esta manera perfiles de movimiento en “V” caracter´ ısticos, denominados yo-yos. Un glider el´ ectrico, como el modelo SLOCUM de la Figura 1.1, utiliza una bomba hidr´ aulica para trasvasar un cierto volumen de aceite entre el interior y el exterior del casco del veh´ ıculo. De esta forma, el consumo de energ´ ıa necesario para la propulsi´ on se produce ´ unicamente en los puntos de inflexi´ on en los que el robot activa la bomba, permitiendo unos niveles de autonom´ ıa dif´ ıciles de igualar para otros veh´ ıculos. 1 2 1 Introducci´ on Figura 1.1: Spray de Bluefin Robotics (delante), SLOCUM de Teledyne Webb Research (medio) y Seaglider de iRobot (detr´ as), en el Laboratorio de Gliders en las instalaciones de la Plataforma Oce´ anica de Canarias (PLOCAN). Cortes´ ıa de PLOCAN. N´ otese que las alas son extra´ ıbles para facilitar el transporte y mantenimiento, y por esa raz´ on han sido extra´ ıdas del casco en los veh´ ıculos aqu´ ı mostrados. Los gliders operan en base a la definici´ on de unos puntos de paso o waypoints que el robot trata de alcanzar sucesivamente. Una vez fijado el rumbo hacia el pr´ oximo objetivo el veh´ ıculo ejecuta una serie predefinida de ciclos de ascenso/descenso, denominados transecto o stint; y que est´ an delimitados entre dos valores de profundidad m´ ınima y m´ axima, tras los cuales emerge de nuevo. Una vez en superficie, el glider se localiza por medio del GPS —o por cualquier otro GNSS—, transmite datos b´ asicos a su centro de control y, en su caso, recibe nuevas ´ ordenes. Transcurrido un corto periodo de tiempo, en torno a 15 −20 minutos, el glider inicia un nuevo stint (tramo sumergido), cuya duraci´ on suele oscilar entre 6y8horas. 1.3 Planificaci´on de rutas El principal inconveniente que tiene el uso de los gliders en la monitorizaci´ on del medio marino es su dependencia de las condiciones del medio. La lenta velocidad de avance que los caracteriza (aproximadamente un kil´ ometro por hora) puede llegar a ser igualada e incluso superada por las corrientes marinas. Por lo tanto, es necesario anticipar su efecto en la trayectoria del veh´ ıculo si se desea conseguir alcanzar un punto determinado o seguir una ruta deseada. La fuente de informaci´ on b´ asica con la que se trabaja son los modelos de predicci´ on oce´ anicos, que permiten tener en cuenta con varios d´ ıas de antelaci´ on el estado m´ as probable de la zona en la que se encuentre el glider. Dependiendo del tipo de misi´ on y la regi´ on que se est´ e considerando, existir´ an diferentes modelos disponibles. En general, los mejores resultados son los aquellos que se obtienen con modelos de predicci´ on regionales, especialmente ajustados para capturar las condiciones particulares de una determinada zona. En un esquema de pilotaje de gliders tradicional, un operador humano realiza un seguimiento del estado presente y futuro del mar y de la evoluci´ on del veh´ ıculo, decidiendo cu´ ando es necesario modificar los puntos de destino. En una misi´ on real, las propias medidas del glider se convierten en un indicio de si las predicciones de los modelos oce´ anicos se est´ an verificando o no. La Figura 1.2 ilustra la trayectoria final del glider RU27 tras finalizar la misi´ on trans-Atl´ antica. ´ Esta se llevo a cabo mediante un pilotaje manual o tradicional. No obstante, durante los ´ ultimos stints cerca de las costas espa˜ nolas, este pilotaje fue asistido por las herramientas de planificaci´ on de caminos para gliders desarrolladas en este trabajo de tesis. 1.4 Hip´ otesis de la tesis 3 Figura 1.2: Camino seguido por el glider RU27 Scarlet Knight (SLOCUM) en la misi´ on trans-Atl´ antica, realizada en 2010. La missi´ on fue dirigida por la Universidad de Rutgers, con la colaboraci´ on de la Divisi´ on de Rob´ otica y Oceanograf´ ıa Computacional (DROC), SIANI. 1.4 Hip´otesis de la tesis En este trabajo se plantea como hip´ otesis el que pueden definirse mecanismos autom´ aticos para la planificaci´ on de rutas en gliders que aporten ventajas significativas en el uso de estos dispositivos como instrumentos de muestreo del oc´ eano. 1.5 Objetivos Los objetivos de esta tesis se resumen en las siguientes cuestiones que trata de resolver. Asimismo, definen el ´ ambito y extensi´ on del presente trabajo. •La literatura sobre planificaciones de caminos recoge un importante n´ umero de algoritmos usados para obtener la secuencia (cuasi-)´ optima de configuraciones de estado que permita a un veh´ ıculo moverse desde una posici´ on a otra. Es por tanto de gran inter´ es estudiar si estos algoritmos son aplicable en el campo de la planificaci´ on de rutas para gliders. De hecho, en esta tesis analizamos si el m´ etodo A* es aplicable. Si puede ser adapta al problema con gliders, o si hay alguna particularidad que lo impide, o hace que resulte ineficiente. •Veremos como las t´ ecnicas cl´ asicas no son directamente aplicables a nuestro problema, a menos que sea adaptadas. En este sentido trataremos de analizar cu´ ales son las particularidades de la planificaci´ on de caminos con gliders que justifican la necesidad de esta adaptaci´ on. As´ ı, obtendremos conocimiento sobre las siguientes cuestiones: –Cu´ ales son las diferencias respecto a otros problemas que se solucionan empleando planificadores de caminos cl´ asicos? Nos referimos a problemas como la planificaci´ on de caminos en laberintos, mapas de coste, etc. –Qu´ e razones explican por qu´ e las t´ ecnicas cl´ asicas no son aplicables o ´ utiles en este caso? O que impide que puedan manejar eficientemente el problema? •El estudio de la bibliograf´ ıa y el estado del arte nos permitir´ a categorizar la tipolog´ ıa del problema que intentamos resolver. Es decir, en qu´ e categor´ ıa taxon´ omica ubican el problema otros autores, o al menos establecer el tipo de problema m´ as similar. 4 1 Introducci´ on •Desde un punto de vista m´ as pr´ actico, pretendemos investigar y desarrollar m´ etodos que resuelvan el problema. En este trabajo implementamos varios t´ ecnicas novedosas. ´ Estas son evaluadas conforme a dos criterios. Primero, evaluamos la optimalidad de la soluci´ on encontrada o lo lejos que queda del ´ optimo. Segundo, el tiempo de c´ omputo y uso de memoria. •De esta forma, podremos comparar nuestros resultados con otras aproximaciones de la literatura sobre el tema. As´ ı podremos establecer c´ omo atacan el problema otros autores, as´ ı como las simplificaciones y los supuestos que ´ estos asumen. Consecuentemente, podremos valorar si ´ estos y nuestros algoritmos son escalables y generalizables para resolver otro tipo de problemas de planificaci´ on de rutas. •Respecto a la dimensionalidad del problema, veremos que los modelos oce´ anicos ofrecen 4dimensiones: espacio tridimensional y tiempo. Los gliders navegan por este espacio tridimensional que cambia significativamente en el tiempo. Asimismo, es posible considerar o despreciar ciertas caracter´ ısticas de la din´ amica del veh´ ıculo y su navegaci´ on, como el ´ angulo de planeo, las profundidades m´ ınima y m´ axima de los perfiles yo-yo, la velocidad nominal, etc. La forma en que manejar toda esta complejidad y la alta dimensionalidad del problema eficientemente, es tambi´ en un aspecto fundamental que se trata en el presente trabajo. Igualmente, queremos ver si es posible garantizar la optimalidad de la soluci´ on encontrada, o simplemente hasta cierto punto y bajo ciertas suposiciones. •A partir de la implementaci´ on y evaluaci´ on de deferentes t´ ecnicas obtendremos cierta intuici´ on respecto a cu´ ales son m´ as apropiadas para determinadas condiciones y entornos. Por ello, tambi´ en se realiza una categorizaci´ on de escenarios: ´ areas con obst´ aculos, zonas de alta variabilidad temporal, corrientes fuertes, etc. Las cuestiones anteriores definen el ´ ambito y los objetivos de la tesis, puesto que ´ esta trata de darles respuesta. Adicionalmente, para poder tratar con la complejidad del problema, se han asumido ciertas simplificaciones y marcado algunas limitaciones. •La alta dimensionalidad del problema se ha reducido hasta cierto punto. Asumimos un modelo de movimiento del glider simplificado. En algunos casos la planificaci´ on de rutas se hace considerando s´ olo las corrientes bidimensionales en superficie, con una resoluci´ on temporal de horas; mientras que en otros casos tomamos corrientes tridimensionales, aunque como medias diarias. Esta reducci´ on en la dimensionalidad del problema es habitualmente aceptable, al mismo tiempo que reduce la complejidad sustancialmente. •Algunos detalles de las misiones y el pilotaje de gliders son despreciados. En muchos casos no es posible observar fen´ omenos como el biofouling, que afecta a la velocidad y equilibrado del glider. Esto produce un cambio en el ´ angulo de planeo y puede producir una desviaci´ on sistem´ atica en el rumbo. Del mismo modo, var´ ıa el centro de masas y la flotabilidad, reduci´ endose la velocidad del veh´ ıculo. En otros casos, s´ olo podemos estimar ciertos par´ ametros con un determinado error, como el tiempo que permanece el veh´ ıculo en superficie. Estos valores no se suelen modelar porque en realidad nos interesan otros aspectos del sistemas y podemos ignorar sus efectos en la mayor´ ıa de casos. •El sistema embebido y el software en los gliders modernos tiene capacidades muy reducidas. Por ello en la pr´ actica el pilotaje autom´ atico o aut´ onomo no es trivial. Aunque no se trata estrictamente de una limitaci´ on, hemos recogido este hecho en nuestra simulaciones. Puesto que la calidad del dead-reckoning es mala, las comunicaciones no son posibles, y la deriva producida por las corrientes no es observable bajo el agua, se requiere una planificaci´ on de rutas con comandos discretos espaciados significativamente en el tiempo. Incluso si fuera posible variar el rumbo del veh´ ıculo con mayor frecuencia, el veh´ ıculo a´ un no podr´ ıa disponer de los mapas de corriente abordo para actualizar el rumbo convenientemente. Cap´ıtulo 2 Problemas y Aplicaciones En un primer nivel de problemas b´ asicos est´ a la optimizaci´ on de rutas, que puede verse como un recurso capacitante para abordar otras aplicaciones m´ as complejas. En un segundo nivel se consideran la evitaci´ on de obst´ aculos, el seguimiento de trayectorias, la planificaci´ on multi-glider o el muestreo de estructuras oce´ anicas m´ oviles. 2.1 Optimizaci´on de Rutas 2.1.1 Camino de M´ınimo Tiempo El problema del camino de m´ ınimo tiempo consiste en la minimizaci´ on del tiempo requerido por un glider para llegar a un destino determinado. La principal dificultad de este planteamiento reside en tratar de abordar su resoluci´ on reflejando de la forma m´ as fiel posible el funcionamiento de un glider real. xgoal x1x2 xn−1 x0 t=f(B) m´ın Bf(B) : |B| >1 Figura 2.1: Diagrama del problema del camino de m´ ınimo tiempo. Buscamos el camino P—formado por un conjunto de direcciones (bearings)B— que minimice el tiempo viajado tt=f(B)para ir desde la localizaci´ on inicial x0a la de destino xgoal. El n´ umero de direcciones |B| no es fijo, puesto que ´ este realmente determina el tiempo viajado. El destino xgoal se considera alcanzado con el punto final xn−1cae en un radio alrededor suyo. La Figura 2.1 ilustra este problema, en el que se busca el camino ´ optimo desde el waypoint inicial x0al 5 6 2 Problemas y Aplicaciones de destino xgoal. En este problema, utilizando un esquema de optimizaci´ on no es posible resolverlo de manera directa ya que se desconoce a priori el n´ umero de variables implicadas, i.e. el n´ umero de direcciones |B| que forma el camino. La resoluci´ on pasa, por tanto, por implementar un esquema iterativo. 2.1.2 Camino de M´ınima Distancia Restante al Destino El problema del camino de m´ ınima distancia restante al destino consiste en tratar de acercarse lo m´ as posible a un punto de destino en un tiempo determinado. El planteamiento es bastante directo cuando se aborda con t´ ecnicas de optimizaci´ on, puesto que se pueden considerar los rumbos a comandar como las variables del proceso de optimizaci´ on. Adem´ as, la resoluci´ on es directa, puesto que el n´ umero de direcciones |B| es conocido de antemano. d=kxgoal −xn−1k xgoal x1x2xn−1 x0 m´ın Bkxgoal −xn−1k:|B| =n Figura 2.2: Diagrama del problema de m´ ınima distanca al destino. Buscamos el camino Pdefino por un conjunto de ndirecciones Bque minimicen la distancia d=kxgoal −xn−1kdesde el punto final xn−1hasta el destino xgoal. En este problema el n´ umero de direcciones |B| =nes fijo y conocido por anticipado. La Figura 2.2 ilustra este problema, donde partimos de x0y llegamos hasta la localizaci´ on final xn−1tras comandar |B| =ndirecciones, que forman el camino a buscar, para una duraci´ on de tiempo fija y dependiente de nseg´ un el tiempo entre emersiones ts. La optimizaci´ on minimiza la distancia restante d. 2.2 Evitaci´on de Obst´aculos Una de las principales limitaciones de los gliders es su reducida velocidad y maniobrabilidad. Esto hace que determinadas trayectorias deban de ser cuidadosamente planteadas si se quiere llegar a una soluci´ on v´ alida. Ejemplos de esos escenarios son la presencia de obst´ aculos en las inmediaciones de la ruta a planificar. Dichos obst´ aculos pueden materializarse de diferente forma, incluyendo obst´ aculos fijos como islas, costa, aguas someras, puertos, etc.; m´ oviles como barcos; o restricciones del tipo corrientes de intensidad similar o superior a la velocidad de avance del glider. 2.3 Seguimiento de Trayectorias Otro conjunto de problemas de inter´ es son aquellos en los que se requiere que el veh´ ıculo siga una ruta predefinida de la forma m´ as ajustada posible. Los procesos de optimizaci´ on en este caso requieren una 2.4 Planificaci´ on Multi-glider 7 verificaci´ on m´ as estricta, puesto que debe tratar de garantizarse un comportamiento adecuado tanto en los puntos de emersi´ on como a lo largo de los stints. P=f(B) x1 x2 xk Pd A1A2 A2Ak AkAgoal x0 xgoal m´ın BP|B| i=1 Ai(f(B),Pd) Figura 2.3: Diagrama del problema de seguimiento de trayectorias. Buscamos el camino Pdefino por un conjunto de direcciones Bque minimice la desviaci´ on respecto al camino deseado Pd. Tal desviaci´ on puede medirse como una distancia do una funci´ on del ´ area encerrada A. Este problema de seguimiento de trayectorias se resuelve como una restricci´ on sobre el problema del camino de m´ ınimo tiempo, que permite alcanzar el waypoint de destino xgoal. Para determinar la separaci´ on o desviaci´ on respecto a la trayectoria deseada se pueden aplicar diversas f´ ormulas para su c´ alculo. En principio, se trata del c´ omputo del ´ area de un trapezoide recta entre el camino deseado y el resultante, computada para cada pareja de puntos de emersi´ on consecutivos, tal y como muestra la Figura 2.3. 2.3.1 Relajaci´on de la restricci´on de seguimiento En la mayor´ ıa de estas aplicaciones, la falta de flexibilidad en la trayectoria se traduce en un pero aprovechamiento de las corrientes por parte del glider. Una ligera relajaci´ on de las condiciones, por ejemplo, se traduce en una ruta m´ as adecuada en t´ erminos del tiempo invertido. Se puede definir un pasillo alrededor del camino deseado. De esta forma es posible relajar a medida la restricci´ on de seguimiento de la trayectoria. De hecho, las soluciones que se obtienen para que pasillo de mayor tama˜ no definen una curva de Pareto de soluciones no dominadas, para el objetivo de seguimiento de trayectorias y del camino de m´ ınimo tiempo entre los extremos del camino deseado. 2.4 Planificaci´on Multi-glider Con frecuencia nos encontramos escenarios en los que varios robots deben cooperar para resolver una determinada tarea. Surgen entonces problemas que no pueden tratarse de forma independiente para cada veh´ ıculo. Ejemplos de este tipo de aplicaciones son el muestreo en formaci´ on o la coordinaci´ on para facilitar las tareas de recuperaci´ on de los gliders tras finalizar una misi´ on conjunta. Otra problema multi-glider, con una aplicaci´ on clara en misiones con m´ ultiples veh´ ıculos, es el de la recogida eficiente de los mismos. Un barco debe recoger la flota formada por kveh´ ıculos en el menor tiempo posible, puesto que con ello se reduce el coste econ´ omico de la recogida —al reducir el gasto de combustible. 14 3 Planificaci´ on de Rutas identificaci´ on y seguimiento de dichas estructuras, como veremos a continuaci´ on. 3.3.1 An´alisis de Estabilidad El an´ alisis de estabilidad del campo vectorial de corrientes oce´ anicas permite determinar qu´ e zonas son estables y cu´ ales inestables, utilizando tanto corrientes est´ aticas como din´ amicas. Para ello computamos el campo FTLE con la siguiente expresi´ on, σT t0(x) = 1 |T|ln pλm´ax(∆) (3.5) que representa el FTLE m´ as grande para un tiempo de integraci´ on finito T, asociado al punto xy el instante de tiempo t0. Figura 3.4: An´ alisis de Estabilidad computando el campo FTLE de un v´ ortice Stuart. Las regiones inestables se corresponden con LCSs, las cuales aparecen en tonos rojos en los bordes de los giros/v´ ortices. El resultado del FTLE puede verse en la Figura 3.4 para un v´ ortice Stuart, generado sint´ eticamente. Podemos observar claramente como las zonas del borde de los giros son altamente inestables. Este informaci´ on no es f´ acil de apreciar directamente sobre el campo de corrientes, especialmente si es din´ amico, como en este caso. De ah´ ı surge la utilidad de computar el campo FTLE. A partir de este campo, es posible segmentar las zonas inestables y as´ ı obtener Estructuras Coherentes Lagrangianas (LCSs). As´ ı, es posible planificar rutas evitando estas zonas, puesto que su inestabilidad indica que el siguiente punto de emersi´ on puede variar bastante del esperado, es decir, aumentar su incertidumbre. 3.3.2 Giros Oce´anicos Otro tipo de estructuras muy comunes en el oc´ eanos son los giros. Nos encontramos giros de distintas escalas espaciales y temporales. As´ ı, los giros mesoescalares son interesantes para el estudio de m´ ultiples procesos oce´ anicos. Se ha realizado un modelado tridimensional de un giro mesoescalar en sectores. Este modelo se puede incorporar a un Algoritmo Gen´ etico para realizar el seguimiento de la estructura, tras su identificaci´ on. Se ha desarrollado una t´ ecnica para dar los primeros pasos en el muestreo de estas estructuras m´ oviles, optimizando la estrategia de muestreo de una determinada zona del giro —v.g. centroide, borde, etc.—, as´ ı como su caracterizaci´ on, lo cual tiene especial utilidad en la asimilaci´ on de datos por parte de modelos oce´ anicos. Cap´ıtulo 4 Resultados Experimentales 4.1 Camino de M´ınimo Tiempo Para el camino de m´ ınimo tiempo hemos probado los algoritmos DtG, RRT, A*, CTS-A* con M= 18 muestras, y Optimizaci´ on Iterativa. Se han lanzado 20 casos de test que muestran como el DtG y RRT no son capaces de encontrar ninguna soluci´ on en algunos casos. Por contra, el A*, CTS-A* y el m´ etodo de Optimizaci´ on Iterativa, siempre encuentra soluci´ on, siendo la de ´ este ´ ultimo ligeramente mejor que los m´ etodos basados en grafos. 4.2 Camino de M´ınima Distancia Restante al Destino Para el camino de m´ ınima distancia restante al destino hemos probado los algoritmos DtG, A*, CTS-A* con M= 18 muestras, y Optimizaci´ on; no se prueba el algoritmo RRT porque manejamos corrientes din´ amicas. Figura 4.1: Captura de un caso de test para 4d´ ıas; la ´ ultima predicci´ on se repite para rellenar las no disponibles. La figura muestra el camino sobre las corrientes oce´ anicas (las corrientes que exceden la velocidad del glider Ug= 0,4m/sest´ an resaltadas ) desde el waypoint inicial al de destino . La distancia desde el waypoint inicial al de destino es 344,6km. La distancia restante para alcanzar el destino es, para cada algoritmo: Optimizaci´ on = 68,9km; CTS-A* = 85,1km; A* = 169,4km; DtG = 217,6km. Se han lanzado 65 casos de test, divididos en corrientes d´ ebiles y fuertes. La mejora respecto al DtG, que se muestra en el Cuadro 5.2, es claramente mayor con corrientes fuertes. Asimismo, el algoritmo de Optimizaci´ on es el que deja al veh´ ıculo m´ as cerca del destino, despu´ es del tiempo de misi´ on Tdado. 15 16 4 Resultados Experimentales 4.3 Evitaci´on de Obst´aculos Para la evitaci´ on de obst´ aculos se han seleccionado escenarios extra´ ıdos del mar de Canarias, donde la presencia de las islas permite definir configuraciones complejas de resolver para la planificaci´ on. Se han analizado los algoritmos tanto para misiones largas con corrientes est´ aticas, como misiones cortas con corrientes din´ amicas. Esto es equivalente a decir que se ha probado la evitaci´ on de obst´ aculos para el problema del camino de m´ ınimo tiempo y el de m´ ınima distancia restante al destino, respectivamente. (a) Caso I. (b) Caso II. Figura 4.2: Comparativa del problema de M´ ınima Distancia Restante al Destino para el problema de Evitaci´ on de Obst´ aculos. Comparativa de 2casos de test realizados Ug= 0,4m/s. La distancia restante al waypoint de destino is (SL si Stop in Land): (a) Optimizaci´ on-CTS-A* = 13,3km, Optimizaci´ on = 22,1km, CTS- A* = 20,6km, A* = 25,9km, DtG = 157,1km (SL); (b) Optimizaci´ on-CTS-A* = 0,0km, Optimizaci´ on = 69,7km (SL), CTS-A* = 3,2km, A* = 8,7km, DtG = 80,0km (SL); Respectivamente, la distancia total desde el waypoint inicial al de destino es: 176,5km,125,8km. Los resultados se han separado para zonas de costa y offshore, comparando cada t´ ecnica con la del m´ etodo Optimizaci´ on-CTS-A*, que aplica el m´ etodo de inicializaci´ on inteligente utilizando una versi´ on gruesa del algoritmo CTS-A*, tal y como se explica en la Secci´ on 4.3.5.2. Observamos como lejos de costa el resultado sin esta fase de inicializaci´ on es equivalente a la usada en el m´ etodo de Optimizaci´ on, lo cual indica su validez en todos los escenarios. En zonas costeras, esta inicializaci´ on mejora cerca de 20km la soluci´ on del m´ etodo de Optimizaci´ on. Adem´ as, se consiguen resultados en torno a ≈5km mejores que con las t´ ecnicas basadas en grafos. M´ as lejos a´ un queda la aproximaci´ on DtG. En la Figura 4.2 se muestran 4casos de evitaci´ on de obst´ aculos cerca de islas. Podemos observar como en algunos casos de test la mayor´ ıa de t´ ecnicas quedan atrapadas; n´ otese que las t´ ecnicas basadas en grafos pueden verse atrapadas debido las corrientes en torno a determinadas zonas. 4.4 Seguimiento de Trayectorias En el caso del seguimiento de trayectorias se ha comprobado la capacidad de las soluciones propuestas para mantener la ruta del glider sobre la ruta deseada. Tambi´ en se ha comprobado la mejora en el rendimiento que se consigue relajando ligeramente las condiciones del seguimiento. Con la relajaci´ on de la condici´ on de seguimiento de la trayectoria obtenemos varias soluciones, que definen una curva de Pareto. La curva de Pareto muestra los dos objetivos contrapuestos uno frente al otro, i.e. el tiempo viajado (eje y) frente al promedio de la distancia al camino deseado (eje x) —que es la l´ ınea recta en 4.5 Planificaci´ on Multi-glider 17 este ejemplo. Todos los caminos intentan mantener el veh´ ıculo cerca de la l´ ınea recta, pero esta restricci´ on se relaja en cada simulaci´ on incrementando el tama˜ no del pasillo alrededor de la l´ ınea. Como muestra la figura, mientras m´ as estrecho es el pasillo, mayor es el tiempo viajado. Mientras tanto, al agrandarse el pasillo, nos aproximamos al camino de m´ ınimo tiempo de la optimizaci´ on sin restricciones. Figura 4.3: Ensamblaje de problema de seguimiento de trayectorias para realizar una misi´ on de muestreo y caracterizaci´ on de un giro mesoescalar. La trayectoria de molino se descompone en l´ ıneas rectas que cruzan el giro m´ ultiples veces desde diferentes direcciones, para las cuales se resuelve el problema de seguimiento de trayectorias usando el m´ etodo de Optimizaci´ on Iterativa. Se muestran las direcciones del glider en cada punto de emersi´ on, junto con las corrientes oce´ anicas desde el waypoint inicial al de destino . Finalmente, es posible concatenar m´ ultiples problemas de seguimiento de trayectorias, como muestra el patr´ on en forma de molino de la Figura 4.3. ´ Este est´ a compuesto por m´ ultiples trayectorias en forma de l´ ıneas rectas que deben ser seguidas. As´ ı, con la soluci´ on a este problema se pueden realizar aplicaciones de muestreo de giros siguiendo, por ejemplo, este patr´ on de molino. 4.5 Planificaci´on Multi-glider Para la planificaci´ on multi-glider se han seleccionado escenarios en los que los gliders deb´ ıan mantener una posici´ on relativa fija con respecto a un veh´ ıculo l´ ıder. Tambi´ en se han planteado problemas de optimizaci´ on del tiempo de recuperaci´ on de m´ ultiples unidades desplegadas. Para la recuperaci´ on de m´ ultiples gliders tras una misi´ on, planteamos el problema de su recogida eficiente con un barco. Este problema requiere la planificaci´ on coordinada de los caminos de todos los gliders de la flota, para as´ ı reducir el tiempo de recogida y, por consiguiente, el gasto econ´ omico de la mismo, atendiendo al combustible consumido por el barco. En la Figura 4.4 se muestran varias soluciones para el problema de recogida eficiente utilizando el m´ etodo de Optimizaci´ on. Se busca la recogida de m´ ınimo tiempo, a la vez que se intenta resolver el problema de m´ ınima distancia restante al destino para un per´ ıodo de 4d´ ıas. Los gliders viajan a Ug= 1km/h, con un tiempo entre emersiones de ts= 8h. En (a), tenemos las soluci´ on con planificaci´ on de caminos individual. Por el contrario, las otras dos figuras muestran los resultados usando planificaci´ on de caminos multi-glider. En (b), todos los gliders intentan encontrarse en un punto para la recogida. Finalmente, en (c), el camino del barco se incluye en el proceso de optimizaci´ on. Esta ´ ultima aproximaci´ on es la que da mejores resultados. 18 4 Resultados Experimentales (a) Individual. (b) Encontrarse juntos. (c) Camino del barco. Figura 4.4: Planificaci´ on de caminos multi-glider y coordinaci´ on para una flota de 5gliders que tienen que ser recuperados del mar por un barco en el m´ ınimo tiempo. El barco tiene que viajar: (a) 192,0km; (b) 167,5km; (c) 165,4km, respectivamente. 4.6 Seguimiento y Muestreo de Estructuras Oce´anicas M´oviles Finalmente, hemos realizado algunos simulaciones preliminares de la t´ ecnica comentada en la Secci´ on 4.4.2, para realizar el seguimiento y muestreo de estructuras oce´ anicas m´ oviles. Concretamente, hemos modelado giros mesoescalares e intentamos seguirlos al mismo tiempo que se muestran determinadas zonas de inter´ es de los mismos. Figura 4.5: Ejemplo en el que el contorno de un giro mesoescalar se sigue usando nuestra aproximaci´ on con un Algoritmo Gen´ etico y el modelo discreto del giro. La Figura 4.5 muestra una captura de las corrientes oce´ anicas y la trayectoria optimizada al final de la misi´ on; n´ otese que el giro mueve mientras se muestrea. En este ejemplo se intenta muestrear de manera ´ optima un regi´ on situada en el borde del giro. Cap´ıtulo 5 Conclusiones En esta tesis se ha abordado el estudio del problema de la planificaci´ on autom´ atica de rutas para gliders a partir de modelos de predicci´ on num´ erica. Se ha demostrado que es posible mejorar las capacidades operativas de estos veh´ ıculos introduciendo herramientas de asistencia al pilotaje. 5.1 Aportaciones Originales Como principales aportaciones conviene destacar el conjunto de algoritmos de planificaci´ on desarrollados. Las herramientas complementarias generadas constituyen asimismo aportaciones v´ alidas que facilitan el trabajo en este ´ ambito de manera importante. Adem´ as de lo anterior, en la tesis se han realizado diferentes an´ alisis cuyas conclusiones pueden considerarse contribuciones en s´ ı mismas, como es el caso de la revisi´ on bibliogr´ afica comentada, los estudios sobre las alternativas de modelado o el an´ alisis de aplicabilidad de las t´ ecnicas de optimizaci´ on. De hecho, tras el an´ alisis bibliogr´ afico hemos visto que el problema del camino de m´ ınimo tiempo no es com´ un en la rob´ otica de veh´ ıculos m´ oviles terrestres, donde el problema de planificaci´ on de caminos m´ as com´ un es el del camino m´ as corto. La principal diferencia radica en el hecho de que en el camino de m´ ınima tiempo no s´ olo afecta la distancia entre origen y destino, sino tambi´ en la velocidad del veh´ ıculo, que en el caso de la planificaci´ on de rutas para gliders se ve afectada por las corrientes Uc. El algoritmo A* se usa ampliamente para el problema del camino m´ as corto. Varios autores lo han adaptado al problema del camino de m´ ınimo tiempo para gliders (Garau et al., 2005, 2009; Soulignac, 2010). B´ asicamente, se incorpora el modelo de movimiento restringido, para encontrar el camino ´ optimo dentro de la rejilla del grafo de b´ usqueda del algoritmo. La discretizaci´ on de la rejilla obliga a usar el modelo de movimiento restringido, el cual en presencia de corrientes puede llevar a caminos donde no se puede expandir ning´ un nodo. Adem´ as, el tiempo entre un nodo y su vecino no es constante ni igual al tiempo entre emersiones ts, no reflejando as´ ı la forma en que navega un glider. Igualmente, tampoco se integra la trayectoria del perfil yo-yo. El an´ alisis de estas limitaciones es una primera contribuci´ on de este trabajo de tesis. El estudio de la literatura de planificaci´ on de caminos para gliders, as´ ı como la de problemas de planificaci´ on de caminos con costes variables y asim´ etricos, muestra pocas contribuciones en este ´ area. Los problemas m´ as similares —i.e. que manejan costes asim´ etricos variables— son: el Problema del Viajante Canadiense (CTP), rutas de tr´ aficos din´ amicas, y mapas de coste o planificaci´ on con costes. En teor´ ıa de grafos, el CTP es una generalizaci´ on del problema del camino m´ as corte a grafos parcialmente observables, i.e. el grafo se obtiene mientras es explorado (Papadimitriou, 1991). El concepto de observabilidad parcial cubre los costes variables del problema del camino de m´ ınimo tiempo para gliders. De manera similar, en los problemas de rutas de tr´ afico din´ amicas, la densidad de veh´ ıculos produce costes variables para viajar dentro de la red de rutas. Esto es equivalente a los mapas de coste, que habitualmente se asocian a la planificaci´ on 19 20 5 Conclusiones de caminos basada en relieve. De hecho, podr´ ıamos construir un mapa de coste a partir del campo vectorial de corrientes oce´ anicas, pero esto ser´ ıa equivalente a aplicar el modelo de movimiento restringido usado por el A*. Aunque, en nuestra humilde opini´ on, esta es la categor´ ıa en que se ubican los problemas de planificaci´ on de caminos, en realidad no representan la navegaci´ on del glider ni ciertas caracter´ ısticas de su funcionamiento con facilidad. M´ as concretamente, estos problemas no incluyen la restricci´ on de emersiones de tiempo constante. Antes que un an´ alisis te´ orico del problema y los algoritmos de planificaci´ on de caminos, este trabajo adopta un enfoque pragm´ atico con el estudio de m´ etodos aplicables a la planificaci´ on de rutas para gliders. Hemos adaptado m´ etodos cl´ asicos basados en grafos como el A*, y t´ ecnicas de muestreo probabil´ ıstico como el RRT, siguiendo trabajos previos de Rao and Williams (2009). Debido a las limitaciones del A* y el RRT, hemos desarrollado varias t´ ecnicas novedosas para eliviar sus defectos. Aplicamos el modelo de movimiento no restringido y reflejamos la restricci´ on de emersiones separadas un tiempo constante. Hacemos estos tanto para el algoritmo CTS-A* como para las diferentes variantes de los m´ etodos de optimizaci´ on descritos en la tesis. Hemos realizados varios experimentos para evaluar la validez, optimalidad y tiempo de c´ omputo. Para casi todos los casos de test, los mejores caminos son encontrados con los m´ etodos de optimizaci´ on, que adem´ as es el m´ as r´ apido. El CTS-A* tambi´ en encuentra caminos muy cerca del ´ optimo, aunque con algo m´ as de tiempo de c´ omputo. Con la estrategia de muestra ABS se reduce su tiempo de c´ omputo, puesto que permite reducir el n´ umero de muestras para las direcciones que se integran desde cada nodo. Adem´ as, un versi´ on gruesa del CTS-A* se usa en la fase de inicializaci´ on de los m´ etodos de optimizaci´ on para evitar obst´ aculos en entornos costeros. Los resultados experimentales tambi´ en muestran que la t´ ecnica de optimizaci´ on es f´ acil de adaptar a un buen n´ umero de problemas de planificaci´ on de caminos para gliders. Esto incluye el seguimiento de trayectorias, las planificaci´ on multi-glider y el seguimiento de estructuras oce´ anicas m´ oviles. Sin embargo, las ventajas de nuestro esquema de optimizaci´ on residen en las particularidades de los gliders. Por ello, tales beneficios se perder´ ıan si se aplica a la planificaci´ on de rutas con otro tipo de veh´ ıculo. Es en las emersiones separadas un tiempo constante donde encontramos la raz´ on de esta falta de generalizaci´ on. La optimizaci´ on se realiza en el espacio de direcciones, en lugar de en el espacio de localizaciones. En consecuencia, gracias los tramos entre emersi´ on de ts≈8h, la dimensionalidad del problema de optimizaci´ on se reduce dr´ asticamente, lo cual ayuda a obtener tiempos de c´ omputo bajos. Claramente, si us´ asemos veh´ ıculos con una tasa de control —i.e. con un tiempo tsmenos—, el n´ umero de direcciones |B| aumentar´ ıa, perdiendo esta ventaja. En el caso de aproximaciones como los m´ etodos basados en grafos, ´ estos tienen que manejar la gran dimensionalidad del problema, definido en 4dimensiones en el caso m´ as general —i.e. 3dimensiones espaciales y tiempo. Adem´ as, varias direcciones ψgdeben considerarse al generar los sucesores cuando se expande un nuevo nodo en la rejilla de b´ usqueda. Como resultado, el tiempo de c´ omputo es grande en estas aproximaciones. Hemos usado modelos de movimiento puntuales en nuestros algoritmos de planificaci´ on de caminos, puesto que resulta una elecci´ on razonable, dada la incertidumbre de los modelos oce´ anicos y la localizaci´ on de los gliders. Adem´ as, nos consideramos cambios de cabeceo θo l´ ımites de profundidad [zm´ın, zm´ax], puesto que generalmente no se modifican en la pr´ actica. En algunos casos simulamos la deriva del glider mientras espera en superficie, pero normalmente s´ olo cuando el resultado se usa posteriormente para asistir en el pilotaje de gliders en misiones reales. En cualquier caso, tambi´ en hemos evaluado un modelo cinem´ atico de equilibrio de fuerzas y comparado sus resultados con los puntos de emersi´ on del glider RU27 en la misi´ on trans-Atl´ antica. Como ya se ha mencionado, la precisi´ on de estos modelos no se requiere para la planificaci´ on de rutas con gliders, aumentar´ ıan el tiempo de c´ omputo del planificador sin ning´ un beneficio tangible, y requieren un mayor n´ umero de par´ ametros —muchos de ellos dif´ ıciles de cuantificar. Finalmente, hemos avanzado en los primeros pasos en el muestreo de estructuras oce´ anicas m´ oviles. En particular, hemos desarrollado una t´ ecnica para seguir giros mesoescalares y mejorar la estrategia de muestreo (v´ ease la Secci´ on 4.4.2). Este problema tiene enorme inter´ es en la asimilaci´ on de datos, y su uso para mejorar el modelado de estas estructuras en los modelos oce´ anicos.