# Event-Based Path-Planning and Path-Following
## 2 Problem Formulation  
### AUV Model  
A wide variety of underwater applications require the AUV to operate at a constant depth. Following [23], we consider an underactuated AUV with two identical back thrusters mounted symmetrically with respect to its longitudinal axis in order to steer the AUV in the horizontal plane. Using the common and differential modes, the thrusters can generate a force \(\mathcal{F}\) along the AUV's longitudinal axis and a torque \(\mathcal{G}\) about its yaw axis, respectively.  
According to [23], the dynamics of such an AUV in 3 DOF can be described while using a global coordinate frame \(\{U\}\) and a body-fixed coordinate frame \(\{B\}\) (see Figure 1) by three kinematic equations  
\[\left\{\begin{array}{l}\dot{x}=u\cos(\psi_{B})-v\sin(\psi_{B}),\\ \dot{y}=u\sin(\psi_{B})+v\cos(\psi_{B}),\\ \dot{\psi}_{B}=r,\end{array}\right. \tag{1}\]  
and three dynamic equations (for surge, sway and yaw)  
\[\left\{\begin{array}{l}\mathcal{F}=m_{u}\dot{u}+d_{u},\\ 0=m_{v}\dot{v}+m_{ur}ur+d_{v},\\ \mathcal{G}=m_{r}\dot{r}+d_{r},\end{array}\right. \tag{2}\]  
where \((x,y)\) are the global coordinates of the AUV, \(\psi_{B}\) denotes the yaw angle, \(u\) and \(v\) are, respectively, the surge and sway speeds expressed in \(\{B\}\), \(r\) is the yaw rate;  
\[m_{u}=m-X_{i\dot{u}},\quad d_{u}=-X_{uu}u^{2}-X_{pv}v^{2},\] \[m_{v}=m-Y_{\dot{v}},\quad d_{v}=-Y_{v}uv-Y_{v|v|}v|v|,\] \[m_{r}=I_{z}-N_{r},\quad d_{r}=-N_{v}uv-N_{v|v|}v|-N_{r}ur,\] \[m_{ur}=m-Y_{r},\]\(m\) is the nominal mass of the AUV, \(I_{z}\) is its moment of inertia around \(Z\)-axis (as adopted in marine navigation, \(Z\)-axis or the yaw axis of the AUV is directed towards the bottom), \(X_{\{\cdot\}}\), \(Y_{\{\cdot\}}\), \(N_{\{\cdot\}}\) are the classical hydrodynamic derivatives that define added mass forces and moments as well as hydrodynamic damping. The interested reader is referred to [32; 33] for complete details.  
We use the following assumptions and physical constraints on the dynamics of the AUV to solve the problem under study.  
1. The model considered in the paper corresponds to the INFANTE AUV [33], which is a large-sized vehicle with a length of 4.22 m and a mass of 2234.5 kg.
2. The motion in roll, pitch, and heave is ignored in the model.
3. No waves, currents, or other disturbances are taken into account.
4. The AUV is fully submerged in water and away from the surface and seabed, which allows us to consider the hydrodynamic derivatives constant.
5. The back thrusters can generate force and torque constrained by \(\mathcal{F}_{\max}=500\,\mathrm{N}\) and \(\mathcal{G}_{\max}=300\,\mathrm{N}\cdot\mathrm{m}\), respectively.
6. The desired surge speed of the AUV is constant: \(u=1\,\mathrm{m}/\mathrm{s}\).  
Assuming that \(u\) is always nonzero, we define side-slip angle \(\beta=\arctan(v/u)\) and a reference frame \(\{W\}\), which is obtained by rotating \(\{B\}\) around the yaw axis through angle \(\beta\). Subsequently, the kinematic Equation (1) can be rewritten as  
\[\left\{\begin{array}{l}\dot{x}=v_{t}\cos(\psi_{W}),\\ \dot{y}=v_{t}\sin(\psi_{W}),\\ \dot{\psi}_{W}=r+\dot{\beta},\end{array}\right. \tag{3}\]  
where \(\psi_{W}=\psi_{B}+\beta\), \(v_{t}=(u^{2}+v^{2})^{1/2}\) is the absolute value of the total velocity vector \([u\,\,\,v]^{T}\). Straightforward calculations give the equation for \(v_{t}\), as  
\[\dot{v}_{t}=\frac{\mathcal{F}-d_{u}}{m_{u}}\cos\beta-\frac{m_{ur}ur+d_{v}}{m_{ v}}\sin\beta. \tag{4}\]