1. Introduction
In recent years, autonomous navigation technology has been widely used in many fields, and the development of unmanned vehicles, unmanned aircraft and unmanned surface vehicles (USVs) is in full swing [
1,
2,
3]. Autonomous ships represented by USVs have received key attention and investment in research and development from maritime powers for their unique advantages [
4,
5,
6,
7]. Current main research on USV technology includes path planning and decision-making [
8,
9], navigation and positioning [
10], motion control [
11,
12,
13], intelligent perception [
14] etc. in which the path planning problem needs to be solved in the autonomous navigation and mission planning of USV. The path planning problem can be divided into global path planning based on a priori environmental information and local path planning problem based on sensor information. Furthermore, the algorithms for global path planning include A* algorithm [
15], Dijkstra [
16], ant colony optimization algorithm [
17], etc. The local path planning includes the dynamic window approach (DWA) [
8,
18,
19], the velocity obstacle (VO) [
1], artificial potential field (APF) [
20] method, etc. Path planning tries to ensure that the ship can reach the end point safely and quickly in the water environment, better path planning can help the unmanned ship to reach the endpoint with more reasonable speed, less energy consumption and higher efficiency. Furthermore, good path planning can help solve the problem of autonomous collision avoidance. The autonomous collision avoidance technology is a key element in the development of autonomous navigation. Autonomous collision avoidance technology is an important part of autonomous ships and is also a hot issue in the research of USVs. The global path planning of USVs in known environments can ensure the avoidance of static obstacles. However, for the avoidance of dynamic obstacles in unknown environments, there are many limitations, such as the ignorance of the provisions of international regulations for preventing collisions at sea (COLREGs) [
21], poor real-time performance [
22,
23] etc. Therefore, this paper is dedicated to studying the dynamic obstacle avoidance problem of USV under the rule of COLREGs. Path planning problem of global path planning such as the A* algorithm can find the shortest path between the starting point and the endpoint, but the disadvantage is that it cannot effectively avoid dynamic obstacles and easily falls into the local optimum; similarly, the Dijkstra algorithm can find the optimal path but the calculation is time-consuming, inefficient and cannot effectively avoid dynamic obstacles. Therefore, the local obstacle avoidance method is generally used for dynamic obstacles.
Some solutions have been proposed for dynamic obstacle avoidance of USVs. Han-Jin Lee, et al. developed an expert system and action space search mothed. Fuzzy theory is used to reason the degree of collision risk. An expert system for ship space search based on maritime traffic rules is constructed, and the A* search method is used to avoid collision [
24]. However, the timeliness of the A* algorithm is poor and it is easy to fall into the local optimum, resulting in a less than ideal real-time performance of the overall system. Zhao, et al. developed a USV real-time obstacle avoidance system to evaluate the ship collision risk by the evidential reasoning (ER) theory. An optimal interactive collision avoidance (ORCA) algorithm is proposed to determine the collision avoidance maneuver in accordance with COLREGs [
25]. However, the calculation of the ship collision risk evaluation using ER theory is complicated. Namgung, H proposed a local route planning method that uses a fuzzy inference system based on near-collision (FIS-NC), the ship domain, and velocity obstacle (VO) to take collision avoidance actions under the COLREGs rule. FIS-NC is used to determine the collision avoidance timing [
26]. The method can effectively avoid dynamic obstacles in this reference. However, the combination of the ship’s domain and velocity obstacle method in which ellipses are used increases the complexity of calculating the timing of collision avoidance.
Among them, the DWA is a dynamic window method based on the kinematics and dynamics of the robot, where a series of discrete values are sampled in the control space, and the discrete values are used to simulate the trajectory of the future period and evaluate it with a cost function, and then the highest rated trajectory is selected for the USV. For example, Li et al. proposed an improved DWA algorithm, which considered the relationship between the size of the robot and the free space between obstacles, and used LIDAR to improve the perception accuracy of the distance to obstacles, but it did not consider the characteristics of the USV’s movement and did not match the actual USV’s navigation state [
27]. Chen et al. fused the A* algorithm and the DWA algorithm for local path planning. The marine environment condition added to the cost function of the DWA algorithm obtained the dynamic relationship between the ship’s speed and obstacle distance under different sea conditions. However, they did not consider the volume factor of the USV and the constraints of the COLREGs, which may lead to the unreasonable obstacle avoidance path selected by the DWA [
8]. Meanwhile, Kim et al. proposed a DWA algorithm (CCDWA) satisfying the COLREGs, which predicts the hazardous situation of the USV based on the distance to the closest encounter and the minimum time to encounter and then meets the obstacle avoidance requirements of the COLREGs by improving the DWA algorithm. However, Kim et al. did not consider the dynamic change of the weight of the velocity term coefficients and the obstacle distance term coefficients in the cost function of the DWA algorithm, resulting in a suboptimal performance of the algorithm [
21].
To this end, this paper proposes an improved DWA approach to obstacle avoidance for USVs respecting the COLREGs. According to the rule in COLREGs, a ship needs to take timely obstacle avoidance measures when an obstacle is detected within the navigational safety zone. It is inevitable that the control algorithm of the USV is required to have a very high timeliness constraint To improve the algorithm timeliness, the PSO algorithm [
28,
29] is used to find the optimal speed pair during the iteration of the DWA algorithm, which reduces the running time of the basic DWA algorithm. At the same time, to deal with the various complex situations encountered in COLREGs, the DWA algorithm is improved using a fuzzy control algorithm to cope with the changes in distance and relative speed between the USV and the obstacle and to achieve dynamic obstacle avoidance.
This paper is organized as follows:
Section 2 briefly describes the DWA model of a USV that obeys COLREGs rules. In
Section 3, we describe the improved part of the DWA algorithm, based on the combination of PSO and fuzzy control algorithm and DWA algorithm. The flow of the collision avoidance algorithm is presented in
Section 4.
Section 5 provides the simulation and experimental results.
Section 6 concludes this paper.
3. USV’s DWA Model Considering COLREGs
According to COLREGs Chapter 1, Article 1, these rules shall apply to all vessels upon the high seas and in all waters connected therewith navigable by seagoing vessels, so research on USVs should strictly comply with the rules. Dynamic obstacle avoidance research on USVs must also comply with the COLREGs, which state that there are three encounter scenarios for USV’s obstacle avoidance. Furthermore, for each encounter scenario, the USV needs to consider different obstacle avoidance rules. Since the conventional DWA algorithm does not incorporate the constraints of COLREGs, the obstacle avoidance model must be reconstructed to comply with these constraints. In this paper, we use a model of the ship domain to make the path calculated by the conventional DWA algorithm complying with the rules of COLREGs.
3.1. Division of USVs Encounter Situations
In COLREGs rules 13 to 15, three situations of encounter and the corresponding rules of avoidance are proposed, namely the overtaking situation, the head-on situation and the crossing situation, as shown in
Figure 2.
- (1)
Overtaking situation: A vessel shall be deemed to be overtaking when coming up with another vessel from a direction more than abaft her beam. That is, in such a position with reference to the vessel she is overtaking, and the overtaken boat should give way. At the same time to facilitate the needs of the experiment, in this paper, the USV overtakes from the left side of the obstacle ahead.
- (2)
Head-on situation: When two power-driven vessels are meeting on reciprocal or nearly reciprocal courses, there is a risk of collision. Each vessel shall alter her course to starboard so that each vessel shall pass on the port side of the other vessel.
- (3)
Crossing situation: When two power-driven vessels are crossing, there is a risk of collision. The vessel which has the other on her own starboard side shall keep out of the way.
3.2. DWA Model
The traditional DWA algorithm does not consider the compliance and adaptation of USVs to some of the COLREGs, so the algorithm needs to be improved such that the speed pairs filtered by the algorithm and the formed avoidance paths meet the requirements of the collision avoidance rules. According to article 16 of the COLREGs, every vessel which is directed to keep out of the way of another vessel shall, so far as possible, take early and substantial action to keep well clear. The timing of taking avoidance action, the magnitude of avoidance, the timing to resume navigation and the safe meeting distance are the four key factors for USV to take avoidance action. So building a model to meet these four key factors and incorporate them into the DWA algorithm is the key to developing an USVs’ avoidance method that meets the COLREGs.
Approaches to adopting a model for the timing of avoidance actions include those based on the ship’s domain, those based on the ship’s collision hazard, and those using time or distance to determine, among others. In this paper, the ship domain approach is used to determine the timing of avoidance action. According to Szlapczynski, R et al, it can be learned that the ship domain [
32,
33,
34] is generally elliptical, as shown in
Figure 3. In this paper, the elliptical ship domain is expanded to a circular ship domain, which increases the ship’s domain and leaves enough space for the USV to avoid obstacles on the side thus making the USV a better avoidance capacity, as shown in
Figure 4, where
L is the length of the USV and the diameter of the circumscribed circle of the USV model. The circumscribed circle is the collision area of the USV. The collision judgment condition is given in (
4), where
is the Euclidean distance between the center of the USV and that of the obstacle. When the connecting distance between the obstacle and the center point of the USV is less than or equal to
, it means that the USV has collided with the obstacle. The area where the ship takes the obstacle avoidance opportunity is a circle with a radius of
. The conditions for the obstacle avoidance opportunity are given in Formula (
5). When the connecting distance between the obstacle and the center point of the USV is greater than
and less than or equal to
, the obstacle avoidance opportunity is met and the obstacle avoidance action is taken.
According to article 16 of COLREGs, avoidance actions should be taken as much as possible. In terms of avoidance magnitude, the traditional DWA algorithm can achieve the priority of keeping the USV away from the obstacles by adjusting the weight coefficients in the cost function. However, when the USV takes a large avoidance action, it will lead to a reduction in the speed of the USV. Therefore the adjustment of the weight coefficients in the cost function is the key to balancing the avoidance magnitude of the USV and the speed of the USV. The resumption timing should be carried out after the USV takes the avoidance action. Furthermore, the resumption model is that when the USV does not satisfy both Equations (
4) and (
5), the USV continues to sail according to the DWA algorithm.
The USV’s DWA model developed above to satisfy the COLREGs also suffers from the following problems.
- (1)
As USV has to navigate under COLREG conditions, higher requirements are placed on the timeliness of the control, and the traditional DWA algorithm still has a long-running time and does not meet the system requirements.
- (2)
There is a reasonableness problem between the avoidance magnitude of the USV and the speed of the USV when it takes avoidance action. The fact that the fixed weight of the cost function in the conventional DWA algorithm makes the USV unable to cope with the changes in the environment, especially the need to comply with COLREGs.
6. Experiments and Analysis
To satisfy the COLREGs, the traditional DWA algorithm is improved by using the PSO algorithm to find the optimal speed pair, which helps the DWA algorithm to find the required speed pair quickly due to the tendency of the PSO algorithm, and finally by adding fuzzy control to dynamically adapt the weight coefficients in the cost function to cope with the changes in the environment. The initial parameter settings of the DWA algorithm are shown in
Table 3. The DWA algorithm and its improved version are simulated and validated according to several encounter situations classified by COLREGs, as shown in
Figure 10,
Figure 11,
Figure 12,
Figure 13,
Figure 14,
Figure 15,
Figure 16,
Figure 17,
Figure 18,
Figure 19,
Figure 20,
Figure 21,
Figure 22,
Figure 23,
Figure 24,
Figure 25,
Figure 26 and
Figure 27. The ship avoidance domain is the blue circle, the red circle is the USV collision area, the black dot is the obstacle, the blue x is the endpoint, the red line is the USV trajectory and the black dashed line is the obstacle trajectory. The initial state information of the obstacle is shown in
Table 4 and the initialization parameters of the PSO algorithm are shown in
Table 5. According to the COLREGs, in the encounter situation, the USV should turn to the right and pass from the port side of the obstacle. In the overtaking situation, the USV can pass from both sides of the obstacle, and in this paper, all of them are passed from the port side of the obstacle. In the case of the crossing, we consider the case where the obstacle crosses on the starboard side of the USVs.
The hardware configuration of the computer for the simulation in this paper: the CPU was an Intel I5-10500 with 16 G running memory and the graphics card was a GTX1050. Software configuration: the OS was Win11, the IDE was PyCharm Community Edition 2021.3.3, an the Python version was 3.9.9.
6.1. Simulation Results of the DWA Algorithm in Compliance with COLREGs
The process of USV avoiding obstacles for the head-on situation is shown in
Figure 10.
Figure 11 shows the variation of linear velocity, angle and obstacle distance with respect to the time of USV in the head-on situation. The angle is 0
in the positive direction of the
X-axis and 90
in the positive direction of the
Y-axis in this paper. The initial distance between the USV and the obstacle is 7 meters, and the initial angle is 90
. At 15.26 s, an obstacle appeared in the collision avoidance area of the USV, and the USV began to take obstacle avoidance action, and the speed changed. At the same time, the distance between the USV and the obstacle gradually decreases, and the angle of the USV was constantly adjusted to avoid obstacles and drive towards the endpoint.
The process of USV avoiding obstacles for the overtaking situation is shown in
Figure 12.
Figure 13 shows the variation of USV linear velocity, angle, and obstacle distance with respect to time. At 14.76 s, the USV took the obstacle avoidance action and turn to the left, and the angle of the USV increased. In
Figure 13, the angle changed three times after the 20 s, which the obstacle was in a critical situation. This critical situation means that the obstacle is just at the edge of the USV obstacle avoidance field. The distance between the USV and the obstacle decreased continuously from 7 m at the beginning, and then the distance increased due to the three critical situations between the USV and the obstacle. As the two move in the same direction, the distance between the USV and the obstacle becomes smaller and smaller.
The navigation process of the USV avoiding obstacles for the crossing situation is shown in
Figure 14.
Figure 15 shows the variation of linear speed, angle, and obstacle distance with time during sailing. At the 17.37 s, the USV took an obstacle avoidance action by turning to the right and reducing the angle. During the crossing, the distance between the USV and the obstacle will approach the minimum value (about the 18 s in
Figure 15), and then after the crossing, the distance between the two will begin to increase.
Figure 10.
COLREGs-compliant DWA algorithm for head-on situation.
Figure 10.
COLREGs-compliant DWA algorithm for head-on situation.
Figure 11.
Parameters of the CCDWA algorithm for Head-on situation.
Figure 11.
Parameters of the CCDWA algorithm for Head-on situation.
Figure 12.
DWA algorithm for overtaking situation in compliance with COLREGs.
Figure 12.
DWA algorithm for overtaking situation in compliance with COLREGs.
Figure 13.
Parameters of the CCDWA algorithm for overtaking situation.
Figure 13.
Parameters of the CCDWA algorithm for overtaking situation.
Figure 14.
Crossing situation for DWA algorithms conforming to COLREGs.
Figure 14.
Crossing situation for DWA algorithms conforming to COLREGs.
Figure 15.
Parameters of the CCDWA algorithm for crossing situation.
Figure 15.
Parameters of the CCDWA algorithm for crossing situation.
6.2. Simulation Results on the Improvement of the PSO-Based
Search Method
The obstacle avoidance process of the USV for the head-on situation is shown in
Figure 16 and
Figure 17 shows the parameter changes of the USV. At 3.93 s, the USV began to take obstacle avoidance action, and then the angle was continuously adjusted until the obstacle was far away from the range of the ship. The USV accelerated at the start and slowed down when it encountered an obstacle. As the angle was constantly adjusted, the speed of the USV was constantly changing. The distance between the USV and the obstacle first decreased and then increased as the obstacle avoidance was completed.
The obstacle avoidance process of the USV for the overtaking situation is shown in
Figure 18 and
Figure 19 shows the parameter changes of the USV. In
Figure 19, the USV has two large changes in the angle during obstacle avoidance, that is, The first time is when the USV takes an obstacle avoidance action, and the second time is when the USV is at a critical distance from the obstacle at the 18.53 s. Because of the same direction, the distance between the USV and the obstacle becomes smaller and smaller.
The obstacle avoidance process of the USV for the crossing situation is shown in
Figure 20 and
Figure 21 shows the change of parameters during the USV driving process. At the 6.72 s, the USV took obstacle avoidance action. As the USV continued to drive, the distance between the USV and the obstacle was getting closer and closer. When the distance between USV and the obstacle was less than 2 m, the speed decreased sharply.
Figure 16.
Head-on situation for the improvement of the PSO-based search method.
Figure 16.
Head-on situation for the improvement of the PSO-based search method.
Figure 17.
Parameters of the PSO-CCDWA algorithm for head-on situation.
Figure 17.
Parameters of the PSO-CCDWA algorithm for head-on situation.
Figure 18.
Overtaking situation for the improvement of the PSO-based search method.
Figure 18.
Overtaking situation for the improvement of the PSO-based search method.
Figure 19.
Parameters of the PSO-CCDWA algorithm for overtaking situation.
Figure 19.
Parameters of the PSO-CCDWA algorithm for overtaking situation.
Figure 20.
Crossing situation for the improvement of the PSO-based search method.
Figure 20.
Crossing situation for the improvement of the PSO-based search method.
Figure 21.
Parameters of the PSO-CCDWA algorithm for crossing situation.
Figure 21.
Parameters of the PSO-CCDWA algorithm for crossing situation.
6.3. Simulation Results on the Improvement of Weighting Coefficients Based on Fuzzy Control
Figure 22 shows the obstacle avoidance process of the USV for the head-on situation, and
Figure 23 shows the parameter changes of the USV. At the 6.43 s, the USV took the obstacle avoidance action and turned to the right. After completing the obstacle avoidance, the USV turned left and drive to the end point. Therefore, the USV angle first increased and then decreased in
Figure 23.
Figure 24 shows the obstacle avoidance of the USV for the overtaking situation, and
Figure 25 shows the parameter changes of the USV. At the 7.58 s, the USV took the obstacle avoidance action to the left and triggered a critical situation, and finally completed the obstacle avoidance. The distance between the USV and the obstacle also decreased first, then increased, and then decreased. Because of the same move direction, the distance between the USV and the obstacle becomes smaller and smaller.
Figure 26 shows the obstacle avoidance process of the USV for the crossing situation, and
Figure 27 shows the parameter changes of the USV. At 7.85 s, the USV started to take obstacle avoidance action by turning right, then the USV angle decreased. When the distance between the two is reduced to 2 m, the speed of the USV was reduced to the minimum.
Figure 22.
Head-on situation for the improvement of weighting coefficients based on fuzzy control.
Figure 22.
Head-on situation for the improvement of weighting coefficients based on fuzzy control.
Figure 23.
Parameters of the FUZZY-CCDWA algorithm for head-on situation.
Figure 23.
Parameters of the FUZZY-CCDWA algorithm for head-on situation.
Figure 24.
Overtaking situation for the improvement of weighting coefficients based on fuzzy control.
Figure 24.
Overtaking situation for the improvement of weighting coefficients based on fuzzy control.
Figure 25.
Parameters of the FUZZY-CCDWA algorithm for overtaking situation.
Figure 25.
Parameters of the FUZZY-CCDWA algorithm for overtaking situation.
Figure 26.
Crossing situation for the improvement of weighting coefficients based on fuzzy control.
Figure 26.
Crossing situation for the improvement of weighting coefficients based on fuzzy control.
Figure 27.
Parameters of the FUZZY-CCDWA algorithm for crossing situation.
Figure 27.
Parameters of the FUZZY-CCDWA algorithm for crossing situation.
The experimental results above are shown in
Table 6, where PSO-CCDWA is the proposed improved DWA algorithm under the COLREGs, with the addition of the PSO algorithm. The FUZZY-CCDWA algorithm is an improvement to the PSO-DWA with the addition of the fuzzy control algorithm. The PSO-CCDWA algorithm reduces the running time by 44.2%, 11.2% and 28.8%, respectively, compared to the CCDWA algorithm in the three encounter scenarios. The reduced overall running time allows the USV to avoid obstacles in a shorter time. The addition of the fuzzy control component to the FUZZY-CCDWA algorithm results in a slight increase in the overall running time compared to the PSO-CCDWA algorithm. However, the total distance traveled by the USV is reduced by 15.8%, 0.9% and 2.8%, respectively, compared to the CCDWA algorithm in the three encounter scenarios, resulting in a shorter distance traveled by the USV for obstacle avoidance.
6.4. Real Ship Experiment
The object of this experiment is the “Buffalo” USV, equipped with GPS, radar and other sensors, using the industrial control computer as the upper computer of the ship. Its central processor is Intel Celeron J1900, using two STM32F409 development boards as the lower computer. The experimental equipment diagram is illustrated in
Figure 28 and the “Buffalo” is shown in
Figure 29.
Table 7 gives the parameters of the USV “Buffalo”. The experiment is carried out in the “Wisdom Lake” channel of Shanghai Maritime University in Pudong New Area, Shanghai.
Dynamic obstacle avoidance experiment is carried out on the USV according to the designed algorithm and the GPS data collected are converted from the WSG84 coordinate system to the GCJ-02 coordinate system through coordinate conversion and displayed on the map of the USV’s experimental platform, as shown in
Figure 30,
Figure 31 and
Figure 32.
Figure 30 shows the Head-on situation,
Figure 31 shows the crossing situation and
Figure 32 shows the overtaking situation. The red line in the figure is the USV’s trajectory and the green line is the obstacle trajectory. From the maps, it can be seen that the USV is able to avoid dynamic obstacles in all three encounter scenarios in accordance with the COLREGs.
Based on the data from the USV’s experimental platform,
Table 8 and
Table 9 can be obtained, which show the USV’s navigation trajectory data and the dynamic obstacle trajectory data, respectively. For dynamic obstacles, the experimental results verify that the effectiveness of the FUZZY-DWA algorithm makes the USV’s obstacle avoidance path conform to COLREGs and provides data support for subsequent USV obstacle avoidance research.
7. Conclusions
In this paper, the problem of dynamic obstacle avoidance control of USVs under COLREGs is investigated, and the improved DWA algorithm conforming to COLREGs is proposed. The timeliness problem of the traditional DWA algorithm is solved by introducing the PSO algorithm. To solve the problem that the traditional DWA algorithm cannot adapt well to environmental changes under COLREGs, the fuzzy control combined with the DWA algorithm is used to achieve dynamic adaptation of weight coefficients in the cost function of the DWA algorithm. The proposed PSO-CCDWA and FUZZY-CCDWA dynamic obstacle avoidance algorithms are experimentally validated. In the simulation, it can be learned that the USV takes the collision-avoidance action, satisfying the COLREGs when the obstacles appear in the collision avoidance domain under the three considered cases. Through comparative analysis, compared with the CCDWA algorithm, the PSO-CCDWA algorithm reduces the overall navigation time of the USV, by 44.2%, 11.2% and 28.8%, respectively, in the three encounter situations compared to CCDWA. At the same time, the FUZZY-CCDWA algorithm reduces the total distance traveled by the USV in the three encounter scenarios by 15.8%, 0.9% and 2.8%, respectively, compared to CCDWA, verifying the superiority of the proposed algorithms. Finally, the effectiveness of the proposed algorithms is further verified in the actual navigation experiment of the USV “Buffalo”. The obtained results show that the USV effectively avoids obstacles in different directions on its way from the start to the end in three cases, which provides some reference for the subsequent research and engineering application of related obstacle avoidance methods. Furthermore, in this study, some physical assumptions are made on the motion of the USV in order to simplify the motion model of the USV, and external disturbances (wind, waves, currents) are excluded for the sake of the evident experiment result of the proposed algorithm, and only the horizontal plane motion is considered. Therefore, the next stage of the research will consider the USV’s obstacle avoidance under the external disturbances and consider the robustness of the USV’s system in the presence of external disturbances.