Reactive Control for Collision Evasion with Extended Obstacles

Evading collisions in three-dimensional underwater environments is critical in exploration of an Autonomous Underwater Vehicle (AUV). In underwater environments, AUV measures an obstacle surface by utilizing a three-dimensional active sonar. This article addresses reactive collision evasion control by considering extended obstacles. Here, an extended obstacle is an arbitrary obstacle that can generate any number of measurements and not a point target generating at most one measurement. Considering 3D environments, our manuscript considers collision evasion with both moving obstacles and static obstacles. The proposed reactive collision evasion controllers are developed by considering hardware limits, such as the maximum speed or acceleration limit of an AUV. We further address how to make an AUV move towards a goal, while avoiding collision with extended obstacles. As far as we know, the proposed collision evasion controllers are novel in handling collision avoidance with an extended obstacle, in the case where an AUV measures 3D-obstacle boundaries by utilizing sonar sensors. The effectiveness of the proposed controllers is demonstrated by MATLAB simulations.


Introduction
Recently, autonomous underwater vehicles (AUVs) have been utilized in many applications, such as underwater exploration. Collision evasion is crucial for safe maneuvers of AUVs. In underwater environments, electromagnetic signals dissipate quickly. Thus, an AUV uses sonar sensors with a limited range in order to detect nearby underwater objects. This article addresses reactive controls that do not require path planning ahead of time. The reactive collision evasion control is developed by considering limited sensors and the hardware limits of AUV.
We consider the case where an AUV uses active sonar sensors to sense its surroundings. We assume that the AUV has sonar sensors for calculating the point cloud of underwater objects [1]. The authors of [1] proposed a method to reconstruct an object's three-dimensional geometry based on sonar images captured while an AUV moves over the object. By reconstructing the 3D shape of the object, [1] further addressed a method for classifying the object using neural networks. In our paper, point clouds of an object are utilized for collision evasion control.
In our manuscript, the AUV can calculate three-dimensional points, termed object-Points, on object surfaces. The proposed reactive controllers make AUV evade collision with every objectPoint.
The AUV in our article uses sonar sensors to calculate the point cloud of underwater objects [1]. AUV measures an obstacle surface using sonar sensors, followed by estimating the obstacle's position and velocity using the information of objectPoints. By measuring the difference between two clouds of objectPoints measured at distinct sampling indexes, the extended obstacle's velocity can be estimated. In order to estimate the velocity (speed and orientation) of objectPoints on an extended obstacle, AUV utilizes iterative closest point (ICP) algorithms [2][3][4][5][6][7]. In order to limit the influence of outliers, we use the robust ICP algorithm in [6]. Moreover, for efficient search, this paper uses k-D tree for matching processes [8].
There are many papers on developing collision evasion controls in two-dimensional environments [9][10][11][12]. In [13], the obstacle avoidance research of wave glider in 2D marine environment was conducted. Considering 2D environments, artificial potential field (APF) has been widely used for avoid collision between a robot and obstacles [13,14]. APF is generated by the addition of the attraction potential field (generated by the goal) and the repulsive potential field (generated by obstacles).
As far as we know, APF is not provably complete in achieving collision avoidance. For instance, consider the case where the robot needs to move into a tunnel for reaching its goal. Due to the repulsive field generated by obstacles at the tunnel entrance, the robot has difficulty in maneuvering through the tunnel. Moreover, APF was not applied for collision avoidance in 3D environments. Moreover, APF is not suitable for avoiding moving obstacles, since the velocity of an obstacle was not considered in APF. Considering 3D environments, our article tackles collision evasion with both maneuvering obstacles and static obstacles.
Velocity obstacle (VO) methods were utilized for collision evasion with obstacles, which may move [9,11,[15][16][17]. VO methods are computationally efficient and, thus, appropriate for mobile robots [18]. VO methods are provably complete in achieving collision avoidance, as long as an obstacle maintains its velocity for all future times [15]. VO methods assume that an obstacle moves with a constant velocity for all future times. However, this is not a valid assumption in practice.
In our manuscript, the proposed reactive collision avoidance controls are developed and inspired by VO methods. We address 3D reactive collision avoidance controls, assuming that an obstacle moves with a constant velocity within k p sampling-indexes in the future. At each sampling-index, an obstacle's pose (position and velocity) is estimated using sonar sensor measurements, and we run collision avoidance controls at every sampling-index. Our study proves that as long as the obstacle velocity (speed and orientation) is estimated correctly using ICP algorithms, collision avoidance is assured within k p sampling indexes in the future.
Considering 3D environments, our manuscript handles collision evasion with both moving obstacles and static obstacles. Several papers [19][20][21] considered collision evasion in three-dimensional environments. The authors of [20] presented a collision avoidance algorithm based on potential fields for fixed-wing unmanned aerial vehicles (UAVs) with constrained field-of-view (FOV) sensors such as cameras. The authors of [22] explored 3D path planning for UAVs in 3D point-cloud environments. The approach in [22] searched for obstacle-free and smooth paths by analyzing a point cloud of the target environment, using a modified rapidly exploring random tree (RRT)-based path planning algorithm. However, collision avoidance controllers in [20][21][22] are not suitable for evading a fast moving obstacle, since they did not consider the velocity of a maneuvering obstacle.
References [19,[23][24][25][26] developed collision avoidance controllers while modeling obstacles as spheres or bounding boxes. The authors of [23] addressed a reactive algorithm for avoiding obstacles in three-dimensional space by modeling obstacles as spheres.
In our article, we do not model obstacles as spheres or bounding boxes. Our study handles collision evasion with extended obstacles (moving obstacles as well as static obstacles). Here, an extended obstacle is an arbitrary obstacle generating any number of measurements and not a point target generating at most one measurement. To the best of our knowledge, the proposed collision evasion controllers are novel, since our manuscript handles the case where an AUV measures three-dimensional obstacle surfaces by utilizing sonar sensors. In our paper, the AUV measures an obstacle surface and estimates its position and velocity using the information of objectPoints on the surface.
Considering 3D environments, our collision avoidance controls avoid moving obstacles as well as static obstacles. The proposed reactive controllers utilize the velocity information of an obstacle; hence, it is suitable for evading a fast-moving obstacle. In practice, AUVs may need to approach its goal while avoiding obstacles. We thus address a method to make AUVs approach its goal, while avoiding collision with extended obstacles.
The proposed reactive collision-evasion controllers are developed by considering an AUV's hardware limits, such as the maximum speed or the acceleration limit of the AUV. At each sampling-index k, the AUV calculates its velocity command, which allows it to approach the goal, while avoiding collision with extended obstacles (maneuvering obstacles as well as static obstacles). The velocity command is set considering hardware limits, such as the maximum speed or acceleration limit of the AUV.
Our article handles the case where AUV measures three-dimensional obstacle surfaces using sonar sensors. To the best of our knowledge, the proposed collision evasion controllers are novel, since our article tackles collision avoidance with an extended obstacle. The outperformance of the proposed evasion controllers is demonstrated by utilizing MATLAB simulations.
Section 2 discusses the preliminaries of this article. Section 3 handles assumptions and definitions of this article. Section 4 handles how to estimate the velocity (speed and orientation) of objectPoints associated with an extended obstacle. Section 5 addresses the proposed reactive collision-evasion control. Section 6 discusses how to make AUVs move towards the goal, while avoiding collision with extended obstacles. Section 7 introduces MATLAB simulations to demonstrate the performance of the proposed controls. Section 8 addresses our conclusions.

Preliminaries
This article utilizes two frames: an inertial frame {I} and a body frame {B} [27]. We address several definitions in rigid-body dynamics [27].
The origin of {I} is a point with three axes pointing north, east, and south. {B} is fixed to AUV's body such that {B} is originated at AUV's gravity center.
The rotation matrix representing the counterclockwise (CC) rotation of an angle ψ centered at the z-axis in {B} is as follows.
The rotation matrix representing the CC rotation of an angle θ centered at the y-axis in {B} is as follows.
The combined rotation matrix is built by multiplying (1) and (2) to obtain the following.

Definitions and Assumptions
This article assumes that the localization of AUV is performed using AUV's on-board sensors, such as the inertial measurement unit (IMU). The question of how to localize AUV is not within the scope of this article. Various methods [28][29][30] exist for the localization of an AUV.
We introduce teh notations used in this paper.
) define the angle between two three-dimensional vectors v 1 and v 2 . Moreover, L(A and B) indicates the line segment for which its two end points are A and B, respectively. Let q ∈ R 3 present the three-dimensional coordinates of the AUV. Let v =q ∈ R 3 present the AUV's velocity. Let h = v v ∈ R 3 define the orientation vector of the AUV. We consider discrete-time systems. Considering a variable A, A(k) indicates A at sampling-index k. For instance, AUV at sampling-index k is located at q(k) ∈ R 3 .
Suppose that the current sampling-index is k. The process model of AUV is as follows: where dt indicates the sample duration in discrete-time systems. In (4), v(k) can be considered as the velocity command (control input) of the AUV at sampling-index k. The motion model in (4) is commonly used in reactive collision avoidance using VO methods [9,11,[15][16][17]. Inspired by VO methods [9,11,[15][16][17], we search for the velocity command, v(k), which satisfies collision avoidance at each sampling-index k. At each sampling-index k, the velocity command v(k) is set by considering hardware limits, such as the maximum speed or the acceleration limit of the AUV. The AUV's maximum speed is s max , i.e., v(k) ≤ s max . The maximum acceleration rate of AUV is a max . In other words, we have the following.
In practice, the AUV turns with a bounded turn rate. Considering the bounded turn rate of the AUV, this article uses the following: at each sampling-index k.
At each sampling-index k, we calculate the velocity command v(k) in (4), which allows the AUV to approach a goal, while avoiding collisions with extended obstacles (moving obstacles as well as static obstacles). Velocity command v(k) in (4) can be considered as a high-level control command of the AUV. Once v(k) is set at sampling-index k, the desired waypoint at sampling-index k + 1 is set as q(k + 1) in (4). Then, the straight line segment from the current AUV's position q(k) to the next waypoint q(k + 1) is set as the reference trajectory from sampling-index k to k + 1. Trajectory tracking controls in [31][32][33][34] can be applied to make the AUV track the straight-line segment trajectory, even in environments with model dynamic uncertainties and the presence of external disturbances representing ocean currents and waves. Note that detailed kinematic model in AUV's local coordinate frame is handled in the trajectory tracking controls in [31][32][33][34].
At each sampling-index k, we calculate velocity command v(k) in (4), assuming that an obstacle moves with a constant velocity within k p sampling indexes in the future. At each sampling index, an obstacle's pose (position and velocity) is estimated. In addition, we run collision avoidance controls at every sampling-index.
The AUV has sonar sensors to derive the point cloud of underwater objects [1]. The AUV measures three-dimensional points on obstacle surfaces utilizing three-dimensional sonar sensors. Recall that every three-dimensional point is termed objectPoint, say o p . Rendering the AUV's conjecture as an extended obstacle's velocity (speed and orientation) using objectPoints is addressed in Section 4.
We say that the AUV and an objectPoint o p is in a near-collision state as the relative distance between them is decreases than compared to a certain constant, say r > 0.Here, r > 0 is set by considering the size of the AUV. In other words, a sphere with radius r is sufficiently large to contain the entire AUV. Let S r (o p ) define the sphere with radius r, for which its center is at o p .

Conjecture the Velocity of ObjectPoints on an Extended Obstacle
To conjecture the velocity of objectPoints on an extended obstacle at sampling-index k, the AUV utilizes a robust ICP algorithm [6]. Let k present the current sampling index. Let S(k) define the set of objectPoints measured at sampling-index k.
Suppose that S(k) is given by Here, k d > 0 is a tuning constant. This indicates that the AUV measures M k objectPoints at sampling-index k. In addition, the AUV measures M k−k d objectPoints at sampling-index k − k d . Observe that x i , y j ∈ R 3 are three-dimensional objectPoint coordinates.
Suppose that both M k and M k−k d exceed a certain threshold, say Th ICP . Then, the ICP algorithm is applied to both S(k) and S(k − k d ) in order to find a velocity vector of the obstacle at sampling-index k.
The ICP algorithm at sampling-index k estimates a rigid motion with rotation matrix R k and translation t k , which minimizes the following error E: where w i is the weight for the i-th cloud point and is selected considering Huber's robust function [6,7]. The method for selecting w i is addressed in [6,7]. Given R k and t k , point y j * ∈ S(k − k d ) is denoted as the optimal correspondence of x i , which is the closest point to the transformed x i ∈ S(k).
Given an initial transformation (R k , t k ), the ICP algorithm iteratively solves the problem by alternating between estimating the transformation with (7), and finding the closestpoint matches with (8). For an efficient search, the k-D tree is utilized for the matching process [8]. This iterative process guarantees convergence to a local minimum. Once the ICP algorithm is completed at sampling-index k, translation t k indicates the velocity of the maneuvering obstacle at sampling-index k.
Note that the ICP algorithm is an iterative algorithm and, thus, requires an initial transformation (R k , t k ). We next present a method for setting an initial transformation (R k , t k ). The rotation matrix R k is initialized as a diagonal matrix. Moreover, the translation vector t k is initialized as follows: There may be a case where (R k , t k ) is not estimated correctly due to the mismatch of point pairs. We assume that the maximum speed of an obstacle is known a priori. If t k exceeds the maximum speed of an obstacle, then we set the following: which implies that we use the translation, which was estimated at the previous sampling index.

Collision Prediction
At each sampling-index k, we calculate the velocity command v(k) in (4). Let v denote the velocity command v(k) for convenience.
At each sampling-index k, the AUV calculates v, assuming that the objectPoint o p maneuvers with a velocity v O for k p sampling indexes in the future. Recall that Section 4 discussed how to conjecture v O based on the sonar measurements of AUV. At each sampling-index, the position and velocity of o p are estimated. Furthermore, one runs collision avoidance controls at every sampling index.
We discuss how to evade the case where AUV and an objectPoint, say o p , collide between sampling-index k and k + k p . No collision happens between sampling-index k and k p if for all 0 ≤ u ≤ k p . As one increases u in (11) Utilizing (11), Lemma 1 is derived. This lemma proves that as long as the obstacle velocity v O is estimated correctly using ICP algorithms in Section 4, collision avoidance between o p and AUV is assured within k p sampling indexes in the future. Lemma 1. An objectPoint o p maneuvers with a velocity v O for k p sampling indexes in the future. In addition, the AUV maneuvers with a velocity v. Assume that q(k) is outside S r (o p ) at samplingindex k. The AUV does not collide with o p for k p sampling-indexes in the future, as long as The velocities of an object and that of AUV are considered in collision avoidance, as presented in Lemma 1. Using Lemma 1, the AUV can predict its collision within k p sampling-indexes in the future. At each sampling-index k, th eAUV examines whether its velocity command v meets the following non-collision requirement: For every objectPoint o p , , then the AUV utilizes v as its velocity command for a single sample duration dt.
for any objectPoint o p , then the AUV needs to find a non-collision velocity vector, as addressed in Section 5.2.

Find a Non-Collision Velocity
Vector at Sampling-Index k + 1 As the non-collision requirement is not fulfilled for at least one objectPoint, the AUV needs to find a velocity command, v, satisfying the non-collision requirement. Once a velocity command, which satisfies the non-collision requirement, is found, then the AUV utilizes the found velocity as its velocity command for a single sample duration dt. Note that, at every sampling-index, we run collision avoidance controls.
Algorithm 1 shows how to find a non-collision velocity at sampling-index k + 1 utilizing (17). Let u = (1, 0, 0) T present the orientation of the vehicle in the body frame. Under (3), one derives the following.
Recall that the AUV's speed is limited by s max and that v ≤ a max . Considering these limits, v(k + 1) is limited as follows.
Here, A = max( v(k) − a max * dt, s min ) and B = min( v(k) + a max * dt, s max ) − ( v(k) − a max * dt). In addition, s min is the minimum speed of the AUV, which is used to avoid the case where the AUV stops moving.
Algorithm 1 finds a non-collision speed utilizing the following FOR loop: This FOR statement indicates that one examines a velocity vector with low speeds before examining a velocity vector with high speeds. In this manner, the AUV does not speed up abruptly during its maneuver. Note that a low speed is desirable, considering the safety of both the AUV and a moving object, such as other AUVs.
Algorithm 1 Find a non-collision velocity command at sampling-index k + 1 (change yaw only) 1: The current sampling-index is k; if col(V I c , objectSet)==0; then 5: Return V I c as the velocity command, and this algorithm is finished; 6: end if 7: for ψ 0 = −α * dt, ψ 0 = ψ 0 + α * dt N , while ψ 0 < α * dt do 8: V I c = R(ψ(k), θ(k)) * R(ψ 0 ) * v 0 * u; 9: if col(V I c , objectSet)==0; then 10: Return V I c as the velocity command, and this algorithm is finished; 11: end if 12: 13: if col(V I c , objectSet)==0; then 14: Return V I c as the velocity command, and this algorithm is finished; 15: end if 16: end for 17: end for 18: Run Algorithm 2 (change both yaw and pitch); Algorithm 1 finds a non-collision velocity command while the AUV does not change its pitch. In this manner, the AUV's unnecessary depth change can be avoided. The AUV only finds a non-collision velocity while changing its yaw angle only.
Algorithm 1 finds a non-collision speed utilizing the following FOR loop: for ψ 0 = −α * dt, ψ 0 = ψ 0 + α * dt N , while ψ 0 < α * dt. The right turn is examined before the left turn in Algorithm 1. This order is set by considering the collision regulations (COLREGS) [35]. Suppose that there is a maneuvering object, such as other AUV, which also obeys COLREGs. As both the moving object and AUV obey COLREGs, they can avoid collisions with each other when they are close to each other.
In Algorithm 4, maxColNum is set by considering the computational load of the algorithm. By setting maxColNum as a small number, one does not have to examine the non-collision requirement for every objectPoint in objectSet. In simulations, one uses maxColNum = 100. if colNum > maxColNum then 7: break; 8: end if 9: end for 10: Return colNum, and this algorithm is finished; Find a Non-Collision Velocity Vector at Sampling-Index k + 1 (Change Both Yaw and Pitch) In the case where a non-collision velocity is not found under Algorithm 1, then Algorithm 2 runs to find a non-collision velocity command at sampling-index k + 1, while AUV changes both its pitch and yaw. Since AUV's pitch varies using Algorithm 1, the depth of AUV changes using this algorithm. In Algorithm 2, (θ 0 = −α * dt, θ 0 = θ 0 + 2 * α * dt N , while θ 0 < α * dt) is utilized to change the pitch of AUV.
Suppose that under Algorithm 2, one cannot find a non-collision velocity command, which avoids colliding with every objectPoint in objectSet. In this case, one finds a velocity command with the minimum collision probability by finding a velocity that collides with the minimum number of objectPoints. The velocity with the minimum collision probability is V I c = R(ψ(k), θ(k)) * R(minTheta) * R(minPsi) * minV * u. See the last line of Algorithm 2.

AUV with a Designated Depth
Suppose that AUV has a designated depth. This designated depth can be useful, since we may not want the depth of the AUV to be too deep or too shallow. Moreover, suppose that there are many AUVs in the workspace. Then, we can set a distinct designated depth for every AUV. In this way, each AUV can move on distinct sea layer, while not colliding with other AUVs.

Controllers for Moving towards the Goal
We address how to set AUV's velocity command so that it approaches the goal, while avoiding collision with obstacles. Let G denote the goal of AUV such that AUV needs to arrive at the goal safely. Using (4), let v(k) denote the L 2 norm of v(k), i.e., v(k) = v(k) . Moreover, let G q = G − q(k) for convenience.
AUV increases its speed so that it can reach the goal as fast as possible. This implies that one increases the AUV's speed to v d , which is given as follows.
v d = min(v(k) + dt * a max , s max ). (18) Here, the min operator is utilized, since (v(k) + dt * a max ) cannot be larger than the AUV's maximum speed s max .
Suppose the following.
Using v g in (20), the AUV heads towards the goal.
In the case where v g in (20) satisfies the non-collision requirement in Section 5.1, v g is utilized as the velocity of the AUV for a single sample duration. Using the definition of G q , v g is set so that the AUV moves towards the goal.
See Figure 1 for an illustration. The sphere is centered at q(k), and its radius is v(k) . The AUV is at q(k), which is the center of the sphere. v(k) is depicted as the bold arrow. G q is depicted as the dash dotted arrow. As the AUV at q(k) moves in the direction of G q , it can head towards the goal of G. Figure 1. The sphere is centered at q(k), and its radius is v(k) . The AUV is at q(k), the center of the sphere. G q is depicted as the dash dotted arrow. As the AUV at q(k) moves in the direction of G q , it can head towards the goal.

v(k)
In the case where v g does not satisfy the non-collision requirement, we use Algorithm 1 to find a velocity vector for avoiding collisions with obstacles. As long as v g satisfies the non-collision requirement, v g allows the AUV to reach the goal.
Suppose that holds. In this case, the AUV at q(k) cannot set v g in (20) as its velocity command due to the hardware limitations in (6). Therefore, the AUV turns with its maximum acceleration so that its velocity is as close to v g as possible.
Suppose that (21) holds. The AUV sets its velocity (v(k + 1) in (4)) as follows: Here, v d,t is parallel to v(k), and v d,n is normal to v(k). v d is set so that AUV turns with its maximum acceleration such that its velocity is as close to v g as possible. We acknowledge that v d in (22) cannot assure that the AUV reaches the goal, since the AUV's acceleration is bounded above.
In Figure 1, v d is depicted as the red arrow. Figure 1 illustrates the following: Figure 1 further illustrates that as the AUV at q(k) moves with velocity v d , the AUV approaches the goal G.
In (22), one uses the following: which is parallel to v(k). Moreover, we have the following: where G pro q is the projection of G q onto v(k) and is given by the following.
In Figure 1, G pro q is depicted as the dotted arrow. Moreover, G q − G pro q is depicted as the dashed arrow. As depicted in Figure 1, . This further implies that v d,n in (25) is normal to v(k). The subscript n in v d,n in (22) implies that v d,n is normal to v(k), and the subscript t in v d,t in (22) implies that v d,t is tangential to v(k).
In the case where v d in (22) satisfies the non-collision requirement in Section 5.1, v d is utilized as the velocity of AUV for a single sample duration. However, in the case where v d does not satisfy the non-collision requirement, we use Algorithm 1 to find a velocity vector for avoiding collisions with obstacles.

MATLAB Simulations
The performance of the proposed controllers in Algorithm 1 is demonstrated by utilizing MATLAB computer simulations. We use MATLAB 2010 on the computer with the following specification: Intel(R)Core(TMi5 − 7600KCPU@3.80GHz).
The sample duration is dt = 1 second, and k p = 80 is utilized in the reactive collision evasion control. The parameters associated with the ICP algorithm are Th ICP = 10 and k d = 2.
The AUV starts from (0, 50, 10) in meters. The process model of the AUV appeared in (4). In practice, AUV's motion is perturbed by process noise, such as ocean currents. Considering this process noise, we use the following: instead of (4). In (28), rand generates a random number between 0 and 1. n p indicates the process noise strength in (28). In MATLAB simulations, we use the n p = 1 meter by considering the drift due to ocean currents. The goal of AUV is (0, 500, 50) in meters. AUV approaches the goal while evading collision with obstacles. To approach the goal, AUV uses the control law in Section 6.
AUV's initial speed, maximum speed, maximum speed rate, and maximum turn rate are 6.3 m/s, s max = 12.75 m/s, a max = 2 m/s 2 , and α = 1.2 rad/s, respectively. Moreover, the minimum speed of the AUV is set as s min = 1.2 m/s. Note that the AUV needs to move along a narrow tunnel in simulations. The tunnel width is only 50 m.
We simulate the case where the AUV uses forward-looking sonar sensors for collision evasion. The maximum sensing range of the sonar sensors is 120 m. The sensor has 180 degrees in horizontal scan, such that 10 rays are evenly emanated in the horizontal direction. Moreover, it has 180 degrees in vertical scan, such that 10 rays are evenly emanated in the vertical direction. This implies that 10 × 10 sonar rays are emanated in total. As the number of sonar rays increases, we can have denser objectPoints on the obstacle boundary, which improves the performance of our collision avoidance controls. Our simulations use only 10 × 10 sonar rays, considering the hardware limit of AUV.
As a method to provide a realistic simulation environment, sonar sensor rays generate noisy position measurements. Recall that S(k) defines the set of objectPoints measured at sampling-index k and that S(k) is given by S(k) = {x i }, i ∈ {1, . . . , M k }. In MATLAB simulations, we use the following.
Here, x p i indicates an objectPoint derived using sonar rays without measurement noise. x p i is derived by calculating the intersection between a sonar ray and an obstacle surface. In (29), randn generates a Gaussian noise with mean zero and variance 1. Moreover, n r indicates the standard deviation for the measurement noise in sonar rays. In MATLAB simulations, we use n r = 0.05 m.
As another method to provide a realistic simulation environment, sonar sensor rays are emanated with a low detection rate of 0.95. In other words, one randomly chooses 95 percent of all 10 × 10 sonar rays and utilizes the chosen rays to sense an obstacle boundary. As a chosen sonar ray intersects a boundary, an objectPoint is generated at the intersection point.
Recall we say that the AUV is in the near-collision state, in the case where the distance between AUV and any objectPoint is shorter than r. In simulations, r = 10 is set by considering the size of AUV. In the case where the relative distance between AUV and an obstacle boundary is less than r c = 5 < r = 10 m, we assume that a collision has occurred. We use r c < r for AUV collisions, since sonar measurement error and the process noise can lead to the worst case where AUV enters the near-collision state. In other words, r − r c is the safety margin for the AUV.
In MATLAB simulations, the objectPoints measured by the AUV's sonar sensors are illustrated with black points. In addition, the AUV's path is illustrated with red circles. The goal is illustrated with the green asterisk. The simulations use one cylindrical obstacle and multiple box-shaped obstacles. The blue points in the figures indicate the vertices of each obstacle.

Scenario 1
We consider Scenario 1 with static obstacles. Figure 2 depicts the top view of the workspace. In addition, Figure 3 depicts the three-dimensional view of the workspace. These figures depict that AUV arrives at the goal (green asterisk) safely. See that objectPoints measured by sonar sensors are generated on obstacle surfaces.    Figure 4 shows the obstacle distance (distance from AUV to the closest obstacle) measured by AUV's sonar. Since the maximum sensing range of the sonar sensors is 120 m, the obstacle's distance is always less than 120 m. Initially, the AUV measures a cylindrical obstacle (circle located at (0,200) in Figure 2) and initiates changing its yaw for collision evasion. See that the AUV varies its state (speed, yaw, and pitch), while it moves.   Figure 4 shows the obstacle's distance (distance from the AUV to the closest obstacle) measured by AUV's sonar. Since the maximum sensing range of the sonar sensors is 120 m, the obstacle's distance is always less than 120 m.
Using MATLAB, it takes 44 s to run the entire simulation in Scenario 1. This computational time includes the time consumed to generate virtual obstacle environments, while we run the entire MATLAB simulation.

Scenario 2
We consider Scenario 2, in which the cylindrical obstacle in Figure 2 maneuvers with velocity (−3,−3,0) in m/s. At every 10 s, the moving obstacle (top and bottom circles of the cylindrical obstacle) is plotted. Figure 5 plots the top view of the workspace. Moreover, Figure 6 plots the three-dimensional view of the workspace. AUV arrives at the goal (green asterisk) while satisfying collision evasion.    Figure 6. The last subplot in Figure 7 represents the obstacle distance (distance to the closest obstacle) measured by AUV's sonar. Initially, the AUV measures a maneuvering cylindrical obstacle surface and changes its yaw for evading collision. See that the AUV varies its state (speed, yaw, and pitch) during the maneuver.  Figure 7. Scenario 2. The state (speed, yaw, and pitch) of the AUV as time elapses, considering the scenario in Figure 6. The last subplot shows the obstacle distance (distance to the closest obstacle) measured by AUV's sonar.
Using MATLAB, it takes 55 s to run the entire simulation in Scenario 2. This computational time includes the time spent to generate virtual obstacle environments, as one runs the entire MATLAB simulation.

Scenario 3
We consider Scenario 3, in which the cylindrical obstacle in Figure 2 maneuvers with velocity (0,−3,0) in m/s. At every 10 s, the moving obstacle (top and bottom circles of the cylindrical obstacle) is depicted. Figure 8 depicts the top view of the workspace, and Figure 9 plots the three-dimensional view of the workspace. These figures demonstrate that the AUV reaches the goal (green asterisk) while achieving collision evasion. The movie file of Figure 9 is uploaded on the following website: https://www.youtube.com/watch? v=WklOJ81QUsA (accessed on 22 July 2022 ).   Figure 10 depicts the state (speed, yaw, and pitch) of the AUV as time passes, considering the scenario in Figure 9. The last subplot in Figure 10 presents the obstacle distance (distance from AUV to the closest obstacle) measured by the AUV's sonar. Initially, the AUV measures a maneuvering cylindrical obstacle surface and varies its yaw for evading collision. See that the AUV changes its state (speed, yaw, and pitch) during the maneuver.  Figure 10. Scenario 3. The state (speed, yaw, and pitch) of the AUV as time elapses, considering the scenario in Figure 9. The last subplot shows the obstacle's distance (distance to the closest obstacle) measured by AUV's sonar.
Using MATLAB, it takes 41 s to run the entire simulation in Scenario 3. This computational time includes the time spent to construct virtual obstacle environments, while we run the entire MATLAB simulation.

Conclusions
This article introduced the reactive collision evasion controls, considering threedimensional scenarios where AUV measures extended obstacles (moving obstacles as well as static obstacles) utilizing on-board sonar sensors. The velocity of each objectPoint of an extended obstacle is estimated using ICP algorithms. The estimated obstacle velocity is then utilized as the input for reactive collision evasion of the obstacle.
We further discussed how to make the AUV move towards the goal while avoiding collision with extended obstacles. The performance of the proposed reactive controllers was demonstrated utilizing computer simulations. In the future, we will demonstrate the performance of the proposed controls utilizing experiments with real underwater robots.
The proposed collision evasion controls can be integrated with trajectory tracking controls in the literature [32][33][34]. We derive the position and orientation of the AUV η = [x, y, z, φ, θ, ψ] at each sampling-index k [34]. Here, [x, y, z] presents the position coordinates, and [φ, θ, ψ] presents the orientation of AUV. Inη at sampling-index k, [ẋ,ẏ,ż] presents the velocity command v(k) in (4). At each sampling-index k, the AUV examines whether the calculated command v(k) meets the non-collision requirement. If the non-collision requirement is met, then the AUV uses the command v(k) for tracking the trajectory. Otherwise, the AUV uses the proposed collision evasion controls for avoiding collision with obstacles.
This article considers reactive control for a single AUV. In the future, we will consider path planning of multiple AUVs while evading collision simultaneously. References [36][37][38][39] can be utilized for localization of multiple AUVs. Moreover, Refs. [40][41][42][43] can be utilized for the reliable formation control of multiple AUVs.