Research on algorithms for autonomous navigation of ships

The paper reports the most recent results of a research project dedicated to the development of a path planning module, constituting a part of an intelligent control system for ships—a Guidance, Navigation, and Control (GNC) system. The paper describes the assumptions, carried out research tasks, and preliminary simulation and real experiments results. The main contribution is the development and validation of new algorithms for path planning and collision avoidance of ships. Two algorithms are introduced and tested—one using a heuristic approach and the other one applying a deterministic method. The input data to the algorithms are real navigational data registered from the navigational equipment of a ship Horyzont II. Simulations were performed in the MATLAB environment, while for real experiments a group of mobile platforms and an Indoor Positioning System were used. The outcome of the research will affect the development of new solutions in the area of autonomous navigation of ships, what will contribute to the achievement of safer and more efficient shipping.

is developing, Konsberg Gruppen introduced the concept of a full-electric 120 teu autonomous ship called Yara Birkeland (Kongsberg Maritime AS 2018), while in China the Wanshan Marine Test Field, a testing site for unmanned ships, is being constructed (CCS 2018).
In order to outline the background and significance of the ship's trajectory planning methods presented in this paper, a review of the recent literature dedicated to path planning and collision avoidance of a ship has been carried out.
The classical representative of the stochastic methods is the evolutionary algorithm (EA), which became very popular in application to ship's path planning. Recent approaches utilizing this algorithm were introduced, e.g., by Tam and Bucknall (2010) and Szlapczynski and Szlapczynska (2012). The main limitations of an algorithm based upon evolutionary computations might be their relatively long computational time (even hundreds of seconds) and problems with repeatability of solution for the same input data. Other methods classified to stochastic group are the swarm-based approaches such as the Particle Swarm Optimization (PSO) (Chen and Huang 2012).
One of the most promising and very popular deterministic optimization method used for path planning is the potential field approach, utilized in Montiel et al. (2015) (Bacterial Potential Field -BPF), Naeem et al. (2016) (Artificial Potential Field -APF) and Xue et al. (2011) (Potential Field method -PFM). Another proposal is an application of the fast marching method (FMM) (Song et al. 2017) and Liu and Bucknall (2015). A different deterministic approach was proposed by Tam and Bucknall (2013) (Cooperative path planning algorithm -CPP).
Other recent approaches include application of artificial neural networks (ANN) (Simsir et al. 2014), fuzzy logic (FL) (Mohamed-Seghir 2014), and differential games (DG) (Lisowski 2016). All of the above-mentioned most recent proposals are compared in Table 1.
The analysis of these approaches leads to the conclusion, that the development of an effective path planning algorithm for dynamic environments, applicable in nearreal time systems, constitutes an open research problem. All of the above-mentioned approaches have some limitations and there still exists a space for some improvement with regard to run time, optimality of solution, and constraints consideration. A big challenge is also the validation of a trajectory planning approach; therefore, most of the existing methods were validated by simulations with the use of simple scenarios without the usage of real navigational data. This was the motivation to carry out the presented research.
The project presented in this paper fits in the recent trends, dealing with the development of algorithms for autonomous navigation of ships. The aim of the presented research is the development of new, effective algorithms for calculation of a safe, optimal trajectory for a ship in a collision situation at sea. The method has to be

Intelligent safe ship control system
The general structure of a modern safe ship control system, called the Guidance, Navigation, and Control (GNC) system (Fossen 2011), is shown in Fig. 1. The GNC system consists of three main subsystems: the Guidance System, performing path planning; the Control System, executing motion control; and the Navigation System, measuring motion parameters (ship's positions, courses, and speeds). The main component of the Guidance System is called the Trajectory Generator (TG), which is an Fig. 1 Guidance, Navigation, and Control system advanced optimization algorithm for calculation of a safe, optimal trajectory for a ship.

Assumptions
Ship's trajectory planning is a complex optimization task with various restrictions and requirements to be considered. The following assumptions were defined in the process of solving the ship's trajectory planning problem applied in this research: -availability of navigational data describing the current situation at sea; -the International Regulations for Preventing Collisions at Sea (COLREGs) compliance of the calculated trajectory; -static (lands, shallows) and dynamic (target ships -TSs) obstacles taken into account; -safe distance (D S ) taken into account; -trajectory calculated between the current own ship (OS) position and the defined final waypoint of the trajectory; -TSs maintain their motion parameters; -weather conditions (visibility) taken into account.
These data are registered with the use of navigational equipment such as a radar with the Automatic Radar Plotting Aid (ARPA), the Automatic Identification System (AIS), the Electronic Chart Display and Information System (ECDIS), a gyrocompass, a speed log, an echo sounder, the Global Positioning System (GPS), or the Differential Global Positioning System (DGPS). The COLREGs fulfilment by the algorithm means calculation of adequately large course change maneuvers (rule 8b) and a maneuver on the relevant side of the ship (rules 13, 14, & 15). Rule 17 of COLREGs defining the action to be taken by stand-on vessel is also taken into account by the algorithm.
A safe distance is ensured by a proper size of a ship domain around TSs. Weather conditions such as visibility (poor or good) are also taken into account by a proper size of a TS domain. It is assumed that the TSs maintain their motion parameters (course and speed). Therefore, the solution is recalculated if changes in their motion parameters and/or new TSs are detected. Two different algorithms, a deterministic and a heuristic one, have been applied for solving the ship's trajectory planning problem.
A starting point of a trajectory is defined as the current position of an own ship. An ending point of a trajectory is defined as a next waypoint of an own ship global path. For simulation tests, it was defined as a position of an own ship 9 nautical miles ahead of its current placement.
Dynamic obstacles (target ships) are considered by taking into account the hexagon shape of the ship's domain around the current positions of target ships. COLREGs are considered by the application of a proper shape and size of the ship's domain. An extension of the ship's domain in the bow direction causes in a crossing situation (rule 15 of COLREGs) passage of an own ship behind the stern of the target ship. Enlargement of the ship's domain to the starboard side will force in the head-on situation (rule 14 of COLREGs) changing the course of an own ship to the starboard side.

Ant colony optimization algorithm
ACO belongs to the Swarm Intelligence (SI) methods. Bonabeau et al. (1999) defined SI as any attempt to build an algorithm inspired by the collective behavior of the colony of insects or other animal communities. A colony of insects is composed of a number of relatively simple interacting individuals, which can achieve a lot by their interaction. The main features of a colony of insects, used for problem solving, are: -self-organization, -flexibility, -robustness.
Flexibility of a colony helps it to adapt to changing environments, while robustness allows it to operate even if some individuals do not perform their tasks. Colonies of insects mastered the tasks such as foraging, building, or expanding their nest, by effective division of work among individuals. The knowledge gained during observation of the colonies behaviors allows for its usage in the engineering and computer science.
The Ant Colony Optimization (ACO) algorithm is a heuristic method inspired by the ant colony foraging behavior. ACO was introduced by Dorigo and Stutzle (2004). Its first application was solving the combinatorial optimization problem called the Travelling Salesman Problem. Ants, when searching for food, use a special mechanism to find the shortest path between the food source and their nest. They communicate with each other and with the environment by depositing a chemical substance on the ground, called a pheromone. The pheromone trail is used by the ants to transfer information to other individuals in the colony. This mechanism is called stigmergy.
This trail-lying and trail-following behavior, observed in colonies of real ants, is applied to strengthen parts of good solutions in the ACO algorithm. Artificial ants put the virtual pheromone trail on their paths, what enables to keep good solutions in the memory, so that they can be used to obtain better solutions in the future. In order to avoid the algorithm's convergence to a local minimum, the pheromone evaporation is also applied.
In ACO approach, a graph composed of possible OS positions is constructed, taking into account all of the obstacles. After that ACO calculations are carried out. They include: ACO data initialization includes the definition of parameters such as α and β coefficients, initial pheromone trail amount at each of the possible waypoints, pheromone evaporation coefficient, number of ants, maximum number of steps to be made by an ant, and number of iterations.
At the solution construction stage, every ant constructs its path from the current OS position to the next waypoint, as shown in Fig. 3. The ant stops its search, when it is located in the final waypoint or it reaches the maximum number of steps.
At every step, an ant chooses the next OS position (vertex on the graph) with the use of the action choice rule, which works similarly to the roulette wheel selection used in Evolutionary Algorithms. The probability of choosing the next vertex is defined by Eq. 1. It depends on the pheromone trail amount deposited (τ wp j (t)) on the neighboring vertex and a heuristic information called visibility (η wp ij ), which is expressed as the inverse of the distance between the current vertex (i) and the neighboring vertex (j ). When the path constructed by the ant is shorter than the shortest path found so far, then it becomes the shortest path.
The pheromone trail update procedure, defined by Eq. 2, is composed of two stages: -pheromone evaporation, -pheromone deposit.
In the pheromone evaporation, the pheromone trail amount is reduced for all vertices by a defined value. In the pheromone deposit, a certain value of the pheromone trail is added to all vertices belonging to the paths constructed by ants at the solution construction stage.
After that the shortest path found by the ants in the current iteration is saved. The fitness function applied for evaluation of the ant's paths is defined by Eq. 3. After the maximum number of iterations is reached or the maximum run time is achieved, the shortest path is returned as a final solution.

Trajectory base algorithm
The Trajectory Base Algorithm (TBA) is a deterministic approach. Its operation is based upon searching a base of trajectories, which constitute candidate solutions to the problem, in order to find the best solution for the regarded collision situation. Trajectories generated with the use of an exemplary rule are shown in Fig. 4. TBA evaluates trajectories stored in the database one after another until it finds a trajectory solving the considered navigational situation. The trajectory evaluation process is based upon the division of the trajectory into a number of sections. After that, for every section, the algorithm checks whether the instantaneous positions of an own ship and target ships do not cause a collision. When a collision is detected, the trajectory is rejected and the next trajectory is collected from the database for evaluation.
Trajectories in the database are sorted according to increasing value of their fitness function. The best trajectory is the trajectory with the minimal value of the fitness function, which is defined (in the same way as in ACO) as the length of a trajectory. This approach causes a significant reduction of the run time of the algorithm, because not all of trajectories are evaluated, but only as many as it is needed to find the best solution. COLREGs compliance of the trajectory is ensured by a proper shape and size of the TS domain. When the algorithm finds the best trajectory not exceeding the constraints, is stops the selection process and the OS course at every line segment of the trajectory is calculated. After that the solution is presented to the user in a graphical and numerical form.

Real data registration
The real navigational data describing the current situation at sea were registered during the Horyzont II voyages in 2018. Horyzont II, shown in Fig. 5, is a Research/Training ship owned by Gdynia Maritime University. The functions of Horyzont II include the following: conducting research, conducting training of students, and transporting equipment of Polish Academy of Sciences to the Polish scientific bases on Spitsbergen. In Table 2, the main technical parameters of the vessel are listed. Figure 6 shows the bridge interiot of the ship, while in Fig. 7 the installation for data registration is presented.
Input data to the algorithm are registered from ARPA with the use of the NMEA standard, which is a serial asynchronous data transmission protocol used for communication between marine electronic equipment and external devices. The standard  The standard repetition time of OSD sentence is 1 second and of TTM sentence is 10 seconds. The OSD and TTM sentences structures are given in Fig. 8, while exemplary OSD and TTM sentences registered on board Horyzont II are shown in Fig. 9.

Simulation tests
The algorithms were implemented in the MATLAB environment. Simulation studies were carried out with the use of a PC with an Intel Core 2 Duo E7500 2.93 GHz processor, 4GB RAM, 64-bit Windows 7 Professional. The parameters of ACO used in simulations were: τ 0 = 1, ρ = 0.1, α = 1, β = 2, iterations = 20 and ant number = 10. Two exemplary test cases have been presented in the paper. In Table 3, input data for test case 1 are listed. The data constitute a real navigational situation registered with the use of a Furuno radar with ARPA on board the ship Horyzont II. Column 1 Fig. 7 The computer for data registration connected to the Furuno radar with ARPA includes numbers of the ships as marked in Fig. 10. Own ship is marked with 0, and target ships with consecutive numbers. Test case 1 is an encounter situation with four target ships. In the following columns of Table 3 position and motion parameters of the ships are given, such as the courses in degrees, speeds in knots, distances from an own ship in nautical miles and bearing relative to true north in degrees, what means that the direction toward the geographic North is used as a reference point.
Solutions for test case 1 are presented graphically in Fig. 10. The blue line presents the trajectory calculated by both algorithms (ACO and TBA). The areas around the target ship's positions present the target ship's domains. The ship's domains marked by dashed lines present target ship's positions at the moments, when an own ship is placed at the course alteration points. The ship's domains marked by solid lines show the target ship's positions, when an own ship is placed at the final waypoint. Analysis of the graphical results for test case 1 confirms that the determined own ship trajectory is a safe trajectory, which allows the own ship to pass from the start waypoint to the final waypoint avoiding all of the target ships. The determined own ship trajectory is compliant with rule 8b of COLREGs, because the calculated own Numerical results for test case 1 are shown in Table 4. The results include the run time of the algorithms in seconds, the distance of the calculated trajectories in nautical miles, and the course alterations in degrees, needed to be executed by an own ship. Both algorithms returned the same solution for test case 1, composed of two course changes, by 14 degrees to the starboard side and after that by 25 degrees to the port side. The difference was is the run time of the algorithms. TBA returned a solution in 0.2 s, while ACO needed about 10 s.
Test case 2 dealt with an encounter situation with eighteen target ships, also registered on board the ship Horyzont II in July 2018 during its XLI voyage to Spitsbergen.  Input data for this test case are listed in Table 5. The graphical presentation of own ship safe trajectories calculated for test case 2 by ACO and TBA are shown in Fig. 11. The graphical results confirm that the own ship trajectory is a safe trajectory, enabling it to pass to the final waypoint without colliding with any of the target ships. The own ship trajectory is also compliant with rule 8b of COLREGs, because all of the determined course changes are large enough. It also fulfills rule 15 of COLREGs, because the own ship gives way to the vessel number 4.
Numerical results for test case 2 are given in Table 6. TBA returned a shorter trajectory than ACO by 1.5 nautical miles in about 1 s, composed of three course changes, by 18 degrees to the port side, after that by 18 degrees to the starboard side and finally by 19 degrees also to the starboard side. The run time of ACO was about 30 s and the trajectory was composed of two course change maneuvers, by 21 degrees to the port side and after that by 48 degrees to the starboard side.
Analysis of the results enable to state the following remarks: -both algorithms return safe own ship trajectories, -both algorithms return solutions compliant with COLREGs, -for some case, both algorithms return the same trajectory, while for other TBA return shorter trajectory that ACO,

Experimental studies
Preliminary experimental studies of the algorithms were conducted with the use of a system composed of a group of mobile platforms and an Indoor Positioning System (IPS) for localization of the moving objects. The IPS (Pozyx Labs BVBA 2018) is composed of tags placed on mobile platforms, providing information about their position and direction of movement, and four nodes (anchors) with known positions. The tag contains an ultra-wideband transceiver and an inertial measurement unit DWM1000 from DecaWave for measuring the orientation of an object, including accelerometers, gyroscopes, and magnetometers. The mobile platforms DFRobot Pirate-4WD (Zhiwei Robotics Corp 2018) with the dimensions of 200 × 170 × 105 mm (length × width × height) and a speed of up to 0.9 m/s, equipped with 4 DC motors and characterized by differential-drive steering, were used in the experiments. The results of an exemplary experimental test for situation with two static obstacles in the environment are shown in Fig. 12. The mobile platform is marked as 0×6973, Fig. 12 Results of experimental test for an encounter situation with two static obstacles registered with the use of an Indoor Positioning System

Fig. 13
Results of experimental test for an encounter situation with one dynamic obstacle registered with the use of an Indoor Positioning System static obstacles are marked as 0×6e42 and 0×6e34. Objects marked by 0×697b, 0×6924, 0×6929, and 0×6909 are the anchors of the IPS. The results of an exemplary experimental test for situation with one dynamic obstacle, marked as 0×6e42, are shown in Fig. 13. The graphical presentation of results confirm that the trajectory calculated by the algorithm is a safe trajectory and that its execution will not cause a collision with the obstacles.

Conclusions
The paper deals with the problem of ship's safe trajectory planning in a collision situation at sea. The main goal of the presented research was to develop and test new path planning algorithms for ships, what will contribute to achieve safer shipping and progress in autonomous navigation.
Presented results lead to the following conclusions: -the TBA and ACO algorithms are capable of finding a ship's safe trajectory in collision situations at sea, what was confirmed by simulation studies with the use of real navigational situations registered on board the ship Horyzont II, -the run time of both algorithms does not exceed 1 minute, therefore the algorithms are suitable for use in commercial systems.
Further works will include more extensive test with the use of mobile platforms and tests of the algorithm in real conditions on board the ship Horyzont II during voyages.

Funding information
The author received financial support from The Nippon Foundation in Japan and the International Association of Maritime Universities (IAMU) .
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.