Autonomous Obstacle Avoidance Algorithm for Unmanned Surface Vehicles Based on an Improved Velocity Obstacle Method

: Focusing on the collision avoidance problem for Unmanned Surface Vehicles (USVs) in the scenario of multi-vessel encounters, a USV autonomous obstacle avoidance algorithm based on the improved velocity obstacle method is proposed. The algorithm is composed of two parts: a multi-vessel encounter collision detection model and a path re-planning algorithm. The multi-vessel encounter collision detection model draws on the idea of the velocity obstacle method through the integration of characteristics such as the USV dynamic model in the marine environment, the encountering vessel motion model, and the International Regulations for Preventing Collisions at Sea (COLREGS) to obtain the velocity obstacle region in the scenario of USV and multi-vessel encounters. On this basis, two constraint conditions for the motion state space of USV obstacle avoidance behavior and the velocity obstacle region are added to the dynamic window algorithm to complete a USV collision risk assessment and generate a collision avoidance strategy set. The path re-planning algorithm is based on the premise of the minimum resource cost and uses an improved particle swarm algorithm to obtain the optimal USV control strategy in the collision avoidance strategy set and complete USV path re-planning. Simulation results show that the algorithm can enable USVs to safely evade multiple short-range dynamic targets under COLREGS.


Introduction
Unmanned Surface Vehicles (USVs) have broad application prospects in marine environmental monitoring, marine rights and interests maintenance, and military fields and have become a research hotspot in the field of marine intelligent equipment [1][2][3][4]. A safe and reliable path planning method is a prerequisite and allows a USV to perform various complex water surface tasks [5][6][7][8]. However, USVs are affected by many factors, such as the complex marine environment, the dynamic characteristics of USVs, and the performance of the ship-borne detection equipment, which all increase the risk of collisions with other vessels during USV high-speed navigation [9][10][11][12]. Therefore, it is difficult for USV path planning technology to complete collision detection and path re-planning quickly and accurately with less control cost in the complex marine environment.
At present, the algorithms applied for USV autonomous obstacle avoidance include the artificial potential field method, the vector field histogram method, the Set-Based Guidance (SBG) method, the dynamic window method, and the velocity obstacle (VO) method [13][14][15]. Among them, VO has the characteristics of fast response; high realtime performance; strong robustness; and simple and easy realization in the obstacle avoidance problem of intelligent agents, which is widely used for the autonomous obstacle avoidance of agents [16,17]. Fiorini et al. first proposed a VO theoretical model based on the concept of a collision cone. The idea is to construct the velocity obstacle region according to the position information and motion characteristics of the agent and the obstacle and select the feasible velocity vector according to the region involved to complete

Problem Description
USV must have the ability of autonomous obstacle avoidance during multi-vessel encounters when performing channel mapping, ship supervision, and forensics tasks on the sea surface. The USV autonomous obstacle avoidance process can be described as follows: First of all, the USV uses shipborne detection sensors to perceive surrounding vesselsthat is, to obtain the position, velocity, water surface contour, and other information of the encountering vessel in real time through its Automatic Identification System (AIS), visual system, laser, or millimeter-wave radar platform shipborne sensing equipment. Secondly, under the constraints of its dynamic characteristics and COLREGS, the USV completes collision detection and a collision threat level assessment according to the physical characteristics of the marine environment, its motion state, and the encountering vessel motion state, generating a collision avoidance strategy set. Then, according to the minimization principle of specific cost (such as control cost, energy consumption cost, etc.), the optimal collision avoidance strategy is obtained and control commands are generated to complete the autonomous obstacle avoidance in the scenario of multi-vessel encounters. Figure 1 shows the autonomous obstacle avoidance process of USV in the scenario of multi-vessel encounters.
gorithm. Simulation results are shown and analyzed in Section 5. Section 6 concludes this work.

Problem Description
USV must have the ability of autonomous obstacle avoidance during multi-vessel encounters when performing channel mapping, ship supervision, and forensics tasks on the sea surface. The USV autonomous obstacle avoidance process can be described as follows: First of all, the USV uses shipborne detection sensors to perceive surrounding vessels-that is, to obtain the position, velocity, water surface contour, and other information of the encountering vessel in real time through its Automatic Identification System (AIS), visual system, laser, or millimeter-wave radar platform shipborne sensing equipment. Secondly, under the constraints of its dynamic characteristics and COLREGS, the USV completes collision detection and a collision threat level assessment according to the physical characteristics of the marine environment, its motion state, and the encountering vessel motion state, generating a collision avoidance strategy set. Then, according to the minimization principle of specific cost (such as control cost, energy consumption cost, etc.), the optimal collision avoidance strategy is obtained and control commands are generated to complete the autonomous obstacle avoidance in the scenario of multi-vessel encounters. Figure 1 shows the autonomous obstacle avoidance process of USV in the scenario of multi-vessel encounters. USV is an underdrive, large-inertia, and strong time-delay system, and its motion state will be limited by its structure and characteristic parameters. This requires the planned path to satisfy the physical motion characteristics of USV. At the same time, affected by the physical environment characteristics of the ocean and its detection load performance, it is difficult for the USV to complete the detection of multiple vessels remotely, which requires the USV to re-plan efficiently. In addition, to ensure the safety of operations and navigation at sea, this requires the obstacle avoidance measures taken to comply with the provisions of COLREGS when the USV encounters other vessels. Based on this, this paper fully considers the above-mentioned influencing factors; constructs a multi-vessel encounter autonomous obstacle avoidance model of USV under the constraints of the USV dynamic characteristics, the encountering vessel motion characteristics, and COLREGS; and realizes the autonomous and efficient obstacle avoidance of USV is an underdrive, large-inertia, and strong time-delay system, and its motion state will be limited by its structure and characteristic parameters. This requires the planned path to satisfy the physical motion characteristics of USV. At the same time, affected by the physical environment characteristics of the ocean and its detection load performance, it is difficult for the USV to complete the detection of multiple vessels remotely, which requires the USV to re-plan efficiently. In addition, to ensure the safety of operations and navigation at sea, this requires the obstacle avoidance measures taken to comply with the provisions of COLREGS when the USV encounters other vessels. Based on this, this paper fully considers the above-mentioned influencing factors; constructs a multi-vessel encounter autonomous obstacle avoidance model of USV under the constraints of the USV dynamic characteristics, the encountering vessel motion characteristics, and COLREGS; and realizes the autonomous and efficient obstacle avoidance of USV. Combined with the principle block diagram of USV autonomous obstacle avoidance shown in Figure 1, this paper decomposes the process of USV autonomous obstacle avoidance into the following three sub-problems:

1.
Construction of a USV motion model. The USV mathematical model is the core of the ship motion and control. Establishing an accurate motion model is the prerequisite and basic guarantee for studying the autonomous obstacle avoidance of USVs. As a USV is sailing, its motion performance is greatly affected by the disturbance of the complex external environment, which is mainly reflected in the sea breeze, ocean waves, and ocean currents. Therefore, the construction of the USV motion model needs to fully consider the influence of wind, wave, current, and other external marine environmental disturbances on its motion. Under this constraint, an accurate USV motion model is constructed to determine its system state to ensure the effectiveness of the USV obstacle avoidance behavior.

2.
Efficient characterization of velocity obstacle region.
The operating environment of the USV is highly dynamic and uncertain. When its shipborne sensing equipment detects vessels that pose a threat to USV, timely and effective obstacle avoidance measures need to be taken to ensure the safety of USV navigation. The USV needs to strictly abide by the relevant regulations of COLREGS when operating at sea, and its obstacle avoidance behavior is affected by its motion model and the encountering vessel motion characteristics. Therefore, the construction of the multi-vessel encounter collision detection model needs to comprehensively consider the constraints of the above factors. The model must draw on the idea of VO through the integration of characteristics such as the USV dynamic model in the marine environment, the encountering vessel motion model, and COLREGS to obtain the velocity obstacle region in the scenario of USV and multi-vessel encounters. Based on this, two constraint conditions for the motion state space of USV obstacle avoidance behavior and the velocity obstacle region are added to the dynamic window algorithm to provide a guarantee for USV to generate a collision avoidance strategy set that is executable by the control system; on this basis, the collision threat degree of the encountering vessel is calculated, which provides a decision basis for the USV to choose the time at which to start the collision avoidance strategy.

3.
Construction of an autonomous obstacle avoidance model.
In the process of performing autonomous obstacle avoidance tasks, the USV needs to consider the minimum resource cost between a collision avoidance strategy and returning to the original path while re-planning the path so that USV can efficiently complete the autonomous obstacle avoidance task with the minimum resource cost. Therefore, the construction of the autonomous obstacle avoidance model needs to fully consider the adaptability of the model to the application environment and the application object; establish the path re-planning cost function on the premise of obtaining the minimum resource cost; and use the improved particle swarm algorithm to speed up the solving speed of the model, produce the optimal collision avoidance navigation strategy, and complete USV path re-planning.

USV Motion Model in Marine Environment
To fully consider the influence of the marine environment on USV movement, the modeling idea of the mathematical model group of ships (MMG model) is adopted to convert the influence of external disturbances such as wind, wave, and current into the force and torque acting on the USV to construct a motion model of the USV. Assuming that the mass distribution of the USV is uniform, the center of buoyancy coincides with the center of gravity and only the horizontal plane motion of USV is considered-that is, only the surge, sway, and yaw motion. The motion equation of USV can be expressed as: where η = [x, y, ψ] T , respectively, represent the longitudinal displacement, transverse displacement, and yaw angle of the USV in the inertial coordinate system; ν = [u, v, r] T , respectively, represent the longitudinal velocity, transverse velocity, and yaw angular velocity of USV in the hull coordinate system; M, C(ν), and D(ν) are the inertia matrix, Corioliscentripetal matrix, damping matrix, and rotation matrix, respectively; X = [η T , ν T ] T represents the system state of USV; τ RB and τ ED represent the force generated by the USV propulsion system and the marine environmental disturbance, respectively; and  (2): represents the control input of USV. This paper uses a VO model to avoid obstacles, and for the VO model, u = ν = [u, v, r] T . τ ED represents the disturbance effect of the marine environment on USV, and its expression is shown in Equation (3): where τ wind , τ wave , and τ current represent the interference force generated by the wind, waves, and ocean current, respectively. Expressions for these are shown in Equations (4)- (6).
where ρ a represents air density; V w represents the sea wind speed acting on the USV; A Fw and A Lw represent the area of the USV affected by the sea breeze in the positive and side directions, respectively; L represents the total length of the USV hull; C X (γ), C Y (γ), and C N (γ) are the coefficients of air resistance, which are generally obtained by a ship model test; and γ represents the wind direction angle encountered by the USV-namely, the angle between the wind direction and the head and tail connection of the hull.
where ρ represents the density of seawater; g is gravity acceleration; B represents the hull width of the USV; L represents the total length of the USV hull; T means eating water; ϕ represents the encounter angle between waves and boats; and s i (t) represents the spectrum of waves.
where ρ represents the density of seawater; V c represents the speed of the ocean current, A FC and A LC represent the area to the front and sides of the underwater part that are affected by the waves; c X (α), c Y (α), and c N (α) represent the calculation coefficients of the force and moment of the ocean current, which are generally obtained by ship model experiments; and α is the angle of encounter between the ocean current and the hull; L represents the total length of the USV hull. By substituting Equations (2) and (3) into Equation (1), we can obtain the nonlinear ordinary differential equation of the system state, as shown in Equation (7).

Efficient Characterization of Velocity Obstacle Region
A scenario of a USV encounter with other vessels during the voyage is shown in Figure 2. In Figure 2, the blue ship represents the USV and the red ship represents the encountering vessel. It can be seen from Figure 2 that when the position of the USV is within the safe distance of the encountering vessel, the two ships will collide. The condition for the USV to collide with the encountering vessels can be expressed as: ] are the positions of the USV and the encountering vessel at the time t k , respectively; ⊕ is the Minkowski vector sum operation; and · represents the Euclidean distance; ConfP represents a group of positions leading to conflicts between two ships, whose size and shape depend on the ship domain characteristics of the USV and the encountering vessel. For the convenience of expression and calculation, this paper expresses the ship domain characteristics of the USV and the encountering vessel as a circle with the length of the ship as its diameter, where the radius of the circle for each is R USV and R Encounter−i , respectively. The sum of the radius R is the radius of ConfP; the center of ConfP is the center of the encountering vessel; and P Encounter−i (·) ⊕ ConfP represents all possible location areas where two ships can collide at a certain time.
Assuming that, from time t k−1 to time t k , the USV and the encountering vessel move in a straight line at a uniform speed, then the positions of the USV and the encountering vessel at the time t k are shown in Equation (9): where P USV (t k−1 ) and P Encounter−i (t k−1 ) represent the positions of the USV and the encountering vessel at the time t k−1 , respectively. v USV (t k , t k−1 ) and v Encounter−i (t k , t k−1 ) represent the velocity vectors of the USV and the encountering vessel in the period [t k , t k−1 ), respectively. According to Equation (8), if P USV (t k ) includes P Encounter−i (t k ) ⊕ ConfP, USV will collide with the encountering vessel at the time t k . Therefore, to achieve the purpose of avoiding vessels, the USV can adjust v USV (t k , t k−1 ) to make t k time P USV (t k ) outside P Encounter−i (t k ) ⊕ ConfP.
tering vessel. For the convenience of expression and calculation, this paper expresses th ship domain characteristics of the USV and the encountering vessel as a circle with th length of the ship as its diameter, where the radius of the circle for each is USV R and -Encounter i R , respectively. The sum of the radius R is the radius of ConfP ; the center o ConfP is the center of the encountering vessel; and -( ) Encounter i ⋅ ⊕ P ConfP represents al possible location areas where two ships can collide at a certain time.

Obstacle Avoidance Principle
Goal Assuming that, from time   will collide with the encountering vessel at the time k t . Therefore, to achieve the pur pose of avoiding vessels, the USV can adjust

Characterize of Velocity Obstacle Region Based on VO
The VO algorithm is a widely used USV autonomous dynamic obstacle avoidanc algorithm. It uses the position information and motion characteristics of the USV and th encountering vessel to construct the velocity obstacle region; on this basis, it selects feasible velocity vector to complete the rapid avoidance of static or dynamic threats and has the characteristics of fast response and simple realization. The corresponding geo metric model is shown in Figure 3.

Characterize of Velocity Obstacle Region Based on VO
The VO algorithm is a widely used USV autonomous dynamic obstacle avoidance algorithm. It uses the position information and motion characteristics of the USV and the encountering vessel to construct the velocity obstacle region; on this basis, it selects a feasible velocity vector to complete the rapid avoidance of static or dynamic threats and has the characteristics of fast response and simple realization. The corresponding geometric model is shown in Figure 3.     Figure 3 shows that the velocity obstacle region characterized by the VO model is the conical area surrounded by taking P USV (t k−1 ) as the starting point to make two tangents ConfP. This area is the velocity obstacle region between the encountering vessel and the USV, denoted as RCC USV Encounter−i .

VO model
According to the VO model construction principle, if ray λ is located in RCC USV Encounter−i , the USV will collide with the encountering vessel at a certain time in the future; otherwise, it means that it is safe for the USV to navigate at the current velocity and yaw angle. RCC USV Encounter−i is the relative velocity space. When the USV conflicts with multiple encountering vessels, RCC USV Encounter−i needs to be converted into the absolute velocity space based on the USV for a unified description. We translate RCC USV ; then, the geometric model of the velocity vector set VO USV|Encounter−i , which relates to the likelihood that the USV will collide with the encountering vessel at a certain time in the future, can be obtained. Thus, VO USV|Encounter−i can be expressed as: (10) where ∃ is the presence symbol and :: is the reasoning symbol. If (t k − t k−1 ) > 0 exists, then the following formula holds. VO USV|Encounter−i represents the velocity vector set that causes the USV to collide with the encountering vessel at a certain time in the future.
In the scenario of multi-vessel encounters, the USV establishes an VO USV|Encounter−i obstacle cone for each encountering vessel and then finds the union to obtain the total VO set: Therefore, the USV can select an appropriate velocity vector from the non-VO set to avoid the encountering vessel. The USV autonomous obstacle avoidance process based on the VO method in the scenario of multi-vessel encounters is shown in Figure 4. In Figure 4, the yellow area is the obstacle cone constructed by the USV for each encountering vessel. The two large red hollow circles with a transverse line in the middle are two encountering vessels. The smaller blue hollow circle is the position of the current moment of the USV. The graph above the blue circle represents the velocity vector of the USV, where the vertical length represents the velocity of the USV and the solid circle represents the heading of the USV. Therefore, the USV can select an appropriate velocity vector from the non-VO set to avoid the encountering vessel. The USV autonomous obstacle avoidance process based on the VO method in the scenario of multi-vessel encounters is shown in Figure 4. In Figure 4, the yellow area is the obstacle cone constructed by the USV for each encountering vessel. The two large red hollow circles with a transverse line in the middle are two encountering vessels. The smaller blue hollow circle is the position of the current moment of the USV. The graph above the blue circle represents the velocity vector of the USV, where the vertical length represents the velocity of the USV and the solid circle represents the heading of the USV.  Figure 4 shows that adjusting the velocity vector outside the VO set can cause the USV to have the ability to deal with sudden threats. However, this algorithm can only guide the USV to avoid vessels, and cannot guide the USV in navigating to safe waypoints or targets under the premise of complying with COLREGS. The algorithm regards  Figure 4 shows that adjusting the velocity vector outside the VO set can cause the USV to have the ability to deal with sudden threats. However, this algorithm can only guide the USV to avoid vessels, and cannot guide the USV in navigating to safe waypoints or targets under the premise of complying with COLREGS. The algorithm regards the USV as a particle, and the planned path does not comply with the physical motion characteristics of USV, which will cause the USV system to be unstable or unable to respond. The algorithm does not assess the degree of threat posed by the encountering vessel to the USV; thus, it is impossible to determine the time at which to start the collision avoidance strategy, which will lead to the USV being unable to avoid the encountering vessel effectively and in a timely manner. This algorithm does not consider the minimum resource cost between the USV collision avoidance strategy and the return original path, which will make it difficult for the USV to efficiently complete the autonomous obstacle avoidance task with the minimum resource cost.

Multi-Vessel Encounters Collision Detection Model
The above model construction process is completed in an ideal state, ignoring COL-REGS, the USV dynamic characteristics in the marine environment, and the encountering vessel motion characteristics; thus, this paper comprehensively considers the constraints of the above factors to construct the multi-vessel encounter collision detection model.

COLREGS and Model Definition of Multi-Vessel Encounters Scenario
There are usually three types of conflicts between USVs and encountering vessels: head-on scenarios, over-take scenarios, and cross scenarios. To ensure the safety of maritime navigation, USVs need to comply with COLREGS. COLREGS mainly distinguishes and defines encounter situations between ships according to the relative azimuth angle. The calculation formula for the relative azimuth angle is shown in Equation (12).
where x USV (t k ), y USV (t k ), x Encounter−i (t k ), and y Encounter−i (t k ) are the point coordinates of the USV and the encountering vessel at the time t k . ψ Encounter−i (t k ) is the yaw angle of the encountering vessel. After obtaining the relative azimuth β between USV and the encountering vessel according to Equation (12), COLREGS defines the encountering scenario of the vessel as head-on, over-take, cross-right, and cross-left according to the relative azimuth β of the encountering vessel. The partition expression and schematic diagram are shown in Equation (13) and Figure 5, respectively.   The constraints of the COLREGS rules on the obstacle avoidance behavior of USVs are shown in Table 1, while the obstacle avoidance model is shown in Figure 6.   The constraints of the COLREGS rules on the obstacle avoidance behavior of USVs are shown in Table 1, while the obstacle avoidance model is shown in Figure 6.

Encounters Scenario COLREGS That USV Should Abide By COLREGS That the Encountering Vessel Should Abide By
Head-on USV is the avoiding party: Steering right past the starboard side of the encountering vessel.
The encountering vessel is the avoiding party: Steering right past the starboard side of USV.
Over-take USV is the avoiding party: Steering right past the starboard side of the encountering vessel or steering left past the port side of the encountering vessel.
The encountering vessel will keep its current sailing status until the threat is lifted.
Cross-right USV is the avoiding party; Slow down and steer right past the starboard side of the encountering vessel.
The encountering vessel will keep its current sailing status until the threat is lifted.
Cross-left USV will keep its current sailing status until the threat is lifted.
The encountering vessel is the avoiding party: Take corresponding obstacle avoidance measures based on the encounter scenarios formed by USV and the encountering vessel. Cross-right USV is the avoiding party; Slow down and steer right past the starboard side of the encountering vessel.
The encountering vessel will keep its current sailing status until the threat is lifted.
Cross-left USV will keep its current sailing status until the threat is lifted.
The encountering vessel is the avoiding party: Take corresponding obstacle avoidance measures based on the encounter scenarios formed by USV and the encountering vessel.

Collision Detection Model Construction
By the description given in Section 3.2, it can be seen that by changing the control input u to change the motion state of USVs under the consideration of the USV dynamic characteristics and marine environmental factors, the waypoint of the USV is changed so that ( ) ConfP and the USV can avoid vessels. Equation (7) is nonlinear and it needs to use Runge-Kutta integration and the Taylor expansion law to approximate the state of the USV. The relationship between the system state and control input at time k t can be obtained:

Collision Detection Model Construction
By the description given in Section 3.2, it can be seen that by changing the control input u to change the motion state of USVs under the consideration of the USV dynamic characteristics and marine environmental factors, the waypoint of the USV is changed so that P USV (t k ) is far from P Encounter−i (t k ) ⊕ ConfP and the USV can avoid vessels. Equation (7) is nonlinear and it needs to use Runge-Kutta integration and the Taylor expansion law to approximate the state of the USV. The relationship between the system state and control input at time t k can be obtained: where X(t k−1 ) and u(t k−1 ) represent the system state of the USV and the control input at time t k−1 , respectively, and X(t k ) represents the estimated system state of the USV The relationship between the USV system state and its position at the time t k can be expressed as: where C = 1 1 (14) into Equation (15): where P USV (t k ) represents the estimated position of USV at the time t k . According to Equations (8) and (16), the control input set that causes the USV to collide with the encountering vessel at a certain time in the future can be expressed as: To ensure that the obstacle avoidance behavior adopted by the USV satisfies the COLREGS rules, this paper divides the control input set UO USV|Encounter−i of the collision region based on the improved VO algorithm into four regions-namely, UO USV|Encounter−i , UO USV|le f t , UO USV|right , and UO USV|back . The expression is shown in Equation (18).
where P ⊥ le f t (t k ) and P ⊥ right (t k ) are inward perpendicular to the left boundary and the right boundary of the geometric model of UO USV|Encounter−i , respectively. The expressions are shown in Equation (19). where where UO USV|le f t shows that the USV turning to the left side can enable it to avoid the solution set of the encountering vessel, UO USV|right shows that the USV turning to the right side can enable it to avoid the solution set of the encountering vessel, and UO USV|back shows the solution set of the USV backward avoidance of the encountering vessel.
To ensure the effectiveness of USV obstacle avoidance behavior, the motion state space of the USV obstacle avoidance behavior is obtained using the dynamic window method.
The state space that the USV can reach from the current motion state through the time window: where r(t k )∆t 2 (22) where u D , v D , and r D represent the longitudinal velocity, transverse displacement velocity, and yaw angular velocity that the USV can reach within the time window ∆t, respectively. u(t k ), v(t k ), and r(t k ) represent the longitudinal velocity, transverse displacement velocity, and yaw angular velocity of the USV at the current moment, respectively. .
. v(t k ), and . r(t k ) represent the longitudinal acceleration, transverse acceleration, and yaw angle acceleration of the USV at the current time, respectively. Since the elements WD USV are continuous, they do not enable calculation in practical engineering. Therefore, the WD USV is discretized based on the principle of equal distance discretization, and the width of the discretization is M.
To ensure the enforceability of the collision avoidance strategy, two constraint conditions of the motion state space of the USV obstacle avoidance behavior and the velocity obstacle region are added to the dynamic window algorithm. The multi-vessel encounter collision detection model is shown in Figure 7. According to Equations (18) and (21), the obstacle avoidance strategy set Ω USV for the USV that is achievable, safe, and compliant with COLREGS in the time window ∆t is shown in Equation (23): where  For the timely and effective obstacle avoidance of the vessel, it is necessary to accurately assess the degree of collision threat of the vessel in the USV monitoring area. The

Construction of Collision Risk Assessment Model
For the timely and effective obstacle avoidance of the vessel, it is necessary to accurately assess the degree of collision threat of the vessel in the USV monitoring area. The collision risk assessment method proposed in reference [17] not only reflects the degree of danger when approaching the vessel but also reflects the difficulty of avoiding collision, as shown in Equation (25): where where N(·) represents the size of the collection area, which is obtained by Boolean operation. TCR(∆t) represents the degree of threat to the USV caused by the encountering vessel, which is a measure of the possibility of collision between ships. The larger the evaluation value is, the fewer solutions are needed to avoid conflicts and the higher the collision risk, and vice versa. The corresponding threat level classification is shown in Figure 8. It can be seen from Figure 8 that ( ) TCR t Δ is an important parameter for the USV to take obstacle avoidance action. This parameter uses the threshold to divide the action of USV in the scenario of multi-vessel encounters into two stages: paying attention to the encountering vessel movement trend and taking obstacle avoidance action. The threshold selected in this paper is 0.5; that is, when ( ) 0.5 TCR t Δ ≥ , the USV needs to take obstacle avoidance action. In the scenario of multi-vessel encounters, the USV needs to sort the priority of the encountering vessel according to the size of the ( ) TCR t Δ value, and on this basis, obtain the opportunity to start the collision avoidance strategy according to the evaluation function introduced later, which provides an objective basis for the decision-making of the USV's avoidance timing and avoidance priority.

Optimal Collision Avoidance Strategy
The multi-vessel encounters collision detection model should quickly and accurately re-planning a safe and least resource cost-optimal path for the USV when USV shipborne detection equipment perceives the encountering vessel. In this paper, particle swarm optimization (PSO) is used to find the optimal collision avoidance strategy * u in the collision avoidance strategy set USV Ω .
The USV avoids obstacles by changing the control input u -that is, it changes longitudinal velocity u , transverse displacement velocity v, and yaw angular velocity It can be seen from Figure 8 that TCR(∆t) is an important parameter for the USV to take obstacle avoidance action. This parameter uses the threshold to divide the action of USV in the scenario of multi-vessel encounters into two stages: paying attention to the encountering vessel movement trend and taking obstacle avoidance action. The threshold selected in this paper is 0.5; that is, when TCR(∆t) ≥ 0.5, the USV needs to take obstacle avoidance action. In the scenario of multi-vessel encounters, the USV needs to sort the priority of the encountering vessel according to the size of the TCR(∆t) value, and on this basis, obtain the opportunity to start the collision avoidance strategy according to the evaluation function introduced later, which provides an objective basis for the decisionmaking of the USV's avoidance timing and avoidance priority.

Optimal Collision Avoidance Strategy
The multi-vessel encounters collision detection model should quickly and accurately re-planning a safe and least resource cost-optimal path for the USV when USV shipborne detection equipment perceives the encountering vessel. In this paper, particle swarm optimization (PSO) is used to find the optimal collision avoidance strategy u * in the collision avoidance strategy set Ω USV .
The USV avoids obstacles by changing the control input u-that is, it changes longitudinal velocity u, transverse displacement velocity v, and yaw angular velocity r, so that the search space of the PSO algorithm has the dimension d = 3. The updated formula for the particle velocity and position is shown in (27): where v k i and x k i represent the velocity and position of the particle i(i = 1, 2, . . . , m) in the kth iteration, respectively; pBest k i and gBest k i represent the individual optimal position and population optimal position searched for by particle i and the whole particle population until the kth iteration, respectively; and r 1 and r 2 represent random numbers uniformly distributed in the interval [0, 1]. c 1 and c 2 are normal numbers called learning factors. The larger c 1 is, the stronger the ability of particles to learn from their own historical experience is. The larger c 2 is, the stronger the degree of information sharing and collaboration between particles is. ω represents inertia weight. The larger this value is, the stronger the global search ability is; the smaller this value is, the stronger the local search ability is. These three parameters determine the ability of the particle to search for the optimal solution. The three parameters are improved below, and their expressions are shown in Equations (28) and (29).
In the early iteration of the PSO algorithm, the global search ability of particles is strong in order to detect the global space. In the late iteration of the PSO algorithm, particles need to strengthen their local search ability to search for the global optimal solution. Therefore, as the number of iterations increases, ω and c 1 should gradually decrease and c 2 should gradually increase. Here, k is the current iteration number, k max is the maximum iteration number, α = π/4, ω s = 0.9, and ω e = 0.4. m is the control factor, and its value is 0.5. ω k decreases linearly from 0.9 to 0.4 with the increase in the iteration number. c 1s = 2.5, c 2s = 1.0, c 1e = 1.0, and c 2e = 2.5. c 1 decreases nonlinearly from 2.5 to 1.0 with the increase in the iteration number, while c 2 increases nonlinearly from 1.0 to 2.5 with the increase in the iteration number.
The PSO algorithm evaluates the solution using the value of the fitness function. The fitness function is established on the premise of the minimum resource cost, as shown in Equation (30): where f dist (Ω USV ), f heading (Ω USV ), and f velocity (Ω USV ) represent the path that is re-planned by USV during obstacle avoidance, the change in the yaw angle, and the change in the velocity, respectively. ε 1 , ε 2 , and ε 3 are the corresponding weighting coefficients, and ε 1 + ε 2 + ε 3 = 1. The shorter the re-planning path is, the smaller the USV energy consumption is. Meanwhile, a smaller amplitude of yaw angle and a smaller velocity change mean that the re-planning path will be smoother. The fewer times the yaw angle and velocity change, the lower the control cost will be. Therefore, the fitness function is selected in order to find the particle solution that can best minimize the fitness value in the PSO algorithm.

Realization of USV Autonomous Obstacle Avoidance Algorithm Based on Improved Velocity Obstacle Method
According to the algorithm description given above, the USV autonomous obstacle avoidance algorithm based on the improved velocity obstacle method is mainly realized through the following 11 steps, and the flow chart is shown in Figure 9.

•
Step 1: The USV maintains the current state of motion and advances along the preset path. In real time, it senses the position, velocity, and water surface contours of the encountering vessel through the onboard detection sensors.

•
Step 2: The velocity obstacle region UO USV|Encounter−i of the encountering vessel is constructed according to Equation (17). The solution set UO USV|le f t of the USV turning to the left to avoid the encountering vessel and the solution set UO USV|right of the USV turning to the right to avoid the encountering vessel are obtained so that USV can deal with emergent threats according to Equation (18).

•
Step 3: The motion state-space WD USV of the USV is determined according to Equation (21) to ensure the effectiveness of the USV obstacle avoidance behavior.

•
Step 4: Coupling steps 2 and 3 with COLREGS, the multi-vessel encounter collision detection model is constructed according to Equation (23), while the collision risk assessment model is constructed according to Equation (25).

•
Step 5: If the collision threat degree of one or multiple vessels in the USV monitoring area is greater than the threshold (TCR(∆t) ≥ 0.5), then these vessels are determined to pose a threat to the USV. According to the TCR(∆t) value, the obstacle avoidance priority of multiple vessels will be determined, and the obstacle avoidance strategy set Ω USV with the highest priority will be generated. If the degree of collision threat to the vessel is less than the threshold (TCR(∆t) < 0.5), it is safe for the USV to continue sailing in its current state of motion.

•
Step 6: The optimal collision avoidance strategy and the best starting time in the collision avoidance strategy set Ω USV are found.

•
Step 7: Obstacle avoidance measures start to be taken. The optimal collision avoidance strategy u * needs to be input to the controller. the motion state of the USV is changed to ensure that the USV avoids the encountering vessel with the highest priority and the minimum control and energy consumption cost.

•
Step 8: First, the highest priority vessel is avoided until the threat is lifted and then the sub-priority vessel is avoided. In turn, all encountering vessels are avoided in an orderly fashion.

•
Step 9: If the collision threat of vessels in the USV monitoring area is less than the threshold (TCR(∆t) < 0.5), then the obstacle avoidance action ends.

•
Step 10: Steps 2 to 9 are repeated at every interval ∆t.

•
Step 11: If USV arrives at the destination, the voyage ends; otherwise, it returns to the original path and continues to sail. . Implementation process of USV autonomous obstacle avoidance algorithm. Figure 9. Implementation process of USV autonomous obstacle avoidance algorithm.

Experimental Environment and Condition Assumptions
Using the MATLAB R2019a software, the performance of the proposed USV autonomous obstacle avoidance algorithm based on improved VO was tested to verify whether the re-planned obstacle avoidance path complies with COLREGS, meets the constraints of USV dynamics, and achieves the minimum control and energy consumption cost when avoiding vessels and returning to the original path. On this basis, through an experimental comparison with the USV autonomous obstacle avoidance algorithm based on VO and the USV autonomous obstacle avoidance algorithm based on SBG, the performance of the proposed USV autonomous obstacle avoidance algorithm based on improved VO was further analyzed to verify the security, timeliness, and economy of the algorithm. The experimental environment and assumptions were as follows: The improved PSO algorithm is used to fins the optimal solution of the model, the number of particle populations N = 20, and the maximum number of iterations k max = 180.  In the scenario of a single-vessel encounter.
Firstly, the simulation simulates three scenarios of conflict between the USV and the encountering vessel: a cross-right scenario, a head-on scenario, and an over-take scenario. Whether the USV can abide by the COLREGS obstacle avoidance guidelines is verified by re-planning the path. The security, efficiency, and economy of the algorithm are analyzed through the collision threat degree, relative distance, velocity change, and yaw angle change. In the initial state, the parameter settings of the USV and the encountering vessel are shown in Table 4, and the simulation results are shown in Tables 5-7    return to its original path. In accordance with the principle of minimum control cost, the USV changes its yaw angle and its velocity remains unchanged. From the 225th s to the 350th s, the velocity of the USV is unchanged after accelerating from 1.25 m/s to 2 m/s. This is because the obstacle avoidance action ends after the USV returns to the original path. To maintain the stability of the system, its velocity returns to the initial velocity and remains unchanged. It can be seen from Figure 10c that the USV begins to change its yaw angle from the 50th s because the USV is affected by the rotation radius and its yaw angle cannot be changed immediately. From the 50th s to the 100th s, the USV abides by COLREGS to hit the rudder to the right. From the 100th s to the 135th s, the USV rudder returns to the center to ensure that the USV passes the starboard side of the vessel and does not deviate too far from the initial route. From the 135th s to the 225th s, the USV steers left, causing the USV to return to the original path with the minimum resource cost. From the 225th s to the 350th s, the rudder remains unchanged after returning to the middle. This is because after the USV returns to the original path, the obstacle avoidance action ends. To maintain the stability of the system, its yaw angle returns to the initial yaw angle and remains unchanged.
It can be seen from Figure 10d that the USV re-planning path is smoother, which satisfies the constraints of USV dynamics. The re-planning path does not deviate too far from the original path, which conforms to the USV minimum resource cost principle. During the USV obstacle avoidance process, the USV slows down and steers right, past the starboard side of the vessel. The USV successfully avoids the vessel by abiding by COLREGS. Table 5. Critical moment collision threat degree assessment results.

Collision Threat Degree
Timing of Obstacle Avoidance  Figure 11d simulates the obstacle avoidance process of the USV and the encountering vessel in a head-on encounter scenario. Figure 11a-c show the changes in the relative distance, velocity, and yaw angle with time in the obstacle avoidance process of the USV and the encountering vessel in the conflict scenario, respectively. Table 6 shows the re-          Figure 10d simulates the obstacle avoidance process of the USV and the encountering vessel in the right-crossing encounter scenario. Figure 10a-c show the changes in the relative distance, velocity, and yaw angle of the USV over time during obstacle avoidance. Table 5 shows the real-time evaluation results of the collision threat of the encountering vessel in the USV monitoring area. The initial relative azimuth β = 90 • of the two ships is within [15 • , 112.5 • ). The two ships move forward in the initial direction linearly and the USV will enter a right-cross encounter situation with the vessel. According to the COLREGS rule, in the right-crossing encounter scenario, USV should slow down and steer right past the starboard side of the encountering vessel.
It can be seen from Table 5 that the USV runs to the 45th s and TCR(∆t) = 0.501. Thus, the vessel will pose a threat to USV, and the behavior of the USV changes from the stage of paying attention to the movement of the encountering vessel to the stage of taking obstacle avoidance actions. The USV begins to follow its collision avoidance strategy by changing its velocity and yaw angle from the state of motion of the re-planned path. The USV runs to the 135th s and TCR(∆t) = 0.89. At this time, the assessment value of the collision threat degree is the largest and the probability of a collision between two ships is the largest. Figure 10a shows that at the moment t = 135 s when the risk of collision is the highest, the minimum relative distance between the two ships is 12.1712 m, which is greater than ConfP. Therefore, the USV can safely avoid the encountering vessel.
It can be seen from Figure 10b that the USV begins to take obstacle avoidance measures from the 45th s. The velocity of the USV decelerates from the initial value of 2 m/s to 1 m/s and then basically remains unchanged. This is the optimal collision avoidance strategy calculated by the evaluation function to prevent the USV from deviating too far from the original path. From the 100th s to the 135th s, the USV accelerates from 1 m/s to 1.25 m/s. This is necessary to ensure that the USV can pass the starboard side of the vessel. The encountering vessel moves uniformly and linearly, and its velocity and yaw angles remain unchanged. According to the relative distance between the two ships, if the USV is to pass the starboard side of the vessel, the USV needs to accelerate uniformly. According to the evaluation function, it needs to be accelerated to 1.25 m/s. From the 135th s to the 225th s, the velocity of the USV remains unchanged to enable the USV to return the original path with minimum control cost. After the USV successfully avoids the vessel, the relative distance between two ships becomes larger and larger, the probability of collision between two ships becomes smaller and smaller, and the USV begins to return to its original path. In accordance with the principle of minimum control cost, the USV changes its yaw angle and its velocity remains unchanged. From the 225th s to the 350th s, the velocity of the USV is unchanged after accelerating from 1.25 m/s to 2 m/s. This is because the obstacle avoidance action ends after the USV returns to the original path. To maintain the stability of the system, its velocity returns to the initial velocity and remains unchanged.
It can be seen from Figure 10c that the USV begins to change its yaw angle from the 50th s because the USV is affected by the rotation radius and its yaw angle cannot be changed immediately. From the 50th s to the 100th s, the USV abides by COLREGS to hit the rudder to the right. From the 100th s to the 135th s, the USV rudder returns to the center to ensure that the USV passes the starboard side of the vessel and does not deviate too far from the initial route. From the 135th s to the 225th s, the USV steers left, causing the USV to return to the original path with the minimum resource cost. From the 225th s to the 350th s, the rudder remains unchanged after returning to the middle. This is because after the USV returns to the original path, the obstacle avoidance action ends. To maintain the stability of the system, its yaw angle returns to the initial yaw angle and remains unchanged.
It can be seen from Figure 10d that the USV re-planning path is smoother, which satisfies the constraints of USV dynamics. The re-planning path does not deviate too far from the original path, which conforms to the USV minimum resource cost principle. During the USV obstacle avoidance process, the USV slows down and steers right, past the starboard side of the vessel. The USV successfully avoids the vessel by abiding by COLREGS. Figure 11d simulates the obstacle avoidance process of the USV and the encountering vessel in a head-on encounter scenario. Figure 11a-c show the changes in the relative distance, velocity, and yaw angle with time in the obstacle avoidance process of the USV and the encountering vessel in the conflict scenario, respectively. Table 6 shows the realtime evaluation results for the degree of collision threat to the vessel in the USV monitoring area. Figure 12d simulates the obstacle avoidance process of the USV and the encountering vessel in the over-take encounter scenario. Figure 12a-c show the changes in the relative distance, velocity, and yaw angle with time in the obstacle avoidance process of the USV and the encountering vessel in the conflict scenario, respectively. Table 7 shows the real-time evaluation results for the degree of collision threat to the vessel in the USV monitoring area.
From the simulation results of Figures 11 and 12, it can be seen that the obstacle avoidance process in both the head-on and over-take encounter scenarios is similar to that in the right-crossing encounter scenario shown in Figure 10. The USV adaptively selects the start time of obstacle avoidance through the real-time calculation TCR(∆t) of the size. On this basis, under the constraints of the COLREGS rules and the USV dynamics and with achieving the minimum control cost and minimum energy consumption cost as the goal, the USV realizes efficient autonomous obstacle avoidance.

2.
In the scenario of a multi-vessel encounter.
The effectiveness of the proposed algorithm is verified by simulating the USV autonomous obstacle avoidance process under multiple conflict scenarios between the USV and a single encountering vessel. Based on this, the autonomous obstacle avoidance process of the USV in the scenario of multi-vessel encounters is simulated to further verify the effectiveness of the proposed algorithm. The parameter settings for the multi-vessel encounter scenarios are shown in Table 8, and the simulation results are shown in Figure 13. In Figure 13, the blue solid circle and the blue solid line trajectory represent the running time and navigation path of the USV, respectively, while the green solid line represents the global path of the USV. The red hollow circle and red dotted track represent the running time and navigation path of encountering vessel 1, respectively. The purple hollow circle and purple dotted track represent the running time and navigation path of encountering vessel 2, respectively. The rose-red hollow circle and rose red dotted track represent the running time and navigation path of encountering vessel 3. 0.437 TCR = , vessel 2 poses a threat to the USV, and the USV begins to take obstacle avoidance actions against vessel 2. When the USV runs to the 142nd s, the probability of a collision between the USV and vessel 2 is the greatest. At this time, the minimum relative distance between the two ships is 37.01 m, which is greater than ConfP . Thus, the USV successfully avoids vessel 2. As the USV runs to the 150th s, ship2 0.486 TCR = and the threat of vessel 2 to the USV is lifted. At this time, ship3 0.521 TCR = , vessel 3 poses a threat to the USV, and the USV begins to take obstacle avoidance actions against vessel 3. When the USV runs to the 221st s, the probability of a collision between the USV and vessel 3 is the greatest. At this time, the minimum relative distance between the two ships is 11.91 m, which is greater than ConfP . Thus, the USV successfully avoids vessel 3. When the USV cannot detect any collision risk, the USV returns to the original route. It can be seen from Figure 13d that the USV conducts path re-planning on the premise of complying with COLREGS. The re-planning path is smooth, which satisfies the constraints of the USV dynamics. The re-planning path does not deviate too far from the original path, meaning that it conforms to the USV minimum resource cost principle. Figure 13a-c show that the USV generates the collision avoidance strategy and navigation path executable by the control system on the premise of obtaining the minimum control cost.   Figure 13d simulates the obstacle avoidance process of the USV in the scenario of multi-vessel encounters. Figure 13a-c show the changes in the relative distance, velocity, and yaw angle of the USV over time during obstacle avoidance. Table 9 shows the real-time evaluation results of the collision threat of the vessel in the USV monitoring area. The simulation scenario assumes that the USV travels to the target point along the global path of the initial plan and encounters three vessels, which move linearly, during the journey. Table 9 shows the real-time evaluation results for the collision threat of the vessel in the USV monitoring area. It can be seen from Table 9 that when the USV runs to the 3rd s, the collision threat degrees of vessel 1, vessel 2, and vessel 3 are 0.66, 0.50, and 0.19, respectively. At this time, vessel 1 and vessel 2 pose a threat to the USV, but vessel 1 has the highest priority of obstacle avoidance. Therefore, the USV begins to take obstacle avoidance actions against vessel 1. The motion state is changed by changing the velocity and yaw angle to re-plan the path. When the USV runs to the 127th s, the probability of collision between USV and vessel 1 is the largest. At this time, the minimum relative distance between the two ships is 25.79 m, which is greater than ConfP. The USV successfully avoids vessel 1. The USV runs to the 131st s, TCR ship1 = 0.493, and the threat of vessel 1 to the USV is lifted. At this time, TCR ship2 = 0.755, TCR ship3 = 0.437, vessel 2 poses a threat to the USV, and the USV begins to take obstacle avoidance actions against vessel 2. When the USV runs to the 142nd s, the probability of a collision between the USV and vessel 2 is the greatest. At this time, the minimum relative distance between the two ships is 37.01 m, which is greater than ConfP. Thus, the USV successfully avoids vessel 2. As the USV runs to the 150th s, TCR ship2 = 0.486 and the threat of vessel 2 to the USV is lifted. At this time, TCR ship3 = 0.521, vessel 3 poses a threat to the USV, and the USV begins to take obstacle avoidance actions against vessel 3. When the USV runs to the 221st s, the probability of a collision between the USV and vessel 3 is the greatest. At this time, the minimum relative distance between the two ships is 11.91 m, which is greater than ConfP. Thus, the USV successfully avoids vessel 3. When the USV cannot detect any collision risk, the USV returns to the original route.
It can be seen from Figure 13d that the USV conducts path re-planning on the premise of complying with COLREGS. The re-planning path is smooth, which satisfies the constraints of the USV dynamics. The re-planning path does not deviate too far from the original path, meaning that it conforms to the USV minimum resource cost principle. Figure 13a-c show that the USV generates the collision avoidance strategy and navigation path executable by the control system on the premise of obtaining the minimum control cost.

1.
Comparison and verification of the functional effectiveness of the three algorithms.
To verify the effectiveness of the algorithm proposed in this paper, we compare it with the autonomous obstacle avoidance method of the USV based on VO and the autonomous obstacle avoidance method of the USV based on SBG; thus, the performance of the proposed algorithm is further compared and verified. The simulation scenario assumes that the USV is sailing to the target point along the global path of the initial planning and encounters two vessels, which both move linearly toward their respective initial azimuths, during the journey. In the initial state, the parameter settings of the USV and the encountering vessel are shown in Table 10 and the simulation results are shown in Figures 14 and 15. In Figure 14, the left lower blue circle and the right upper blue circle represent the starting point and the target point of the USV, respectively. The blue icon, red icon, and rose-red icon represent the USV, vessel 1, and vessel 2, respectively. The blue dotted track, the red dotted track, and the rose-red dotted track represent the navigation paths of the USV, vessel 1, and vessel 2, respectively. In Figure 15, the blue real line, the rose-red virtual line, and the red virtual line represent the simulation results obtained by the autonomous obstacle avoidance method of the USV based on improved VO, the simulation results obtained by the autonomous obstacle avoidance method of the USV based on VO, and the simulation results obtained by the autonomous obstacle avoidance method of the USV based on SBG, respectively.  Figure 14 simulates the obstacle avoidance process for the USV in the scenario of multi-vessel encounters. In the 9th s and the 21st s, both the obstacle avoidance method proposed in this paper and the obstacle avoidance method based on VO enable the USV to detect the vessel that poses a threat to it. In both, the USV needs to take two obstacle avoidance actions to complete the autonomous obstacle avoidance task. In the 7th s, the SBG-based obstacle avoidance method causes the USV to detect the collision alarm circle of vessel 1 and start to take obstacle avoidance actions. At the 11th s, it is necessary to change the collision avoidance strategy so that the USV can successfully avoid vessel 1. At the 25th s, the USV must detect the collision alarm circle of vessel 2 and start to take obstacle avoidance actions. At the 29th s, it is necessary to change the collision avoidance strategy so that the USV can successfully avoid vessel 2. This method necessitates two obstacle avoidance actions being taken to complete the autonomous obstacle avoidance task every time a vessel that poses a collision threat to the USV is detected. In this simulation, a total of four obstacle avoidance actions are taken to complete the autonomous obstacle avoidance task. Compared with the above two methods, this method has a greater control cost. In summary, the re-planning path of the obstacle avoidance method proposed in this paper is smoother and shorter; this means that the USV dynamic constraints are met and the minimum resource cost is achieved. The VO-based obstacle avoidance method re-planned the path to be sharper and longer, which did not fit with the physical motion characteristics of the USV. The obstacle avoidance method calculated by the SBG planned a smoother path but with a longer path length and a higher resource cost.  Figure 15a,b are schematic diagrams of the USV velocity changes and yaw angle changes during the autonomous obstacle avoidance process planned by three different algorithms. It can be seen from the figure that, compared with the other two algorithms, in the autonomous obstacle avoidance method for the USV based on improved VO, the change in amplitude of the velocity and yaw angle of the USV during obstacle avoidance is relatively small. However, the amplitude of the change in the yaw angle is slightly larger than that of the change in velocity. This is because this method takes full account of the USV dynamic characteristics, the encountering vessel motion characteristics, and the COLREGS rules during the obstacle avoidance process and uses the dynamic window to predict the velocity and yaw angle of the USV in real time. At the same time, to ensure that the USV can avoid encountering vessels in a timely and effective manner with the minimum obstacle avoidance cost, the USV responds preferentially by changing the yaw angle during obstacle avoidance. However, due to the coupling relationship between velocity and yaw angle, when the yaw angle changes the velocity will also experience some changes. In the autonomous obstacle avoidance method for the USV based on VO, in the process of obstacle avoidance the velocity and yaw angle change many times. Among these, the range of the velocity changes is relatively small, while the yaw angle range of change is relatively large, with two drastic changes. This is because this method regards the USV as a particle and does not evaluate the collision risk of the encountering vessel. If the velocity vector of the USV is within the velocity obstacle region of the encountering vessel, it will immediately change the yaw angle to keep it away from the velocity obstacle region. When the velocity vector of the USV is not in the velocity obstacle region of the encountering vessel, the velocity will become the initial velocity immediately. This not only leads to repeated changes in velocity and yaw angle, but also means that the velocity changes more frequently in this algorithm compared to the other two algorithms, as shown in Figure 15a. Different from the other two algorithms that take two obstacle avoidance measures to avoid colliding with two encountering vessels, the autonomous obstacle avoidance method for USVs based on SBG adopts four obstacle avoidance measures to avoid two encountering ships. This is because this method expands the ship domain model of the USV and establishes a conflict warning circle to perceive which vessel to avoid. When the USV detects the collision warning circle of the Figure 14. Obstacle avoidance process in the multi-vessel encounter situation: (a) Obstacle avoidance process based on improved VO autonomous obstacle avoidance algorithm; (b) Obstacle avoidance process based on VO autonomous obstacle avoidance algorithm; (c) Obstacle avoidance process based on SBG autonomous obstacle avoidance algorithm. Figure 15a,b are schematic diagrams of the USV velocity changes and yaw angle changes during the autonomous obstacle avoidance process planned by three different algorithms. It can be seen from the figure that, compared with the other two algorithms, in the autonomous obstacle avoidance method for the USV based on improved VO, the change in amplitude of the velocity and yaw angle of the USV during obstacle avoidance is relatively small. However, the amplitude of the change in the yaw angle is slightly larger than that of the change in velocity. This is because this method takes full account of the USV dynamic characteristics, the encountering vessel motion characteristics, and the COLREGS rules during the obstacle avoidance process and uses the dynamic window to predict the velocity and yaw angle of the USV in real time. At the same time, to ensure that the USV can avoid encountering vessels in a timely and effective manner with the minimum obstacle avoidance cost, the USV responds preferentially by changing the yaw angle during obstacle avoidance. However, due to the coupling relationship between velocity and yaw angle, when the yaw angle changes the velocity will also experience some changes. In the autonomous obstacle avoidance method for the USV based on VO, in the process of obstacle avoidance the velocity and yaw angle change many times. Among these, the range of the velocity changes is relatively small, while the yaw angle range of change is relatively large, with two drastic changes. This is because this method regards the USV as a particle and does not evaluate the collision risk of the encountering vessel. If the velocity vector of the USV is within the velocity obstacle region of the encountering vessel, it will immediately change the yaw angle to keep it away from the velocity obstacle region. When the velocity vector of the USV is not in the velocity obstacle region of the encountering vessel, the velocity will become the initial velocity immediately. This not only leads to repeated changes in velocity and yaw angle, but also means that the velocity changes more frequently in this algorithm compared to the other two algorithms, as shown in Figure 15a. Different from the other two algorithms that take two obstacle avoidance measures to avoid colliding with two encountering vessels, the autonomous obstacle avoidance method for USVs based on SBG adopts four obstacle avoidance measures to avoid two encountering ships. This is because this method expands the ship domain model of the USV and establishes a conflict warning circle to perceive which vessel to avoid. When the USV detects the collision warning circle of the encountering vessel, it considers that the vessel poses a threat to the USV and starts to take obstacle avoidance measures to achieve large-scale obstacle avoidance. During the obstacle avoidance process, when the USV detects the ship domain model of the encountering vessel it will take obstacle avoidance measures again to carry out small-scale obstacle avoidance. Therefore, the method needs to take two obstacle avoidance actions to complete autonomous obstacle avoidance every time the vessel that poses a collision threat to the USV is detected. A total of four obstacle avoidance measures were taken for two encountering vessels and the velocity and yaw angle changed significantly four times, as shown in Figure 15a,b respectively. ISPRS Int. J. Geo-Inf. 2021, 10, x FOR PEER REVIEW 28 encountering vessel, it considers that the vessel poses a threat to the USV and star take obstacle avoidance measures to achieve large-scale obstacle avoidance. During obstacle avoidance process, when the USV detects the ship domain model of the countering vessel it will take obstacle avoidance measures again to carry out small-s obstacle avoidance. Therefore, the method needs to take two obstacle avoidance act to complete autonomous obstacle avoidance every time the vessel that poses a colli threat to the USV is detected. A total of four obstacle avoidance measures were taken two encountering vessels and the velocity and yaw angle changed significantly times, as shown in Figure 15a,b respectively.

Comparison and verification of three algorithm performance indicators.
In order to verify the advantages and disadvantages of the three algorithms m clearly and intuitively, and based on the simulation experiment in Section 5.2.2 Equation (30), the cost of the USV avoiding two encountering vessels is quantitati compared. The results are shown in Table 11.

2.
Comparison and verification of three algorithm performance indicators.
In order to verify the advantages and disadvantages of the three algorithms more clearly and intuitively, and based on the simulation experiment in Section 5.2.2 with Equation (30), the cost of the USV avoiding two encountering vessels is quantitatively compared. The results are shown in Table 11.