## 3 Collision Avoidance Model
### Ellipse Collision Avoidance Model  
When the USV encounters obstacles with a large aspect ratio, the obstacles can be represented as ellipses, which is more in line with their contour characteristics, the redundant expansion area can be reduced, and the available sailing route can be increased. As shown in Figure 3, the motion collision avoidance model is the same as that of the circular collision avoidance model. In order to obtain the collision domain of the ellipse model, the tangent vectors between the ellipse model and the USV are calculated, so as to obtain the collision domain \(\mu_{1}\) and \(\mu_{2}\).  
To facilitate the calculation of tangent vectors, an elliptical coordinate system \(X_{O}O^{\prime}Y_{O}\) is established with the center point of the obstacle as the origin \(O^{\prime}\), and with \(Y_{O}\) parallel to the velocity direction of the obstacle vessel. The coordinates of the USV are transformed from the global coordinate system to the elliptic coordinate system [38], as shown in Figure 4.  
In Figure 4, \(T_{1}\) and \(T_{2}\) are the two tangent points of the obstacle relative to the USV in the global coordinate system. \(T_{1}^{Obs}\) and \(T_{2}^{Obs}\) are the two tangent points in the elliptic coordinate system. The position of the USV is converted from the global coordinate system to the elliptic coordinate system using  
\[USV_{Obs}=R_{O}(USV_{C}-Obs_{C}), \tag{13}\]  
Figure 3: Ellipse obstacle avoidance model.  
where \(USV_{Obs}=\left[x_{UIO},y_{UIO}\right]^{T}\) and \(USV_{C}\) represent the positions of the USV in the elliptic coordinate system and global coordinate system respectively, \(Obs_{C}\) is the position of the obstacle in the global coordinate system, and \(R_{O}\) is the transformation matrix as  
\[R_{O}=\left[\begin{array}{c}\cos\theta_{LO}\text{sin}\theta_{LO}\\ -\sin\theta_{LO}\text{cos}\theta_{LO}\end{array}\right] \tag{14}\]  
The standard elliptic equation and tangent equation are  
\[\begin{cases}\dfrac{x_{T}^{2}}{a^{2}}+\dfrac{y_{T}^{2}}{b^{2}}=1\\ \dfrac{x_{T}x_{UIO}}{a^{2}}+\dfrac{y_{T}y_{UIO}}{b^{2}}=1\end{cases}, \tag{15}\]  
where the \(a\) and \(b\) are the lengths of the semimitor axis and semimajor axis of the ellipse, respectively. The tangent point coordinate \(T_{Obs}=\left(x_{T},y_{T}\right)\) of the ellipse obstacle relative to the USV in the elliptic coordinate system can be obtained by (15), and it can be transformed into the global coordinate system by  
\[T={R_{O}}^{-1}{T_{Obs}}+Obs_{C}. \tag{16}\]  
The tangent vector can be obtained by the tangent point, and \(\mu_{1}\) and \(\mu_{2}\) can be obtained from the tangent vectors of the USV to the elliptical obstacle. Therefore, when the USV escapes from the collision domain, the following equation should be satisfied:  
\[\begin{cases}\dfrac{\sin\varphi}{v_{UIO}}\Delta v_{U}+\dfrac{v_{U}\cos\varphi} {v_{UIO}}\Delta\alpha\geq\mu_{1}-\gamma&\gamma\geq 0\\ \dfrac{\sin\varphi}{v_{UIO}}\Delta v_{U}+\dfrac{v_{U}\cos\varphi}{v_{UIO}} \Delta\alpha\leq-\mu_{2}-\gamma&\gamma<0\end{cases}. \tag{17}\]  
The USV will detect whether there are obstacles entering its safety range in real time. When the obstacles enter the safe range, the USV and its relative velocity direction are in the collision domain, and the USV needs to start to take evasive action. According to \(\Delta v_{U}\) and \(\Delta\alpha\), the evasion trajectory \(\Gamma_{d}(x_{d},y_{d})\) can be obtained and used as the desired trajectory to make the USV avoid obstacles.  
Figure 4: Tangents of ellipse obstacle.