remote sensing

Article An Underwater Pathfinding Algorithm for Optimised Planning of Survey Dives

Marino Mangeruga 1,2 , Alessandro Casavola 1 , Francesco Pupo 1 and Fabio Bruno 1,2,* 1 University of Calabria, Via P.Bucci, 87036 Arcavacata di Rende, CS, Italy; [email protected] (M.M.); [email protected] (A.C.); [email protected] (F.P.) 2 3D Research s.r.l. Via P.Bucci, 87036 Arcavacata di Rende, CS, Italy * Correspondence: [email protected]; Tel.: +39-32-0425-8033

 Received: 4 November 2020; Accepted: 2 December 2020; Published: 4 December 2020 

Abstract: In scientific and , the survey of unknown or partially unexplored areas is a common task that requires an accurate planning for ensuring the optimal use of resources and the divers’ safety. In particular, in any kind of diving activity, it is essential to foresee the “dive profile” that represents ’s exposure to over time, ensuring that the dive plan complies with the specific safety rules that have to be applied in accordance with the diver’s qualification and the environmental conditions. This paper presents a novel approach to dive planning based on an original underwater pathfinding algorithm that computes the best 3D path to follow during the dive in order to be able to maximise the number of points of interest (POIs) visited, while taking into account the safety limitations. The proposed approach, for the first time, considers the morphology of the 3D space in which the dive takes place to compute the best path, taking into account the limits and avoiding the obstacles through the analysis of a 3D map of the site. Moreover, three different cost functions are proposed and evaluated to identify the one that could suit the divers’ needs better.

Keywords: underwater surveying; 3D optimal pathfinding; dive planning; scientific diving

1. Introduction Underwater archaeologists, biologists, and even law enforcement agents are often committed to survey underwater sites for accomplishing a variety of missions that may include the search and recovery of lost items, visual census of benthic species, documentation of cultural assets, etc. Unfortunately, the is unfamiliar and hazardous for humans, so that specific procedures and rules have been defined to ensure the divers’ safety. Most of the safety procedures are intended to reduce the risk of , while others aim to reduce the risk of . In some contexts, getting lost is a serious , and specific procedures to minimise this kind of risk have to be followed. Dive planning is the process of planning the operations ahead, aiming to increase the probability that a dive will be safely completed and the goals achieved [1]. The complexity and the details considered in dive planning may vary enormously, but some kind of planning is required for most underwater dives. The purpose of dive planning is to ensure that divers do not exceed their comfort zone and skill level or the safe capacity of their equipment. It includes scuba gas planning to ensure that the amount of gas loaded in the tank is sufficient to complete the diving safely, taking into account any reasonably foreseeable contingencies. During the ascent, the depressurisation leads the inert gases dissolved in the tissues to come out of the , eventually forming bubbles inside the body if the ascent is too fast. This could lead to a condition known as decompression sickness. The risk to contract this disease can be effectively managed through proper decompression procedures, and, therefore, its prevalence has been greatly reduced.

Remote Sens. 2020, 12, 3974; doi:10.3390/rs12233974 www.mdpi.com/journal/remotesensing Remote Sens. 2020, 12, 3974 2 of 17

Given its potential severity, much research has been dedicated to its prevention, and divers almost universally use dive tables or dive computers to limit their exposure and control their ascent speed. The activities planned ahead by the diver could require more time than expected. In such a case, a diver could experience difficulties, or at least spend some time, to accurately evaluate during the diving if he/she has enough time to reach all the planned points of interest (POIs). To conduct such an evaluation, he/she should be able to evaluate the distance between all the POIs and the time needed to reach and explore them, taking into account the air still available in the scuba tank and the decompression stops needed at the end of the dive. It would be necessary to employ a system able to calculate the best available path that enables the diver to visit the greatest number of POIs, taking into account all the constraints imposed by the underwater environment. At present, dive computers provide information about the diving and calculate the decompression stops, but they are not capable of performing advanced evaluations as the ones described before. Many different tools are available for planning a future dive. MultiDeco [2] is a decompression program for PC, Mac, Android, iPad, and iPhone. It uses the varying permeability model (VPM-B) and the Bühlmann model (ZHL-16) for computing the decompression profiles. It provides different settings that allow for customising deep and safety stops, stop times, and air breaks. Subsurface [3] is an open-source dive-log program for recreational, tech, and free divers that runs on Windows, Mac, and Linux Subsurface. It can plan and track single-tank and multi-tank dives using air, , or . It supports a wide range of dive computers and can also import existing dive logs from several sources. Diveroid [4] consists of an underwater case equipped with a small and an app that turns the phone in an underwater camera, simultaneously showing the information on the dive, like pressure, no-decompression limit, and times. DecoTengu [5] is a Python dive decompression library that allows for various implementations of the Bühlmann decompression model with Erik Baker’s gradient factors. The results of the DecoTengu calculations are decompression stops and tissue saturation information that can be used by third-party applications for data analysis or dive planning. Artificial intelligence has investigated search methods for solving pathfinding and path-planning problems in large domains. Path planning is integral and crucial to various fields, including robotics and videogame design [6,7]. The classic problem of determining the shortest path in a cluttered environment has been one of the main objectives for many research efforts over the years. Dijkstra [8] proposed an algorithm to address the shortest path problem. Hart [9] used a heuristic function to estimate the cost of the path from a starting point to a given destination. The Dijkstra algorithm is combined with this heuristic function to form a new node-searching strategy known as the A* algorithm. The heuristic function can increase the efficiency of the Dijkstra algorithm by pruning the search space in maps. The A* algorithm uses heuristic knowledge in the form of approximations of the goal distances to focus the search and find the shortest paths for path-planning problems in a potentially faster way with respect to uninformed search methods. In our work, we propose an underwater pathfinding algorithm that computes the best path, avoiding the obstacles in the site (by analysing a 3D map of the site) and taking into account the limitations of decompression. To the best of our knowledge, approaches similar to ours do not yet exist in the literature. Currently, there are some works in which algorithms such as A* are applied in the search of paths for autonomous vehicles. For instance, in [10], path planning for unmanned surface vehicles (USVs) and an implementation of path planning in a real map are discussed. In particular, in this paper, satellite thermal images are converted into binary images and are used as the maps for the finite angle A* algorithm (FAA*). To plan a collision-free path, the algorithm considers the dimensions of surface vehicles and their turning ability. In [11], a 3D path planning of an autonomous underwater vehicle (AUV) is proposed by using the hierarchical deep Q network (HDQN) combined with the prioritised experience replay. In [12,13], reinforcement learning techniques are proposed in order to allow UAVs to navigate in unknown environments. Remote Sens. 2020, 12, 3974 3 of 17

In [14], path planning and the resulting control problems of autonomous underwater vehicles (AUV) in three dimensions (3D) are studied. For obstacle avoidance and path optimisation, a path-planning method based on particle swarm optimisation (PSO) and cubic spline interpolation is proposed. The control strategy discussed in this paper is compared with the line-of-sight (LOS) guidance through a simulation experiment. In [15], a study of the optimal three-dimensional headings of AUVs is presented, with the goal of reaching a given destination in the least amount of time from a known initial position. The authors employ the exact differential equations for time-optimal path planning and develop theoretical and numerical schemes to predict three-dimensional optimal paths for several classes of marine vehicles, taking into account their specific propulsion constraints. In [16], LPA*, an incremental version of A*, is proposed, combining ideas from the artificial intelligence and the algorithms literature. It repeatedly finds the shortest paths from a given start vertex to a given goal vertex, while the edge costs of a graph change or vertices are added or deleted. Its first search is the same as that of a version of A* that breaks ties in favour of vertices with smaller g-values, but many of the subsequent searches are potentially faster, because it reuses those parts of the previous search tree that are identical to the new one. The system described in [17] proposes the use of an omnidirectional ASV with the ability to follow the diver and act as a private satellite in order to increase diver’s safety and to enable monitoring from the surface. It is one of the few underwater systems of diving assistance, but it does not offer any kind of path planning to support the diver. The technical contribution of this work consists mainly in the development of a diver-tracking system composed of an autonomous surface marine vehicle and an underwater diver interface used for two-way communication between the diver and the surface vehicle. The present paper introduces a novel system that can support divers during their underwater surveying activities, computing the optimal path to follow in order to maximise the number of points of interest that can be reached and explored during the dive, while taking into account several safety factors. This work proposes, for the first time, to consider the 3D space in which the survey dive takes place in order to adapt the path planning to the obstacles in the environment. The system is based on a novel underwater pathfinding algorithm that computes the best path while taking into account the decompression limits and avoiding the obstacles by analysing a 3D map of the site. This original approach can be employed in two different scenarios: before the dive, when estimating a planning of the underwater activities and—an even more challenging scenario—during the dive, when the path needs to be adapted to unexpected situations and the time available for completing the dive. In the latter case, the system enables the diver to know constantly the best path that maximises the number of visited POIs and minimises the cost of the path. The latter, in an underwater environment, can be defined in different ways. This information can be provided to the diver through an underwater tablet, such as the one presented in [18–20], housed in a waterproof case and coupled with an acoustic localisation system. This tablet is provided with a dedicated app that enables the diver to access different features, such as the visualisation of a 3D map of the underwater site, the geo-position of the diver, a set of POIs, and a predefined path for the visit. The proposed system allows for extending the functionalities of the underwater tablet to provide an online optimal path planning while taking into account the conditions.

2. Materials and Methods The proposed pathfinding algorithm is composed of different stages, each addressing a different problem. The first step is a preprocessing stage—namely, the space partitioning, in which the 3D model of the underwater environment is analysed and represented in a way that is simpler to be processed by a search algorithm. Subsequently, the process of searching the best path to visit a set of points of interest can be divided into two phases. In the first phase, all the best paths between each couple of POIs are generated (links generation). In the second phase, the best sequence to visit the major number Remote Sens. 2020, 12, 3974 4 of 17

ofRemote POIs Sens. is defined, 2020, 12, aimingx FOR PEER to minimiseREVIEW the cost of the visit (path optimisation). In both phases,4 theof 18 cost of the underwater movements was assessed with different strategies, where each of them determines thethem choice determines of a diff erentthe choice best of path. a different In order best to path. take In into order account to take the into aspects account that the are aspects inherent that toare the underwaterinherent to environment, the underwater in thisenvironment, last phase, in the this search last phase, algorithm the search relies algorithm on an external relies on API an (application external programmingAPI (application interface)—namely, programming interface)—namely, the DecoAPI, which the recordsDecoAPI, the which history records of the the dive history and evaluates of the thedive actual and state evaluates of the diverthe actual parameters state of related the diver to the parameters dive. This related API was to developedthe dive. This separately API was from thedeveloped pathfinding separately algorithm, from and the itpathfinding implements algori the Bühlmannthm, and it modelimplements ZH-16LC the Bühlmann [21,22] extended model ZH- with a gradient16LC [21,22] factor extended [23] to track with and a gradient compute factor the decompression[23] to track and profilecompute of the the decompression diver. profile of theAll diver. stages of the pathfinding algorithm are represented in Figure1 and described in more detail in the followingAll stages sections. of the pathfinding algorithm are represented in Figure 1 and described in more detail in the following sections.

FigureFigure 1. 1.The The stages stages ofof thethe pathfindingpathfinding algori algorithmthm and and communication communication with with DecoAPI. DecoAPI. 2.1. Space Partitioning 2.1. Space Partitioning The space partitioning is the process of dividing a space into nonoverlapping regions so that any The space partitioning is the process of dividing a space into nonoverlapping regions so that any pointpoint in in the the space space can can be be associated associated withwith aa single sp specificecific region. region. Representing Representing a geometrical a geometrical space space in in suchsuch a waya way can can simplify simplify diff erentdifferent kinds kinds of geometry of geom queries,etry queries, e.g., determining e.g., determining whether whether a ray intersectsa ray anintersects object. Space an object. partitioning Space partitioning is often used is often in 2D used/3D in path 2D/3D planning. path planning. In this In case, this the case, adjacent the adjacent regions areregions connected are connected to each other to each by modellingother by modelling a graph, a so graph, the process so the process of searching of searching for the for shortest the shortest path can bepath performed can be performed by the means by the of algorithmsmeans of algorithms that operate that inoperate a graph. in a graph. ForFor this this purpose, purpose, itit isis veryvery usefuluseful to divide the the space space into into regions regions and and to tolabel label the the ones ones that that correspondcorrespond to to the the “water” “water” and and thethe onesones matchingmatching th thee “terrain”, “terrain”, with with the the aim aim of of discerning discerning between between thethe areas areas of of the the underwater underwater site site thatthat thethe diver can can pass pass through through and and the the obstacles obstacles he/she he/she has has to avoid. to avoid. InIn particular, particular, the the space space is is partitioned partitioned intointo voxels wi withth shapes shapes of of equal equal size size cubes cubes (namely, (namely, one one metre), metre), formingforming a a 3D 3D grid. grid. The The exact exact dimensiondimension of the vo voxelxel was was chosen chosen in in relation relation to tothe the approximate approximate dimensiondimension of of a a diver. diver. Indeed, Indeed, a a voxelvoxel notnot bigger than than the the diver diver is is enough enough to to represent represent the the underwater underwater environmentenvironment with with su sufficientfficient accuracy. accuracy. EvenEven though it it can can produce produce a abetter better approximation approximation of ofthe the 3D 3D map,map, a too-smalla too-small voxel voxel could could be be counterproductive. counterproductive. In In fact, fact, an an undersized undersized voxel voxel could could lead lead to to paths paths that gothat through go through narrow narrow passages passages where where the diver the diver should should not not and and could could not not dive dive through. through. Moreover, Moreover, it is worthit is worth noting noting that the that size the of size the voxelof the directlyvoxel directly affects affects the algorithm the algorithm performance, performance, because because the smaller the smaller the voxel, the larger the total number of voxels that composes the 3D grid, and the the voxel, the larger the total number of voxels that composes the 3D grid, and the computational cost computational cost of the search algorithm employed in phase 1 depends on the number of voxels of the search algorithm employed in phase 1 depends on the number of voxels involved in the search. involved in the search. 2.2. Phase 1 (Links Generation): Calculating Optimal Links between Pairs of POIs 2.2. Phase 1 (Links Generation): Calculating Optimal Links between Pairs of POIs In phase one, a graph was defined, where each node represents a “water” voxel of the 3D grid, i.e., In phase one, a graph was defined, where each node represents a “water” voxel of the 3D grid, a region that is accessible to the diver. Each voxel is connected to its neighbours, which are the adjacent i.e., a region that is accessible to the diver. Each voxel is connected to its neighbours, which are the voxels. The of the edges, connecting each node of the graph with its neighbours, depends on adjacent voxels. The weight of the edges, connecting each node of the graph with its neighbours, thedepends strategy on by the which strategy the by cost which of the the underwater cost of the underwater movements movements is defined. Givenis defined. this Given graph, this the graph, problem thatthe needs problem to be that solved needs is to the be generationsolved is the of generation the best pathsof the betweenbest paths each between couple each of couple POIs. Theseof POIs. best pathsThese are best referred paths are to as referred “links”, to becauseas “links”, they because represent they represent the links the of alinks second of a second different different graph graph that will bethat defined will andbe defined used in and phase used 2. Thein phase best path2. The between best path two between givenPOIs two isgiven the onePOIs that is the minimises one that the definedminimises cost, the i.e., defined the shortest cost, i.e., path. the Inshortest graph path. theory, In graph the shortest theory, path the shortest problem path requires problem to findrequires a path betweento find twoa path nodes between in a two graph, nodes so thatin a graph, the sum so ofthat the the weight sum of of the the weight edges of that the belong edges that to the belong path is minimised.to the path In is theminimised. literature, In anthe algorithm literature, thatan algorithm is widely that used is towidely solve used this kindto solve of athis problem kind of is a A*, problem is A*, which is often used in many fields of computer science due to its completeness,

Remote Sens. 2020, 12, 3974 5 of 17 which is often used in many fields of computer science due to its completeness, optimality, and optimal efficiency [24]. A* is an informed search algorithm that uses a heuristic function to estimate the cost of theRemote cheapest Sens. 2020 path, 12 from, x FOR a PEER given REVIEW node to the goal node. The algorithm uses this information to focus5 of 18 its search toward a direction that most likely will lead to the optimal solution. The heuristic function is problem-specific,optimality, and optimal so it needs efficiency to be [24]. defined A* is according an informed to thesearch context. algorithm If the that heuristic uses a functionheuristic is admissible,function to meaning estimate that the itcost never of the overestimates cheapest path the from actual a given cost tonode reach to the the goal goal node. node, The A* algorithm will always returnuses a this least-cost information path fromto focus the its starting search nodetoward to thea di goalrection node. that most likely will lead to the optimal solution.As regards The heuristic the weight function of the is problem-specific, edges of the graph, so it i.e.,needs the tocost be defined of the according underwater to the movements, context. If the heuristic function is admissible, meaning that it never overestimates the actual cost to reach the three possible strategies were considered to define it: one based on the distance covered by the path, goal node, A* will always return a least-cost path from the starting node to the goal node. one on the air consumption, and the last on the decompression cost. Since the heuristic function is As regards the weight of the edges of the graph, i.e., the cost of the underwater movements, problem-specific, it is defined in a specific way for each strategy. These strategies are described in three possible strategies were considered to define it: one based on the distance covered by the path, detail in the following subsections. one on the air consumption, and the last on the decompression cost. Since the heuristic function is problem-specific, it is defined in a specific way for each strategy. These strategies are described in 2.2.1. Distance detail in the following subsections. The simpler strategy is to consider the cost of an underwater path as the mere distance covered by the2.2.1. path. Distance In the 3D grid, the allowable movements are restricted by the nature of the grid itself. Basically, three diThefferent simpler types strategy of movements is to consider are allowed the cost in of a an 3D underwater grid, and each path ofas themthe mere has distance a different covered cost: by the path. In the 3D grid, the allowable movements are restricted by the nature of the grid itself. Mov1D: It is the movement along only one axis. Given a voxel diameter of one meter, the cost of • Basically, three different types of movements are allowed in a 3D grid, and each of them has a this kind of movement is defined as c = 1 (Figure2, yellow line). different cost: Mov2D: It is the movement along two axes. Its cost is defined as the diagonal of a square of a side • • Mov1D: It is the movement along only one axis. Given a voxel diameter of one meter, the equal to one: c = √2  1.4 (Figure2, blue line). cost of this kind of movement is defined as =1 (Figure 2, yellow line). Mov3D: It is the movement along three axes. Its cost is defined as c = √12 + 1.42  1.7 (Figure2, • • Mov2D: It is the movement along two axes. Its cost is defined as the diagonal of a square of green line). a side equal to one: =√2 ≅1.4 (Figure 2, blue line). • =√1 +1.4 ≅1.7 In thisMov3D: case, given It is twothe nodes,movement the heuristicalong three function axes. (1)Its iscost computed is defined as theas distance between the (Figure 2, green line). two nodes evaluated as movements in the 3D grid. Since the heuristic should not overestimate the distance,In it this is considered case, given thetwo best nodes, case, the i.e., heuristic the minimum function number (1) is computed of movements as the distance of a different between kind the that permitstwo nodes to reach evaluated one node as movements from the other: in the 3D grid. Since the heuristic should not overestimate the distance, it is considered the best case, i.e., the minimum number of movements of a different kind that permits to reach one nodeh = from1.7 theMov other:3D + 1.4 Mov2D + 1 Mov1 (1) × × × ℎ = 1.7 × 3 + 1.4 × 2 + 1 × 1 (1) where MovXD is the number of movements for each type of movement. where is the number of movements for each type of movement.

FigureFigure 2. A2. A representation representation of of the the three three didifferentfferent typestypes of movements allowed allowed in in a a3D 3D grid grid with with the the relatedrelated distance distance costs. costs.

2.2.2. Air Consumption

Remote Sens. 2020, 12, 3974 6 of 17

2.2.2. Air Consumption In an underwater environment, the covered distance is not the only factor to take into account while evaluating the cost of a path. Indeed, the diving depth is a factor that affects different aspects of the dive, such as the air consumption, the quantity of nitrogen absorbed, and, consequently, the need and the duration of the decompression stops at the end of diving. The air consumption depends both on the distance covered and the diving depth. Therefore, it could be a valid parameter to consider as a cost to be minimised. To compute the air consumption, the respiratory minute volume (RMV) has to be considered as the air consumption rate [1]. The RMV is the total volume of air moved in and out of the lungs in one minute, and it is directly related to different exertion levels among divers. The air consumed at a given depth can be computed calculating the consumption rate at the depth with Equation (2):

C = RMV Pa (2) d × where Cd is expressed in scfm (standard cubic feet per minute), and Pa is the absolute pressure (ata) at the given depth. Then, the air consumed (3) can be calculated by multiplying the Cd by the travel time (min). C = C Mov (3) air d × time Given the distance of each type of movement, as described in the previous section, the travel time (4) can be defined as Mov Mov = distance (4) time v where v is the traveling speed that can be considered as a constant. Therefore, the cost (5) can be defined as RMV C = Pa Mov (5) air v × × distance RMV As v is constant, i.e., it remains the same in the cost computation of whatever path, the cost function (5) can be simplified as follows (6):

C = Pa Mov (6) air × distance On this basis, the heuristic function (7) can be defined, and it considers the best case of a path with the minimum distance, as computed in the previous section, and the minimum air consumption that matches the one evaluated on the surface (Pa = 1).

h = Mov3D Mov3D + Mov2D Mov2D + Mov1D Mov1D (7) distance × distance × distance × where MovXD is the number of movements for each type of movement, and the movement distances are the ones described in the previous section.

2.2.3. Decompression Cost On the basis of the theory of the dissolved gas model of Bühlmann [21], it is possible to evaluate the of inert gas dissolved in the tissue compartments of the diver. This pressure is an important parameter in the computation of decompression stops. In fact, the greater the pressure, the longer the time that will be eventually needed to complete safely the decompression. Hence, the formulation of a “decompression cost” that is based on the inert gas pressure in the tissues and is computed by means of the Schreiner Equation (8) [25]:     1 R kt Pt = P + R t P Pt e− (8) alv0 − k − alv0 − 0 − k Remote Sens. 2020, 12, 3974 7 of 17

Pt, compartment inert gas pressure (bar). • Pt , initial compartment inert gas pressure (bar). • 0 P , initial inspired alveolar inert gas pressure (bar). P = (P Pwv)Q, where P is the • alv0 alv0 amb − amb initial , Pwv is the water vapour pressure at 37 degrees Celsius, i.e., 0.0627 bar, and Q is the fraction of inert gas. 1 ln 2 k, half-time constant related to the compartment (min− ), k = hal f time . • − t, time of exposure (min). • R, rate of change in inspired inert gas pressure with change in the ambient pressure (bar/min). • R = QRamb , where Ramb is the rate of change in the ambient pressure, and Q is the fraction of inert gas.

In short, this equation evaluates the tissue inert gas pressure according to its initial state Pt0 to the ambient pressure Pamb and to the ascent/descent rate. The idea is to define Pt as the decompression cost, but in order to solve the concerning equation, some assumptions were necessary. It is assumed that the breathing mixture is atmospheric air, and therefore, the only inert gas considered is nitrogen. Typically, on the basis of the Bühlmann model, the equation is calculated for all 16 tissue compartments, but in this case, for the sake of simplicity, only the first compartment was considered, i.e., the one with the highest diffusion rate. This compartment has a half-time equal to 4 [22]. Furthermore, the time of exposure t and the rate of change in inspired gas pressure R are calculated assuming a speed of the diver equal to 10m/min. In addition, for the evaluation of R, a fixed value Q = 0.79 stands for the fraction of nitrogen in the air. Finally, it was necessary to define the value of Pt0 that is related to the diver initial state. Since the diver state is not known at this stage, it is assumed as a constant Pt0 equal to the one computed on the surface before starting the dive. On the surface, the amount of nitrogen in the body is constant, so, in this case, the partial pressure of nitrogen (9) corresponds to the alveolar partial pressure:

Pt = P = (P Pwv)Q = (1.0132bar 0.0627bar) 0.79 = 0.7509 bar (9) 0 alv0 amb − − × On these bases, a table of the decompression costs was created. For each depth, three cases were considered: remaining at the same depth, ascending, and descending. For each of these cases, the cost of the three different movements allowed in the 3D grid were computed, as described previously. In Table1, as a sample, only a part of the decompression cost table is reported.

Table 1. A part of the decompression cost table.

Depth Direction Mov1D Mov2D Mov3D P_alv0 0 Same 0.752156728 0.753014201 0.753655358 1 0 Down 0.752493664 0.753485367 0.754226993 1 1 Up 0.752682484 0.753748715 0.754545865 1.1 1 Same 0.753019419 0.754219881 0.755117501 1.1 1 Down 0.753356355 0.754691047 0.755689137 1.1 2 Up 0.753545175 0.754954395 0.756008008 1.2 2 Same 0.753882111 0.755425561 0.756579644 1.2 2 Down 0.754219046 0.755896727 0.75715128 1.2 3 Up 0.754407866 0.756160076 0.757470151 1.3 3 Same 0.754744802 0.756631242 0.758041787 1.3 3 Down 0.755081737 0.757102408 0.758613423 1.3 Remote Sens. 2020, 12, 3974 8 of 17

Table 1. Cont.

Depth Direction Mov1D Mov2D Mov3D P_alv0 4 Up 0.755270558 0.757365756 0.758932294 1.4 4 Same 0.755607493 0.757836922 0.75950393 1.4 4 Down 0.755944429 0.758308088 0.760075566 1.4 5 Up 0.756133249 0.758571436 0.760394438 1.5 5 Same 0.756470184 0.759042602 0.760966073 1.5 5 Down 0.75680712 0.759513768 0.761537709 1.5

As regards the heuristic function (10), similar to the other strategies, a path with the minimum distance and the minimum decompression cost that corresponds with the one evaluated on the surface was considered:

h = Mov3D Mov3D + Mov2D Mov2D + Mov1D Mov1D (10) sur f ace_cost × sur f ace_cost × sur f ace_cost × 2.3. Phase 2 (Path Optimisation): Calculating Optimal Path to Visit All POIs Once phase 1 is completed, all the best links through each couple of POIs have been computed. In phase two, a new graph with a node for each POI can be considered. This is a complete graph for which the links were computed in phase 1. Given this graph, the problem is to find the path that visits the highest possible number of POIs with the minimum cost. It is worth noting that it could be not possible to safely visit all the POIs. This is due to the constraint related to the diving safety procedures that take into account the remaining air in the tank and the absorption of nitrogen in the tissues that should not go beyond the limits. Taking into account all of these aspects, the search algorithm in this phase relies on the DecoAPI introduced before. Therefore, the algorithm of phase 2 searches for the path that visits the highest possible number of POIs with the minimum cost and that is safe and feasible for the diver, given his/her actual state. The cost of the path depends on the strategy employed in phase 1. In the case of strategies based on the distance and on the air consumption, the cost considered in phase 2 is the same as the one evaluated in phase 1, so each link of the new graph has a cost that matches the one computed for the related best link found in phase 1. In the other case of the strategy based on the decompression cost, the cost considered in phase 2 is based on a parameter evaluated by DecoAPI, i.e., the ascent pressure limit. It was decided to consider this cost during this phase, because it is directly related to the inert gas dissolved in the tissues on which the decompression cost of phase 1 is based as well. In particular, the ascent pressure limit stands for the minimum ambient pressure to which the diver can ascend without exceeding the critical supersaturation limit. Furthermore, the ascent pressure limit computed by DecoAPI can rely on the knowledge of the complete decompression profile of the diver, and, therefore, it is more realistic than the decompression cost computed in phase 1, which is based on some strong assumptions that could not correspond to the real case. The space of the can be represented as a tree (Figure3). The root of the tree is represented by the diver, and the first level of the tree is composed of all the POIs. The child nodes of each branch node are all the POIs except the ones that are just present in the branch. The tree has a number of leaves that is N!, where N is the number of POIs. The number of the leaves corresponds to all possible paths that visit all the POIs. The total number of nodes of the tree (11) is given by the following formula:

N X N! (11) (N K)! k=0 − that represents all the possible partial paths, i.e., the paths that visit only a subset of the given POIs. Remote Sens. 2020, 12, 3974 9 of 17 Remote Sens. 2020, 12, x FOR PEER REVIEW 9 of 18

FigureFigure 3. The 3. searchThe search tree tree in the in the sample sample case case of of three three points points ofof interest (POIs). (POIs).

A depth-firstA depth-first search search algorithm algorithm for traversing for traversing the treethe tree was was implemented. implemented. As As soon soon as as it findsit finds a patha with a costpath lowerwith a thancost lower the actual than the best actual path best (if any),path (if this any), is recordedthis is recorded as the as best the best path. path. In addition,In addition, also, the bestalso, partial the best path partial is recorded, path is recorded, i.e., the path i.e., thatthe path visits that the visits greater the greater number number of POIs of withPOIs with the lowest the lowest cost. If there is not a path that can visit all the existing POIs, this partial path will be returned cost. If there is not a path that can visit all the existing POIs, this partial path will be returned as the as the best path. This is due to the fact that, apart from different strategies employed in phase 1, in best path. This is due to the fact that, apart from different strategies employed in phase 1, in phase phase 2, each eligible path is processed by DecoAPI and should result safe to be considered as a 2, eachpossible eligible solution. path is processedA path is considered by DecoAPI safe if and the diver should does result not exceed safe to the be decompression considered as limits a possible and solution.if he/she A path has isconsidered enough time safe to iffulfil the diverthe deco does stop nots, exceedthus concluding the decompression the dive in limitscomplete and safety. if he/she has enoughDecoAPI time performs to fulfil thethis deco evaluation stops, on thus the concluding basis of the the actual dive state in complete of the diver. safety. In fact, DecoAPI it records performs the this evaluationdive profile on of the the basis diver ofin theorder actual to perform state the of theestimation diver. of In the fact, nitrogen it records absorbed the dive by the profile tissues of of the diver inthe order diver. to When perform thethe tree estimation is generated, of the initial nitrogen state absorbed of the diver by thecorresponding tissues of the to the diver. root When of thethe tree is generated,tree is recorded. the initial At each state branch of the node, diver the correspondingstate of the diver to is the computed root of according the tree is to recorded. the actual Atpath each branchof node, the related the state branch of the and diver is propagated is computed in the according lowest level to of the the actual tree. This path step of the avoids related the repetition branch and of expensive calculations that were previously done. Furthermore, a pruning of the search tree is is propagated in the lowest level of the tree. This step avoids the repetition of expensive calculations implemented, i.e., a technique for the optimisation of the tree through the removal of the branches that were previously done. Furthermore, a pruning of the search tree is implemented, i.e., a technique that are redundant in order to find the optimal solution. In particular, when a partial path has a cost for the optimisationthat is greater ofthan the the tree cost through of the actual the removal minima ofl path, the branches the related that branch are redundant is deleted from in order the tree, to find the optimaland the solution. search proceeds In particular, on to the when next abranch. partial path has a cost that is greater than the cost of the actual minimal path, the related branch is deleted from the tree, and the search proceeds on to the next branch.3. Results The behaviour of the pathfinding algorithm was tested on each underwater site for each of the 3. Resultsthree strategies previously described. For each 3D model of the underwater sites, space partitioning Thewas behaviour performed of in the order pathfinding to produce algorithma 3D grid on was which tested the algorithm on each underwatercould perform site the forsearch each of ofthe the three strategiesbest path. previously described. For each 3D model of the underwater sites, space partitioning was performed in order to produce a 3D grid on which the algorithm could perform the search of the 3.1. Case Studies best path. Three cases of study were considered to evaluate the behaviour and the performance of the 3.1. Casepathfinding Studies algorithm. Each of them consisted of a 3D model that represented an underwater site with different environmental features. Five POIs were placed in each site, and they represented the Threespots cases that the of studydiver needed were considered to visit. The to differe evaluatent environments the behaviour are anddescribed the performance in the following of the pathfindingsubsections. algorithm. Each of them consisted of a 3D model that represented an underwater site with different environmental features. Five POIs were placed in each site, and they represented the spots that the3.1.1. diver Shipwreck needed to visit. The different environments are described in the following subsections.

Remote Sens. 2020, 12, 3974 10 of 17

3.1.1. Shipwreck ThisRemote underwater Sens. 2020, 12, sitex FOR is PEER a typical REVIEW sample of an artificial obstacle in an underwater 10environment of 18 that could restrictThis underwater the freedom site is ofa typical movement sample ofof thean artificial diver, andobstacle it has in an to underwater be taken intoenvironment account while computingthat acould diving restrict plan. the Infreedom particular, of movement in this caseof the study, diver, and the obstacleit has to be is taken also theinto focusaccount of while the mission and is representedcomputing a diving by a modern plan. In particular, shipwreck in thatthis case is 85 study, m long the obstacle and approximately is also the focus 13 of m the wide mission (Figure 4). The shipwreckand is represented lays on the by a seabed modern in shipwreck an upright that positionis 85 m long at aand depth approximately of around 13 35 m m.wide The (Figure deck of the ship is at4). aThe depth shipwreck of around lays on 30 the m. seabed in an upright position at a depth of around 35 m. The deck of the ship is at a depth of around 30 m.

FigureFigure 4. 4.A A modernmodern shipwreck. shipwreck.

3.1.2. Seamount3.1.2. Seamount This case study represents a sample of a natural obstacle in the underwater environment, such This case study represents a sample of a natural obstacle in the underwater environment, such as as a seamount (Figure 5). It is not a real environment but a 3D-modelled one. The depth at the seabed a seamountlevel is (Figure around5 30). Itm, is and not the a top real of environment the seamount is but 10 m a 3D-modelleddeep. one. The depth at the seabed level is around 30 m, and the top of the seamount is 10 m deep. Remote Sens. 2020, 12, x FOR PEER REVIEW 11 of 18

FigureFigure 5. 5.A A samplesample of of a aseamount. seamount. 3.1.3. Landslide A typical natural underwater formation is the landslide, i.e., an underwater slope where the depth increases gradually (Figure 6). In this case, the environment was modelled as well. The top region is around 7 to 8 m deep, and the bottom of the seabed is at a depth of around 27 m.

Figure 6. A sample of a landslide.

3.2. Space Partitioning: 3D Grids Figure 7 represents the 3D grids for each case study. More precisely, the figure shows the voxels of the grids that represent the “terrain”, i.e., the regions of the underwater site that cannot be

Remote Sens. 2020, 12, x FOR PEER REVIEW 11 of 18

Remote Sens. 2020, 12, 3974 11 of 17 Figure 5. A sample of a seamount.

3.1.3. Landslide A typicaltypical naturalnatural underwater underwater formation formation is theis the landslide, landslide, i.e., ani.e., underwater an underwater slope slope where where the depth the increasesdepth increases gradually gradually (Figure 6(Figure). In this 6). case, In this the ca environmentse, the environment was modelled was modelled as well. The as well. top region The top is aroundregion is 7 around to 8 m deep, 7 to 8 and m deep, the bottom and the of bottom the seabed of the is seabed at a depth is at of a arounddepth of 27 around m. 27 m.

Figure 6.6. A sample of a landslide.

3.2. Space Partitioning: 3D Grids Remote Sens. 2020, 12, x FOR PEER REVIEW 12 of 18 Figure7 7 represents represents the the 3D3D gridsgrids forfor eacheach casecase study.study. MoreMore precisely,precisely, the the figure figure shows shows the the voxelsvoxels oftraversed thethe grids grids by that that the represent representdiver, theas the “terrain”,described “terrain”, i.e.,in thethei.e., regions relathe tedregions of section. the underwaterof theThe underwater whole site thatgrid site cannot covers that be cannotthe traversed entire be byunderwater the diver, sites as described from the inseabed the related to the surface. section. In The the whole figure, grid the bounds covers theof the entire grids underwater are represented sites from by the the white seabed lines. to the surface. In the figure, the bounds of the grids are represented by the white lines.

(a) (b) (c)

FigureFigure 7.7.The The 3D 3D grids grids of eachof each underwater underwater site: (site:a) the (a shipwreck,) the shipwreck, (b) the seamount,(b) the seamount, and (c) the and landslide. (c) the landslide. 3.3. Generated Paths 3.3. GeneratedIn Table2, Paths all generated paths are reported for each case. The rows represent the underwater sites, and the columns represent the strategy adopted to compute the related path. The position of the diver In Table 2, all generated paths are reported for each case. The rows represent the underwater is set always on the surface, and the generated paths visit all the POIs in each case. The generated path sites, and the columns represent the strategy adopted to compute the related path. The position of is represented by the voxels of the grid that are part of the path. A gradient colour is used to better the diver is set always on the surface, and the generated paths visit all the POIs in each case. The generated path is represented by the voxels of the grid that are part of the path. A gradient colour is used to better identify the depth of the path. The gradient ranges from the green colour on the surface to the red colour on the seabed. A numbered label near each POI indicates the order of visit.

Table 2. The paths generated with three different strategies for three different case studies.

Underwater Strategy Site Distance Air Consumption Decompression

Shipwreck

Seamount

Landslide

RemoteRemoteRemoteRemote Sens. Sens. Sens.Sens. 2020 2020 20202020,,,, , , 12, 12 1212,,,, , , x, x xx xxx FOR FOR FORFOR FORFORFOR PEER PEER PEERPEER PEERPEERPEER REVIEW REVIEW REVIEWREVIEW REVIEWREVIEWREVIEW 12 12 12 12 12 12 12 of of of of of of of 18 18 18 18 18 18 18

traversedtraversedtraversedtraversedtraversedtraversed bybybybybyby thethethethethethe diver,diver,diver,diver,diver,diver, asasasasasas describeddescribeddescribeddescribeddescribeddescribed inininininin thethethethethethe relarelarelarelarelarelatedtedtedtedtedted section.section.section.section.section.section. TheTheTheTheTheThe wholewholewholewholewholewhole gridgridgridgridgridgrid coverscoverscoverscoverscoverscovers thethethethethethe entireentireentireentireentireentire underwaterunderwaterunderwaterunderwater sites sites sitessites from from fromfrom the the thethe seabed seabed seabedseabed to to toto the the thethe surface. surface. surface.surface. In In InIn the thethe thethethe figure, figure, figure, figure,figure,figure, the the the thethethe bounds bounds bounds boundsboundsbounds of of of ofofof the the the thethethe grids grids grids gridsgridsgrids are are are areareare represented represented represented representedrepresentedrepresented bybybyby the the thethe white white whitewhite lines. lines. lines.lines.

((((a((aaa)))) ) ) ((((b((bbb)))) ) ) ((((c((ccc)))) ) )

FigureFigureFigureFigure 7. 7.7.7. The TheTheTheTheTheThe 3D 3D3D3D3D3D3D grids gridsgridsgridsgridsgridsgrids of ofofofofofof each eacheacheacheacheacheach underwater underwaterunderwaterunderwaterunderwaterunderwaterunderwater site: site:site:site:site:site:site: ( ((((a((aaa)))) ) ) the thethethethethe shipwreck, shipwreck,shipwreck,shipwreck,shipwreck,shipwreck, ( (((b((bbb)))) ) ) the thethethethethe seamount, seamount,seamount,seamount,seamount,seamount, and andandandandand ( (((c((ccc)))) ) ) the thethethethethe landslide.landslide.landslide.landslide.landslide.landslide.

3.3.3.3.3.3.3.3. GeneratedGenerated GeneratedGenerated PathsPaths PathsPaths InInInInInIn Table Table TableTableTableTable 2, 2, 2,2,2,2, all all allallallall generated generated generatedgeneratedgeneratedgenerated paths paths pathspathspathspaths are are areareareare reported reported reportedreportedreportedreported for for forforforfor each each eacheacheacheach case. case. case.case.case.case. The The TheTheTheThe rows rows rowsrowsrowsrows represent represent representrepresentrepresentrepresent the the thethethethe underwater underwater underwaterunderwaterunderwaterunderwater Remote Sens.sites,sites,sites,sites,2020 , and andand12and, 3974 the thethethe columns columnscolumnscolumns represent representrepresentrepresent the thethethe strategy strategystrategystrategy adopted adoptedadoptedadopted to tototo compute computecomputecompute the thethethe related relatedrelatedrelated path. path.path.path. The TheTheThe position positionpositionposition of ofofof12 of 17 thethethethethethe diver diverdiverdiverdiverdiver is isisisisis set setsetsetsetset always alwaysalwaysalwaysalwaysalways on ononononon the thethethethethe surface, surface,surface,surface,surface,surface, and andandandandand the thethethethethe generated generatedgeneratedgeneratedgeneratedgenerated paths pathspathspathspathspaths visit visitvisitvisitvisitvisit all allallallallall the thethethethethe POIs POIsPOIsPOIsPOIsPOIs in ininininin each eacheacheacheacheach case. case.case.case.case.case. The TheTheTheTheThe generatedgeneratedgeneratedgenerated path path pathpath is is isis represented represented representedrepresented by by byby the the thethe voxels voxels voxelsvoxels of of ofof the the thethe gr gr grgridididididid that thatthat thatthatthat areare are areareare part partpart partpartpart ofof of ofofof the thethe thethethe path. path.path. path.path.path. AA A AAA gradient gradientgradient gradientgradientgradient colour colourcolour colourcolourcolour is isis isisis identify theusedusedusedused depth to to toto better better betterbetter of identify identify identify theidentify path. the the thethe depth depth Thedepthdepth gradient of ofofof the the thethe path. path. path.path. ranges The The TheThe gr gr grgradientadientadient fromadient ranges therangesrangesranges green from from fromfrom colour the the thethe green green greengreen on colour colour colourcolour the surface on on onon the the thethe surface surface surfacesurface to the red colour ontotototototo the thethe the thethetheseabed. redred red redredred colourcolour colour colourcolourcolour A onon on on numberedonon thethe the thethethe seabed.seabed. seabed. seabed.seabed.seabed. label AA A AAA numberednumbered numbered numberednumberednumbered near each labelabe labe labelabelabe POIllll l l nearnear near nearnearnear indicates eacheach each eacheacheach POIPOI POI POIPOIPOI the indicatesindicates indicates indicatesindicatesindicates order thethe the thethethe of orderorder order orderorder visit.order ofof of ofofof visit.visit. visit. visit.visit.visit.

Table 2. TableTableTheTableTable paths 2. 2.2.2. The The TheThe generated paths paths pathspaths generated generated generatedgenerated with with with withwith three three three threethree diff different different differenterentdifferent strategies stra stra strastrategiestegiestegiestegiestegiestegies for for for forforfor three three three threethreethree different different different differentdifferentdifferent different case case case casecasecase case studies. studies. studies. studies.studies.studies. studies. StrategyStrategyStrategy UnderwaterUnderwaterUnderwaterUnderwater StrategyStrategyStrategy Underwater Site SiteSiteSite SiteSiteSite DistanceDistanceDistanceDistanceDistance AirAirAirAirAir Consumption Consumption ConsumptionConsumptionConsumption Decompression DecompressionDecompressionDecompression

ShipwreckShipwreckShipwreckShipwreckShipwreck

SeamountSeamountSeamountSeamountSeamount

Landslide LandslideLandslideLandslideLandslide

For each path generated with a specific strategy, the costs of the other two strategies are also computed for the path. These costs are reported in Table3, where each column represents the paths generated by the related strategy divided by the underwater site. Consequently, each row represents a specific type of cost. Within the row, the value highlighted in grey represents the minimum cost, and the value in bold represents the cost closest to the minimum.

Table 3. The costs computed for each path with the tree strategy.

Strategy Underwater Site Cost Distance Air Consumption Decompression Distance 167 172.2 301.7 Shipwreck Air Consumption 13.5292 13.4948 20.6618 Decompression 2.277739 2.14631 0.8656095 Distance 139.2 143.5 175.6 Seamount Air Consumption 8.3121 8.2405 9.3926 Decompression 0.5507061 0.548093 0.5466153 Distance 223.7 227.4 292.4 Landslide Air Consumption 12.1802 11.7076 13.9602 Decompression 0.5526806 0.548951 0.5451685

Over time, the paths determined by the pathfinding algorithm could change. In fact, the history of dives is recorded by DecoAPI, which evaluates the diving profile of the diver and establishes if a certain path is safe or not for the diver. Figure8 and Table4 depict two di fferent moments of the same dive. In the first moment, the diver is diving at a depth of 18 m, and the related dive data are reported in the first column of Table4, labelled as “Case a”. In this situation, the algorithm succeeds in finding a safe path to visit all the five POIs (Figure8a). After fifteen minutes at the same depth of 18 m, the situation changes, as reported in the second column of Table4, labelled as “Case b”. In fact, the ascent pressure Remote Sens. 2020, 12, x FOR PEER REVIEW 13 of 18

For each path generated with a specific strategy, the costs of the other two strategies are also computed for the path. These costs are reported in Table 3, where each column represents the paths generated by the related strategy divided by the underwater site. Consequently, each row represents a specific type of cost. Within the row, the value highlighted in grey represents the minimum cost, and the value in bold represents the cost closest to the minimum.

Table 3. The costs computed for each path with the tree strategy.

Strategy Underwater Site Cost Distance Air Consumption Decompression Distance 167 172.2 301.7 Shipwreck Air Consumption 13.5292 13.4948 20.6618 Decompression 2.277739 2.14631 0.8656095 Distance 139.2 143.5 175.6 Seamount Air Consumption 8.3121 8.2405 9.3926 Decompression 0.5507061 0.548093 0.5466153 Distance 223.7 227.4 292.4 Landslide Air Consumption 12.1802 11.7076 13.9602 Decompression 0.5526806 0.548951 0.5451685

Over time, the paths determined by the pathfinding algorithm could change. In fact, the history of dives is recorded by DecoAPI, which evaluates the diving profile of the diver and establishes if a certain path is safe or not for the diver. Figure 8 and Table 4 depict two different moments of the same dive. In the first moment, the diver is diving at a depth of 18 m, and the related dive data are reported in the first column of Table 4, labelled as “Case a”. In this situation, the algorithm succeeds in finding a safe path to visit all the five POIs (Figure 8a). After fifteen minutes at the same depth of 18 m, the Remote Sens. 2020, 12, 3974 13 of 17 situation changes, as reported in the second column of Table 4, labelled as “Case b”. In fact, the ascent pressure limit, which meaning was defined before, increases from 0.97 to 1.64 bar. The air available inlimit, the whichtank goes meaning down was to 66 defined bar, and before, the time increases to su fromrface 0.97(TTS) to goes 1.64 bar.up to The six airminutes. available In inparticular, the tank thegoes TTS down is a totypical 66 bar, diving and the concept time tothat surface represents (TTS) the goes time up toestimated six minutes. for the In diver particular, to complete the TTS the is eventuala typical decompression diving concept stops that representsand ascend the safely time to estimatedthe surface. for In the this diver new situation, to complete the the pathfinding eventual algorithmdecompression evaluates stops that and it ascend is no longer safely safe to the for surface. the diver In to this visit new all situation,the five POIs. the pathfindingTherefore, it algorithm suggests anevaluates optimal that partial it is no path, longer i.e., safe a path for the that diver visits to visitfour allPOIs the fivewith POIs. the minimum Therefore, cost it suggests and in an complete optimal safety.partial path, i.e., a path that visits four POIs with the minimum cost and in complete safety.

(a) (b)

Figure 8. TheThe path path suggested by the algorithm changes over time. Table 4. The dive data associated with the two cases presented in Figure8.

Initial State Dive Data Case “a” Case “b”

Time (min) 39 54 Diving depth (m) 18 18 Ascent pressure limit (bar) 0.97 1.64 Tank (bar) 95 66 Time to Surface (min) 2 6

4. Discussion The results reported in Table2 show that the algorithm behaves in a di fferent way according to the adopted strategy. In particular, the strategy based on the distance produces a straightforward path that obviously takes into account only the distance covered by the path whilst ignoring the depth. On the contrary, the strategy that relies on the air consumption cost considers both the distance and the depth of the generated path. As a result, this strategy produces paths that suggest ascending a little in some cases, in order to dive at a lower depth and consume less air without impacting too much on the distance covered by the path. Finally, the strategy based on the decompression cost generates paths that suggest ascending more and more frequently with respect to the air consumption strategy. In addition, the strategy based on the decompression cost suggests visiting the POIs in an order that does not seem to be convenient or logical. This is due to the fact that this strategy does not take into account the distance covered by the path and suggests diving at lower depths as much as possible in order to minimise the ascent pressure limit. In fact, the ascent pressure limit is not an increasing function during the dive, but it can decrease while ascending. The costs reported in Table3 allow for better addressing the differences between the results obtained by the alternative strategies. Obviously, each strategy obtains the best values (highlighted in grey) as regards the cost related to the strategy itself. The strategy based on the distance obtains an air consumption cost that is the closest to the minimum. The strategy based on air consumption seems to suggest paths that minimise the consumption of air, but, in addition, it obtains a distance cost and ascent pressure limit that are Remote Sens. 2020, 12, 3974 14 of 17 the closest to the minimum. On the contrary, the strategy based on the decompression cost seems successful only in optimising the ascent pressure limit while suggesting paths that have a distance and air consumption cost that are considerably higher with respect to the other two strategies. Each strategy may consider or not the diving depth and, eventually, can suggest paths with an ascent of a variable entity before moving towards the target. In this respect, Table5 reports some figures that address the different behaviours of strategies in suggesting the entity of the ascent. Each figure shows the paths suggested by each strategy that goes from the diver to a POI placed at a given distance and depth. At a depth of 10 m and a distance of 10 m, all the three strategies suggest moving straightforward, maintaining the depth. Increasing the distance to 20 m, the air consumption (AC) strategy suggests ascending a few meters, and the decompression strategy suggests ascending even more. With a distance of 30 m, both strategies suggest ascending up to the surface. Obviously, the strategy based on the distance does not ever suggest ascending, because it does not consider depth as a cost. Going deeper, to 20 m, with the POI placed at a distance of 10 m, the three strategies continue to suggest remaining the same depth. At a distance of 20 m, the only strategy that suggests ascending a few meters is the one based on the decompression cost. A further increasing of the distance of the POI up to 30 m leads the AC strategy to suggest ascending about five meters, while the strategy based on the decompression cost suggests ascending about 10 m. It is worth noting that, basically, the AC strategy suggests ascending less with respect to the decompression strategy, placing itself in the middle Remote Sens. 2020, 12, x FOR PEER REVIEW 15 of 18 betweenRemoteRemoteRemoteRemoteRemote the Sens.Sens. Sens. Sens. otherSens. 20202020 2020 20202020,, 1212 two, ,,12, x12x12 , FOR FOR,x, strategies.xx FOR FORFOR PEERPEER PEER PEERPEER REVIEWREVIEW REVIEW REVIEWREVIEW 15 15 15 of 15 of 15 of 18 18 of of 18 18 18

TableTable 5. Different 5. Different behaviours behaviours of theof the strategies strategies in suggein suggestingsting the the ascent ascent by byvarying varying the the depth depth and and the the TableTable 5.TableTableTableDi 5.ff erent5. Different 5.5. Different DifferentDifferent behaviours behaviours behaviours behavioursbehaviours of of the of theofof strategiesthe thethe strategies strategies strategiesstrategies inin in suggestingsuggeinin sugge suggesuggestingstingstingsting the the the thethe ascent ascentascent ascentascent by by bybyvarying varying varyingvarying the the thethe thedepth depth depthdepth depth and and andand the and the thethe the distancedistance between between the the diver diver and and point point of interestof interest (POI). (POI). distancedistancedistancedistancedistance between between between betweenbetween the the diver the thethe diver diver diverdiver and and and point andand point point pointpoint of of interest of interestofof interest interestinterest (POI).(POI). (POI). (POI).(POI). DistanceDistance between between Diver Diver and and POI POI DistanceDistanceDistanceDistanceDistance between between between between Diver Diver DiverDiver and andand andand POI POI POI POIPOI DepthDepthDepthDepthDepthDepth 10101010 10m10m m m mm 20 20 20 20m 20 20m m mm 30 30 30 30m 30m 30 m mm m

101010 m10 10m10m m mm

20 m 202020 20m20m m mm

In addition,In addition, it could it could be benoted noted that that both both the the AC AC and and decompression decompression strategies strategies suggest suggest ascending ascending In addition,InIn Inaddition,In addition, addition,addition, it could it it could itit could couldcould be be noted be bebenoted noted notednoted that that that thatthat both both both bothboth thethe the thethe ACAC AC ACAC and and and andand decompression decompression decompression decompressiondecompression strategies strategies strategiesstrategies suggest suggest suggestsuggest suggest ascending ascending ascendingascending ascending lesslesslessless with withwithwith the thethe theincrease increaseincreaseincrease of theofofof thethe thedepth. depth.depth.depth. This ThisThisThis could couldcouldcould be bebeexplainedbe explainedexplainedexplained by bybyobservingby observingobservingobserving the thethe thegraphs graphsgraphsgraphs in Figureininin FigureFigureFigure 9. In 9.9.9. InInIn less withlessless with the with increase the the increase increase of the of of depth.the the depth. depth. This This couldThis could could be be explained be explained explained by by observingby observing observing the the the graphs graphs graphsin in in FigureFigure Figure9 9.. In9.In In both bothbothbothbothboth graphs,graphs, graphs, graphs,graphs, eacheach each eacheach lineline line lineline representsrepresents represents representsrepresents thethe the the the evolutionevolution evolution evolutionevolution ofof ofthe oftheof the the the differentdifferent different differentdifferent typestypes types typestypes ofof of movements ofmovementsof movements movementsmovements withwith with withwith thethe the the the increaseincrease increase increaseincrease graphs, each line represents the evolution of the different types of movements with the increase of the ofof of theoftheof the the the depth.depth. depth. depth.depth. ItIt could It couldItIt could couldcould bebe be benoticedbenoticed noticed noticednoticed thatthat that thatthat thethe the the the slopeslope slope slopeslope ofof of eachofeachof each eacheach lineline line lineline isis isdifferent. different.isis different. different.different. Consequently,Consequently, Consequently, Consequently,Consequently, asas as astheasthe the the the depthdepth depth depthdepth depth. It could be noticed that the slope of each line is different. Consequently, as the depth increases, increases,increases,increases,increases,increases,increases, thethe the thethe the gapgap gap gapgapgap betweenbetween between betweenbetweenbetween differentdifferent different differentdifferentdifferent typestypes types typestypestypes ofof of movementofofmovementof movement movementmovementmovement increasesincreases increases increasesincreasesincreases asas as aswell.asaswell. well. well.well.well. ThisThis This ThisThisThis showsshows shows showsshowsshows thatthat that thatthatthat itit is it isititit isless lessisisis less lesslessless the gapaffordableaffordableaffordableaffordableaffordable between toto toextend ditoextendto extendff extendextenderent thethe the thetypes the pathpath path pathpath ascendingascending of ascending ascendingascending movement withwith with withwith increasesdiagonaldiagonal diagonal diagonaldiagonal movements.movements. as movements. movements.movements. well. This shows that it is less affordable to extend the path ascending with diagonal movements.

0.8 0.81 0.80.80.80.80.8 0.810.810.810.810.81 0.70.7 0.8 0.70.70.70.7 0.80.80.80.80.8 0.6 0.60.60.60.6 0.79 0.6 0.790.790.790.790.79 0.5 0.50.50.50.50.5 0.780.780.78 0.4 0.780.78 0.40.40.40.40.4 0.770.77 0.3 0.770.770.770.77 0.30.30.30.30.3 0.76 0.2 0.760.760.760.76 0.20.20.20.20.2 0.76 0.10.1 0.750.750.75

0.1 cost Decompression 0.750.75

0.1 cost Decompression

Air consumption cost consumption Air 0.10.1 Decompression cost Decompression Air consumption cost consumption Air Decompression cost Decompression Air consumption cost consumption Air Decompression cost Decompression Decompression cost Decompression Air consumption cost consumption Air Air consumption cost consumption Air Air consumption cost consumption Air 0 0.74 00 000 0.740.740.740.740.74 2 5 8 11141720232629 0 3 6 10 13 16 20 23 26 30 222 522 5 5 58 58 811141720232629 111417202326298 8 11141720232629 11141720232629 11141720232629 00000 3 3 3 3 36 6 6 10 610 6 10 10 1013 13 13 13 1316 16 16 16 1620 20 20 20 2023 23 23 23 2326 26 26 26 2630 30 30 30 30 DepthDepthDepthDepthDepth DepthDepthDepthDepthDepth

Mov1D Mov2D Mov3D Mov1D Mov2D Mov3D Mov1DMov1DMov1DMov1DMov1D Mov2DMov2DMov2DMov2DMov2D Mov3DMov3DMov3DMov3DMov3D Mov1DMov1DMov1DMov1DMov1D Mov2DMov2DMov2DMov2DMov2D Mov3DMov3DMov3DMov3DMov3D

(a) (b) ((aa))( (a(aa)) ) ((bb)() (b (bb)) ) Figure 9. The evolution of the air consumption cost (a) and the decompression cost (b) with the FigureFigureFigureFigureFigure 9.9. 9.The The9.9. The TheThe evolutionevolution evolution evolutionevolution ofof of theoftheof the thethe airair air airairconsumptionconsumption consumption consumptionconsumption costcost cost costcost ((aa ) )( (a(andaanda)) ) and andand thethe the thethe decompressiondecompression decompression decompressiondecompression costcost cost costcost ((bb ) () b( (withbbwith)) ) with withwith thethe the thethe increasing of the depth. increasingincreasingincreasingincreasingincreasing ofof ofthe theofof the thethe depth.depth. depth. depth.depth.

Finally,Finally,Finally,Finally,Finally, itit has ithas itit has hashas toto to be tobeto be benotedbenoted noted notednoted that,that, that, that,that, inin in the inthein the the the resultsresults results resultsresults reported,reported, reported, reported,reported, thethe the the the strategiesstrategies strategies strategiesstrategies couldcould could couldcould alsoalso also alsoalso decidedecide decide decidedecide toto to ascend toascendto ascend ascendascend upupup up uptoto to the totheto the the the surfacesurface surface surfacesurface withoutwithout without withoutwithout anyany any anyany constraintconstraint constraint constraintconstraint inin in order inorderin order orderorder toto to evaluate toevaluateto evaluate evaluateevaluateevaluate thethe the thethe the purepure pure purepurepure behaviourbehaviour behaviour behaviourbehaviourbehaviour ofof of the ofoftheof the thethe the strategy.strategy. strategy. strategy.strategy.strategy. InIn In aInInaIn a aaa

Remote Sens. 2020, 12, x FOR PEER REVIEW 15 of 18

Table 5. Different behaviours of the strategies in suggesting the ascent by varying the depth and the distance between the diver and point of interest (POI).

Distance between Diver and POI Depth 10 m 20 m 30 m

10 m

20 m

In addition, it could be noted that both the AC and decompression strategies suggest ascending less with the increase of the depth. This could be explained by observing the graphs in Figure 9. In both graphs, each line represents the evolution of the different types of movements with the increase of the depth. It could be noticed that the slope of each line is different. Consequently, as the depth

Remoteincreases, Sens. 2020the, gap12, 3974 between different types of movement increases as well. This shows that it 15is ofless 17 affordable to extend the path ascending with diagonal movements.

0.8 0.81 0.7 0.8 0.6 0.79 0.5 0.78 0.4 0.77 0.3 0.2 0.76 0.1 0.75 Decompression cost Decompression Air consumption cost consumption Air 0 0.74 2 5 8 11141720232629 0 3 6 10 13 16 20 23 26 30 Depth Depth

Mov1D Mov2D Mov3D Mov1D Mov2D Mov3D

(a) (b)

FigureFigure 9.9. The evolution of the air consumption cost (a) andand thethe decompressiondecompression costcost ((b)) withwith thethe increasingincreasing ofof thethe depth.depth.

Finally,Finally, itit hashas toto bebe notednoted that,that, inin thethe resultsresults reported,reported, thethe strategiesstrategies couldcould alsoalso decidedecide toto ascendascend upup toto thethe surfacesurface withoutwithout anyany constraintconstraint inin orderorder toto evaluateevaluate thethe purepure behaviourbehaviour ofof thethe strategy.strategy. InIn aa real case, it is convenient to introduce an ascent limit that can prevent the strategies from ascending too much. Indeed, the possibility to enable this limit was introduced in the pathfinding algorithm, and it was set at the depth of the safety decompression stop, which, usually, is at five meters and has to be completed at the end of every dive.

5. Conclusions In this work, a novel system was presented that enabled computing an underwater path that visits the highest possible number of POIs with the minimum cost and in total safety. This was achieved by designing an original pathfinding algorithm that took into account several factors strictly inherent to . In fact, the algorithm took into account the decompression limits and the remaining air in the scuba tank. Furthermore, for the first time in the field of path planning aimed to support divers, the proposed system took into account the topography of the underwater environment to produce a path that considered and avoided obstacles. The pathfinding algorithm computes the path with the minimal cost. In order to define the cost of the underwater movements, three possible strategies are considered: the first one based on the distance covered by the path, the second on the air consumption, and the last one on the decompression cost. The analysis of the results suggests that the best strategy is the one based on the optimisation of the air consumption. The decompression cost is based on the ascent pressure limit that takes into account only nitrogen absorbed in the tissues. For this reason, the strategy based on this cost tends to suggest paths that ascend too much towards the surface, without taking into consideration the additional distance of the path. Conversely, the strategy based only on the distance cost does not consider the depth of the path and optimises only the length of the path. In the middle, between these two strategies, the strategy based on air consumption takes into account both the distance and the depth, minimising the diving at great depths without affecting too much the path’s length. Furthermore, since the AC strategy tends to ascend less than the strategy based on the decompression cost; it suggests paths that are more plausible and relevant to the standard scuba diving practices. An ascent limit that can prevent the strategies from ascending too much was designed as well. Remote Sens. 2020, 12, 3974 16 of 17

In the future, it will be necessary to evaluate additional strategies or to combine the existing ones in a different fashion. Indeed, it could be possible to adopt different strategies for the evaluation of the costs in the two different phases of the algorithm. Some field tests will be conducted with real users that could give important feedback to evaluate which strategy could perform better in a real case scenario. In addition, since divers often return to known locations at the end of the dive (i.e., the boat), a fixed final node in the computation of the best path could be introduced. This will strongly change the generated paths and may ensure a better suiting of real diving demands. Finally, a further extension could also take into account the sea currents that may affect considerably the cost of a specific path.

Author Contributions: Conceptualisation, M.M. and F.B.; methodology, M.M., F.B., and F.P.; software, M.M.; validation, M.M., F.P., and A.C.; writing—original draft preparation, M.M.; writing—review and editing, M.M., F.B., F.P., and A.C.; supervision, F.B.; funding acquisition, F.B. All authors have read and agreed to the published version of the manuscript. Funding: This research was partially funded by the Regione Calabria under the POR CALABRIA FESR-FSE 2014-2020 as part of the MOLUX (MObile Lab for Underwater eXploration) project (CUP J28C17000110006). Conflicts of Interest: The authors declare no conflict of interest.

References

1. Joiner, J.T. NOAA Diving Manual: Diving for Science and Technology, 4th ed.; Best Publishing Company: Flagstaff, AZ, USA, 2001; ISBN 9780941332705. 2. MultiDeco VPM & VPM-B & VPM-B/E & ZHL GF Dive Decompression Software for Technical Divers. Available online: http://www.hhssoftware.com/multideco/ (accessed on 31 August 2020). 3. Subsurface | An Open Source Divelog. Available online: https://subsurface-divelog.org/it/ (accessed on 31 August 2020). 4. DIVEROID. Available online: https://app.diveroid.com/en/main (accessed on 31 August 2020). 5. DecoTengu-Dive Decompression Library. Available online: https://wrobell.dcmod.org/decotengu/ (accessed on 31 August 2020). 6. Choset, H.M.; Hutchinson, S.; Lynch, K.M.; Kantor, G.; Burgard, W.; Kavraki, L.E.; Thrun, S.; Arkin, R.C. Principles of Robot Motion: Theory, Algorithms, and Implementation; MIT Press: Cambridge, MA, USA, 2005; ISBN 9780262033275. 7. Murphy, R.R. Introduction to AI Robotics. Ind. Robot Int. J. 2001, 28, 266–267. [CrossRef] 8. Dijkstra, E.W. A note on two problems in connexion with graphs. Numer. Math. 1959, 1, 269–271. [CrossRef] 9. Hart, P.E.; Nilsson, N.J.; Raphael, B. A formal basis for the heuristic determination of minimum cost paths. IEEE Trans. Syst. Sci. Cybern. 1968, 4, 100–107. [CrossRef] 10. Yang, J.-M.; Tseng, C.-M.; Tseng, P.S. Path planning on satellite images for unmanned surface vehicles. Int. J. Nav. Archit. Ocean Eng. 2015, 7, 87–99. [CrossRef] 11. Sun, Y.; Ran, X.; Zhang, G.; Xu, H.; Wang, X. AUV 3D Path Planning Based on the Improved Hierarchical Deep Q Network. J. Mar. Sci. Eng. 2020, 8, 145. [CrossRef] 12. Pham, H.X.; La, H.M.; Feil-Seifer, D.; Nguyen, L.V. Autonomous uav navigation using reinforcement learning. arXiv 2018, arXiv:1801.05086. 13. Wang, C.; Wang, J.; Wang, J.; Zhang, X. Deep Reinforcement Learning-based Autonomous UAV Navigation with Sparse Rewards. IEEE Internet Things J. 2020, 7, 6180–6190. [CrossRef] 14. Wang, X.; Yao, X.; Zhang, L. Path Planning under Constraints and Path Following Control of Autonomous Underwater Vehicle with Dynamical Uncertainties and Wave Disturbances. J. Intell. Robot. Syst. 2020, 99, 891–908. [CrossRef] 15. Kulkarni, C.S.; Lermusiaux, P.F.J. Three-dimensional time-optimal path planning in the ocean. Ocean Model. 2020, 152, 101644. [CrossRef] 16. Koenig, S.; Likhachev, M.; Furcy, D. Lifelong planning A . Artif. Intell. 2004, 155, 93–146. [CrossRef] ∗ 17. Miskovic, N.; Nad, D.; Rendulic, I. Tracking divers: An autonomous marine surface vehicle to increase diver safety. IEEE Robot. Autom. Mag. 2015, 22, 72–84. [CrossRef] Remote Sens. 2020, 12, 3974 17 of 17

18. Bruno, F.; Lagudi, A.; Muzzupappa, M.; Lupia, M.; Cario, G.; Barbieri, L.; Passaro, S.; Saggiomo, R. Project VISAS: Virtual and Augmented Exploitation of Submerged Archaeological Sites-Overview and First Results. Mar. Technol. Soc. J. 2016, 50, 119–129. [CrossRef] 19. Zingaretti, S.; Scaradozzi, D.; Ciuccoli, N.; Costa, D.; Palmieri, G.; Bruno, F.; Ritacco, G.; Cozza, M.; Raxis, P.; Tzifopanopoulos, T.; et al. A Complete IoT Infrastructure to Ensure Responsible, Effective and Efficient Execution of Field Survey, Documentation and Preservation of Archaeological Sites. In Proceedings of the 2018 IEEE 4th International Forum on Research and Technology for Society and Industry (RTSI), Palermo, Italy, 10 September 2018; pp. 1–6. 20. Bruno, F.; Barbieri, L.; Mangeruga, M.; Cozza, M.; Lagudi, A.; Cejka,ˇ J.; Liarokapis, F.; Skarlatos, D. Underwater augmented reality for improving the diving experience in submerged archaeological sites. Ocean Eng. 2019, 190, 106487. [CrossRef] 21. Bühlmann, A.A. Decompression—Decompression Sickness; Springer Science & Business Media: Berlin, Germany, 2013; ISBN 9783662024096. 22. Bühlmann, A.A.; Völlm, E.B.; Nussberger, P. Tauchmedizin: Gasembolie—Dekompression Dekompressionskrankheit Dekompressionscomputer; Springer: Berlin, Germany, 2013; ISBN 9783642559396. 23. Baker, E.C. Understanding M-values. Immersed 1998, 3, 23–27. 24. Brewka, G. Artificial intelligence—A modern approach by Stuart Russell and Peter Norvig, Prentice Hall. Series in Artificial Intelligence, Englewood Cliffs, NJ. Knowl. Eng. Rev. 1996, 11, 78–79. [CrossRef] 25. Schreiner, H.R.; Kelley, P.L. A Pragmatic View of Decompression. In Underwater Physiology; Lambertsen, C.J., Ed.; Academic Press: Cambridge, MA, USA, 1971; pp. 205–219, ISBN 9780124347502.

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).