SafetyCertificated LineofSight Guidance of Unmanned Surface Vehicles for StraightLine Following in a Constrained Water Region Subject to Ocean Currents
https://doi.org/10.1007/s11804023003519

Abstract
The collisionfree straightline following of an unmanned surface vehicle (USV) moving in a constrained water region subject to stationary and moving obstacles is addressed in this paper. USV systems are normally subjected to surge velocity constraints, yaw rate constraints, and unknown ocean currents. Herein, a safetycertificated lineofsight (LOS) guidance method is proposed to achieve a constrained straightline following task. First, an antidisturbance LOS guidance law is designed based on the LOS guidance scheme and an extended state observer. Furthermore, collision avoidance with waterway boundaries and stationary/moving obstacles is encoded in control barrier functions, utilizing which the safety constraints are transformed into input constraints. Finally, safetycertificated guidance signals are obtained by solving a quadratic programming problem subject to input constraints. Using the proposed safetycertified LOS guidance method, the USV can accomplish a straightline following task with guaranteed inputtostate safety. Simulation results substantiate the efficacy of the proposed safetycertificated LOS guidance method for the straightline following of USVs moving in a constrained water region subject to unknown ocean currents.Article Highlights● A CBFbased safecertificated LOS guidance method is proposed to address the guidance problem in a constrained water region.● The proposed guidance method can address the collision avoidance with stationary/moving obstacles, in addition to the waterway boundaries.● An optimizationbased guidance method is proposed to guarantee the guidance law satisfying the input constraints in the path following task. 
1 Introduction
Water transport plays an important role in economic developments and accounts for about 95% of global transportation tasks (Gu et al., 2023; Zereik et al., 2018; Wu et al., 2020; Campbell et al., 2012; Peng et al., 2021; Lv et al., 2022; Zhang et al., 2018; Wang et al., 2021). Unmanned surface vehicles (USVs) are versatile watercraft that can perform water transportation tasks with minimum human supervision (Li et al., 2022; Shi et al., 2017; Skjetne et al., 2005; Gu et al., 2021; Chen and Wei, 2014; Wu et al., 2021; Veremey, 2014; Wu et al., 2022a; Ma et al., 2018). Trajectory tracking and path following are two fundamental motion control problems for USVs (Qu et al., 2017; Aguiar and Hespanha, 2007; Paliotta et al., 2019; Jiang and Liang, 2018; Ma et al., 2022). In particular, trajectory tracking requires a USV to track a timerelated trajectory (Peng et al., 2021; Yu et al., 2020; Katayama and Aoki, 2014; He et al., 2017; Li et al., 2018), whereas path following refers to forcing a USV to follow a path without strict temporal specifications. Path following takes an attractive decoupling property between the geometric task of controlling the USV position and the dynamic task of assigning a speed profile for virtual tracking (Wang et al., 2012; Meng et al., 2012; Deng et al., 2020; Abdurahman et al., 2019; Breivik et al., 2008; Wang et al., 2019; Fossen et al., 2017; Qu et al., 2017; Ma et al., 2021; Wu et al., 2022b; Peng et al., 2023).
In recent years, lineofsight (LOS) guidance, as an intuitive and effective way to achieve path convergence, has been studied on the basis of path following. In Fossen and Pettersen (2014), a proportional LOS guidance law is proposed, and its uniform semiglobal exponential stability is proven. In Caharijia et al. (2016), an integral LOS guidance law is constructed to compensate for the drift effect of environmental disturbances. In the study conducted by Belleter et al. (2019), an adaptive LOS guidance law is proposed to solve the problem of path following subject to constant ocean currents. In Liu et al. (2017), an extended state observer (ESO) based LOS guidance law is proposed, where a reducedorder ESO is used to estimate the timevarying sideslip angle. Moreover, two ESOs are used to separately estimate surge and sway linear velocities (Yu et al., 2019a); that is, the unmeasured sideslip angle can be indirectly calculated and compensated on the basis of the LOS guidance law. In Yu et al. (2019b), a finitetime LOSbased guidance law is developed; that is, path following can be achieved within a finite time. However, the abovementioned LOS guidance methods only consider a USV running in an openwater area. With regard to a USV running in a constrained water region, e. g., inland rivers or canals, the abovementioned LOS guidance methods cannot be applied as safety cannot be ensured. In achieving path following in a constrained water region, an errorconstrained LOS guidance law is proposed (Zheng et al., 2018; Zheng, 2020), where the path following tracking errors are constrained by using a tantype barrier Lyapunov function method. Although the errorconstrained LOS guidance method could avoid collisions with waterway boundaries by constraining tracking errors, it cannot address guidance moving in a constrained water region with multiple stationary and moving obstacles.
Given the abovementioned discussions, this paper investigates the safetycertificated LOS guidance of a USV in a constrained water region with multiple obstacles. First, an ESO is proposed to estimate unknown ocean currents. Next, a straightline LOS guidance law is designed on the basis of the estimated information from the ESO. Then, in achieving a collisionfree straightline following task, control barrier functions (CBFs) are used to optimize the guidance signals where safe guidance signals are obtained by solving a quadratic programming problem. By using the proposed safecertificated LOS guidance method, the USV can follow a straightline path in a constrained water region while ensuring safety. Finally, the closedloop guidance system can ensure inputtostate safety (ISSf) and that all error signals are uniformly and ultimately bounded. Simulation results are provided to substantiate the efficacy of the proposed safecertificated LOS guidance method for straightline following of a USV in a constrained water region.
• In contrast to the LOS guidance method proposed by Fossen and Pettersen (2014), Caharijia et al. (2016), Liu et al. (2016), Liu et al. (2017), Belleter et al. (2019), Yu et al. (2019a), Yu et al. (2019b), and Peng et al. (2019), which lacks environmental constraints, a CBFbased safecertificated LOS guidance method is proposed herein to address the guidance problem in a constrained water region with waterway boundaries. The proposed safecertificated LOS guidance law can prevent collisions between the USV and waterway boundaries, allowing the USV to safely navigate through narrow waterways.
• In contrast to the errorconstrained LOS guidance method (Zheng et al., 2018; Zheng, 2020), where the tracking errors are confined without violating waterway constraints, the proposed guidance method can address the collision avoidance problem with multiple stationary and moving obstacles in the constrained water region, in addition to the waterway boundaries.
• In contrast to the LOS guidance method proposed by Fossen and Pettersen (2014), Caharijia et al. (2016), Liu et al. (2017), Belleter et al. (2019), Yu et al. (2019a), Yu et al. (2019b), Zheng et al. (2018), and Zheng (2020) where the input constraints are not considered, an optimizationbased guidance method is proposed to ensure that the resulting guidance law satisfies the input constraints in path following and collision avoidance tasks.
2 Preliminaries and problem formulation
2.1 Notation
$\Re^{n}$ denotes the $n$dimensional Euclidean space. $\cdot$ represents the absolute value of a real number. $\\cdot\$ denotes the twonorm of a matrix or a vector. $I_{n}$ denotes an identity matrix with $n$ dimension. A continuous function $\gamma:[b, a) \rightarrow \mathfrak{R}^{+}$ with $\gamma(0)=0$ and $\gamma$ is strictly and monotonically increasing. If $a \in \mathfrak{R}^{+}$and $b=0$, then $\gamma$ is a class $\mathcal{K}$ function. If $a=\infty, b=0$ and $\lim _{x \rightarrow \infty} \gamma(x)=\infty$, then $\gamma$ is a class $\mathcal{K}_{\infty}$ function. If $\gamma: \Re \rightarrow \Re, \lim _{x \rightarrow \infty} \gamma(x)=\infty$, and $\lim _{x \rightarrow\infty} \gamma(x)=\infty$, then $\gamma$ is a class extended $\mathcal{K}_{\infty}$ function denoted by $\mathcal{K}_{\infty, e}$.
2.2 Control barrier function
Consider the following continuous time dynamical systems,
$$ \dot{\boldsymbol{x}}=f(\boldsymbol{x})+g(\boldsymbol{x}) \boldsymbol{u} $$ (1) $$ \dot{\boldsymbol{x}}=f(\boldsymbol{x})+g(\boldsymbol{x})(\boldsymbol{u}+\boldsymbol{w}) $$ (2) where $\boldsymbol{x} \in \mathfrak{R}^{n}$ is the state; $\boldsymbol{u} \in \mathfrak{R}^{m}$ is the control input; $w \in \mathfrak{R}^{m}$ is the disturbance assumed to be bounded and satisfied $\\boldsymbol{w}\_{\infty} \triangleq \operatorname{ess} \sup _{t>0}\\boldsymbol{w}\ \text {. The function } f: \Re^n \rightarrow \mathfrak{R}^n$ and $g: \Re^{n} \rightarrow \Re^{n \times m}$ are continuously differentiable.
Let $h: \Re^{n} \rightarrow \Re$ be a continuously differentiable function. Consider a set $\mathcal{S} \subset \Re^{n}$, the 0 superlevel set of $h$ is defined as follows:
$$ \begin{aligned} & \mathcal{S}=\left\{\boldsymbol{x} \in \mathfrak{R}^{n} \mid h(\boldsymbol{x}) \geqslant 0\right\} \\ & \partial \mathcal{S}=\left\{\boldsymbol{x} \in \mathfrak{R}^{n} \mid h(\boldsymbol{x})=0\right\} \\ & \operatorname{Int}(\mathcal{S})=\left\{\boldsymbol{x} \in \mathfrak{R}^{n} \mid h(\boldsymbol{x})>0\right\} \end{aligned} $$ (3) For any $\boldsymbol{x}(0) \in \mathcal{S}, \boldsymbol{x}(t) \in \mathcal{S}$ with $t \in\left[0, T_{\max }\right)$, set $\mathcal{S}$ is called forward invariant, and when $T_{\max }=\infty$, it is called forward complete (Molnar et al., 2022). The nominal closedloop system (1) is safe on set $\mathcal{S}$ if $\mathcal{S}$ is forward invariant.
Definition 1 (Ames et al., 2017). Let $\mathcal{S} \subset \Re^{n}$ be the 0superlevel set of a continuously differentiable function $h$ : $\Re^{n} \rightarrow \Re$ given in (3). Then, $h(x)$ is a CBF for the system (1) on $\mathcal{S}$ if there exists $\alpha \in \mathcal{K}_{\infty, e}$ such that $\forall \boldsymbol{x} \in \mathcal{S}$.
$$ \sup _{\boldsymbol{u} \in \Re^{m}} \dot{h}(\boldsymbol{x}, \boldsymbol{u}) \triangleq L_{f} h(\boldsymbol{x})+L_{g} h(\boldsymbol{x}) \boldsymbol{u} \geqslant\alpha(h(\boldsymbol{x})) $$ (4) where $L_{f} h$ and $L_{g} h$ represent the Lie derivatives of $h(x)$.
Definition 2 (Kolathaya and Ames, 2019). Let $\mathcal{S} \subset \Re^{n}$ be the 0 superlevel set of a continuously differentiable function $h: \Re^{n} \rightarrow \Re$. Then, $h(x)$ is an ISSfCBF for the disturbed system (2) on set $\mathcal{S}$ if there exists $\alpha \in \mathcal{K}_{\infty, e}$, $l \in \mathcal{K}_{\infty}$ such that $\forall \boldsymbol{x} \in \mathcal{S}$.
$$ \sup\limits_{\boldsymbol{u} \in \mathfrak{R}^{m}} L_{f} h(\boldsymbol{x})+L_{g} h(\boldsymbol{x}) \boldsymbol{u} \geqslant\alpha(h(\boldsymbol{x}))\imath\left(\\boldsymbol{w}\_{\infty}\right)(5) $$ (5) Lemma 1 (Das and Richard, 2022). Consider the disturbed system (2) with an estimated error quantified by an observer that provides $\hat{w}$ with an estimation error bound $\left\L_{g} h(x) \tilde{w}\right\ \leqslant M_{d}$. A continuous differentiable function $h: \mathfrak{R}^{n} \rightarrow \Re$ and $\gamma \in \mathcal{K}_{\infty, e}$ are given for the nominal system (1). If a control signal $\boldsymbol{u} \in \mathfrak{R}^{m}$ is satisfied, then a robust CBF constraint is defined as follows:
$$ L_{f} h(\boldsymbol{x})+L_{g} h(\boldsymbol{x})(\boldsymbol{u}+\hat{\boldsymbol{w}})M_{d} \geqslant\alpha(h(\boldsymbol{x})) $$ (6) Lemma 1 applies to highrelativedegree CBF constraints. The $d$ thorder time derivative of $h(\boldsymbol{x})$ is given as follows:
$$ h^{d}(\boldsymbol{x}, \boldsymbol{u}, \boldsymbol{w})=L_{f}^{d} h(\boldsymbol{x})+L_{g} L_{f}^{d1} h(\boldsymbol{x})(\boldsymbol{u}+\boldsymbol{w}) $$ (7) where the unknown dynamics $L_{g} L_{f}^{d1} h(x) w$ can be estimated by an observer. If there exists a constant $M_{e} \in \mathfrak{R}^{+}$ such that the estimation error $\left\L_{g} L_{f}^{d1} h(\boldsymbol{x}) \tilde{w}\right\ \leqslant M_{e}$, then the robust CBF constraint is defined as follows:
$$ L_{f}^{d} h(\boldsymbol{x})+L_{g} L_{f}^{d1} h(\boldsymbol{x})(\boldsymbol{u}+\hat{\boldsymbol{w}})M_{e} \geqslantK_{a} \boldsymbol{\eta}_{b}(\boldsymbol{x}) $$ (8) where $\boldsymbol{\eta}_{b}(\boldsymbol{x})=\left[h(\boldsymbol{x}), \dot{h}(\boldsymbol{x}), \ddot{\boldsymbol{h}}(\boldsymbol{x}), \cdots, h^{d1}(\boldsymbol{x})\right]^{\mathrm{T}}$ and $K_{\alpha} \in \Re^{d}$.
2.3 Problem Formulation
Two reference frames are used to describe the motion of a USV: an earthfixed frame and a bodyfixed frame. The kinematics of the USV is expressed as follows:
$$ \dot{\boldsymbol{\eta}}=\boldsymbol{R}(\psi)\left(\begin{array}{c} u \\ v \\ r \end{array}\right)+\boldsymbol{R}\left(\psi_{i d}\right)\left(\begin{array}{c} w_{s} \\ w_{e} \\ 0 \end{array}\right) $$ (9) where $\boldsymbol{\eta}=\left[p^{\mathrm{T}}, \psi\right]^{\mathrm{T}} \in \mathfrak{R}^{3}$ with $\boldsymbol{p}=[x, y]^{\mathrm{T}} \in \mathfrak{R}^{2}$ denotes the position, and $\psi \in({\rm{\mathsf{π}}}, {\rm{\mathsf{π}}}]$ denotes the yaw angle; $u, v$, and $r \in \Re$ indicate the surge velocity, sway velocity, and yaw rate in the bodyfixed frame, respectively; $\psi_{i d} \in({\rm{\mathsf{π}}}, {\rm{\mathsf{π}}}]$ denotes the ith route segment. $w_{s}$ and $w_{e}$ denote constant disturbance induced by ocean currents; $\boldsymbol{R}(\psi)$ and $\boldsymbol{R}\left(\psi_{ {id }}\right)$ are rotation matrixes defined as follows:
$$ \boldsymbol{R}(\psi)=\left[\begin{array}{ccc} \cos (\psi) & \sin (\psi) & 0 \\ \sin (\psi) & \cos (\psi) & 0 \\ 0 & 0 & 1 \end{array}\right] $$ (10) As shown in Figure 1, a sequence of the desired straightline route segments is defined as follows:
$$ a_{i} x_{i d}+b_{i} y_{i d}+c_{i}=0 $$ (11) where $a_{i}, b_{i}$, and $c_{i} \in \Re$ are the parameters; subscript $i$ denotes the ith route segment. The waypoint $\boldsymbol{p}_{i d}=$ $\left[x_{i d}, y_{i d}\right]^{\mathrm{T}} \in \Re^{2}$ on the route is obtained as follows:
$$ a_{i} x_{i d}+b_{i} y_{i d}+c_{i}=0 $$ (12) In accomplishing the straightline following task, waypoint tracking errors are defined as follows:
$$ \left(\begin{array}{l} s \\ e \end{array}\right)=R^{\mathrm{T}}\left(\psi_{i d}\right)\left(\begin{array}{l} xx_{i d} \\ yy_{i d} \end{array}\right) $$ (13) The time derivative of Equation (13) along the kinematics (9) is given as follows:
$$ \left(\begin{array}{c} \dot{s} \\ \dot{e} \end{array}\right)=\left[\begin{array}{l} U \cos \left(\psi\psi_{i d}+\beta\right)+w_{s} \\ U \sin \left(\psi\psi_{i d}+\beta\right)+w_{e} \end{array}\right] $$ (14) where $\beta=\operatorname{atan}(v / u)$ denotes the sideslip angle; $\psi_{i d}=$ $\operatorname{atan} 2\left(a_{i}, b_{i}\right)$ and $U=\sqrt{u^{2}+v^{2}}$ are the resultant velocity.
As shown in Figure 2, the constrained water region can be modeled as two waterway boundaries $L_{i j}, j=1, 2$ parallel to the ith straightline route segment. The two waterway boundaries are $L_{i j}=\left\{a_{i j}, b_{i j}, c_{i j} \in \mathfrak{R} \mid a_{i j} x+b_{i j} y+c_{i j}=0, i=\right.$ $1, 2, \cdots, n, j=1, 2\}$. Next, consider $M_{1}$ static obstacles $O_{k s}$, $k=1, 2, \cdots, M_{1}$, which are modeled as a closed circular disk of radius $d_{k s}$, centered at $\boldsymbol{p}_{k s}=\left[x_{k s}, y_{k s}\right]^{\mathrm{T}} \in \Re^{2}$. Consider $M_{2}$ moving obstacles $O_{k m}, k=1, 2, \cdots, M_{2}$, which is modeled as a closed circular disk of radius $d_{k m}$, centered at $\boldsymbol{p}_{k m}=$ $\left[x_{k m}, y_{k m}\right]^{\mathrm{T}} \in \mathfrak{R}^{2}$.
The safecertificated straightline following in a constrained water region aims to design a guidance method for a USV with kinematics (9); that is, the USV is able to converge to the straightline path and avoid collisions with waterway boundaries and stationary/moving obstacles. In particular, the control objective is divided into four parts.
• The goal reaching task is achieved as follows:
$$ \lim\limits_{t \rightarrow \infty}\left\\boldsymbol{p}\boldsymbol{p}_{i d}\right\ \leqslant \varepsilon_{0} $$ (15) where $\varepsilon_{0} \in \Re$ is a small positive constant.
• Collision avoidance with a waterway boundary task is measured as follows:
$$ D_{i j}\sqrt{L^{2}+W^{2}} / 2>d_{i j}, \quad i=1, 2, \cdots, n, \quad j=1, 2 $$ (16) where $D_{i j}$ is the distance between USV's center point and the waterway boundary; $L$ is the length of the USV; $W$ is the width of the USV; $d_{i j} \in \Re$ denotes the safe distance between the waterway boundary and the USV.
• Collision avoidance with a stationary obstacle task is measured as follows:
$$ \left\\boldsymbol{p}\boldsymbol{p}_{k s}\right\>d_{k s}, \quad k=1, 2, \cdots, M_{1} $$ (17) where $d_{k s} \in \Re$ denotes the safe distance between the stationary obstacles and the USV.
• Collision avoidance with a moving obstacle task is calculated as follows:
$$ \left\\boldsymbol{p}\boldsymbol{p}_{k m}\right\>d_{k m}, \quad k=1, 2, \cdots, M_{2} $$ (18) where $d_{k m} \in \Re$ denotes the safe distance between the moving obstacle and the USV.
3 Design and analysis
As shown in Figure 3 a safetycertificated LOS guidance is designed in this section. First, a straightline LOS guidance law is developed where an ESO is used to estimate unknown ocean currents. Next, CBFs are constructed to encode currents' collision avoidance tasks of waterway boundaries and stationary/moving obstacles as safety constraints. Finally, quadratic programming problems are formulated to obtain safetycertificated guidance signals within safety and velocity constraints.
3.1 Ocean current ESO design
Let $\hat{w}_{s}$ and $\hat{w}_{e}$ be the estimates of $w_{s}$ and $w_{e}$, respectively. A linear ESO is developed to estimate the unknown ocean as follows:
$$ \left[\begin{array}{c} \dot{\hat{s}} \\ \dot{\hat{e}} \\ \dot{\hat{w}}_{s} \\ \dot{\hat{w}}_{e} \end{array}\right]=\left[\begin{array}{c} U \cos \left(\psi\psi_{i d}+\beta\right)+\hat{w}_{s}k_{s 1} \tilde{s} \\ U \sin \left(\psi\psi_{i d}+\beta\right)+\hat{w}_{e}k_{e 1} \tilde{e} \\ k_{s 2} \tilde{s} \\ k_{e 2} \tilde{e} \end{array}\right] $$ (19) where $\tilde{s}=\hat{s}s$ and $\tilde{e}=\hat{e}e ; k_{s 1}, k_{e 1}, k_{s 2}$, and $k_{e 2} \in \Re$ are positive gains.
Let $\tilde{w}_{s}=\hat{w}_{s}w_{s}$ and $\tilde{w}_{e}=\hat{w}_{e}w_{e}$. Consequently, the estimation error dynamics is given as follows:
$$ \dot{\boldsymbol{E}}_{1}=\boldsymbol{A} \boldsymbol{E}_{1}+\boldsymbol{B} \boldsymbol{w} $$ (20) where $\boldsymbol{E}_{1}=\left[\tilde{s}, \tilde{e}, \tilde{w}_{s}, \tilde{w}_{e}\right]^{\mathrm{T}}, \boldsymbol{w}=\left[\dot{w}_{s}, \dot{w}_{e}\right]^{\mathrm{T}}$ and
$$ \boldsymbol{A}=\left[\begin{array}{cccc} k_{s 1} & 0 & 1 & 0 \\ 0 & k_{e 1} & 0 & 1 \\ k_{s 2} & 0 & 0 & 0 \\ 0 & k_{e 2} & 0 & 0 \end{array}\right], \quad \boldsymbol{B}=\left[\begin{array}{cc} 0 & 0 \\ 0 & 0 \\ 1 & 0 \\ 0 & 1 \end{array}\right] $$ Considering that $\boldsymbol{A}$ is a Hurwitz matrix, a symmetric positive definite matrix $\boldsymbol{P}$ is observed; that is, $\boldsymbol{A}^{\mathrm{T}} \boldsymbol{P}+\boldsymbol{P A}=$  $\xi{\boldsymbol{I}}_{4}$, where $\xi \in \Re$ is a positive constant. In analyzing the stability of (20), the following assumption is made (Gu et al., 2022).
Assumption 1. The disturbances' $w_{i}, i=s, e$ derivatives are bounded; that is, $\leftw_{i}(t)\right+\left\dot{w}_{i}(t)\right<w_{i}^{*}$, with $w_{i}^{*}$ being a positive constant.
Lemma 2. Under Assumption 1, the ESO subsystem (20), with the state vector being $E_{1}$ and the input being $w$, is inputtostate stable (ISS).
Proof: Consider a Lyapunov function
$$ \boldsymbol{V}_{1}=\frac{1}{2} \boldsymbol{E}_{1}^{\mathrm{T}} \boldsymbol{P} \boldsymbol{E}_{1} $$ (21) and its time derivative along (20) is given as follows:
$$ \dot{\boldsymbol{V}}_{1} \leqslant\frac{\xi}{2}\left\\boldsymbol{E}_{1}\right\^{2}+\left\\boldsymbol{E}_{1}\right\\\bf{P B}\_{F}\\boldsymbol{w}\ $$ (22) As
$$ \left\\boldsymbol{E}_{1}\right\ \geqslant 2\\bf{P B}\_{F}\\boldsymbol{w}\ /\left(\xi \theta_{1}\right) $$ (23) renders
$$ \dot{\boldsymbol{V}}_{1} \leqslant\frac{\xi}{2}\left(1\theta_{1}\right)\left\\boldsymbol{E}_{1}\right\^{2} $$ (24) where $0<\theta_{1}<1$. Therefore, subsystem (20) is ISS (Khalil, 2015), and $\boldsymbol{E}_{1}(t)$ is satisfied as follows:
$$ \begin{aligned} & \left\\boldsymbol{E}_{1}(t)\right\ \leqslant \sqrt{\frac{\lambda_{\max }(\boldsymbol{P})}{\lambda_{\min }(\boldsymbol{P})}} \max \left\{\left\\boldsymbol{E}_{1}\left(t_{0}\right)\right\ e^{\frac{\xi\left(1\theta_{1}\right)\left(tt_{0}\right)}{\lambda_{\max }(\boldsymbol{P})}}, \right. \\ & \left.2\\bf{P B}\_{F}\\boldsymbol{w}\ /\left(\xi \theta_{1}\right)\right\} \end{aligned} $$ (25) 3.2 LOS guidance design
Before the design, the following assumption is made.
Assumption 2. Considering kinematics, the kinetic error is assumed to be 0, that is, $U=U_{\mathrm{o}}, r=r_{\mathrm{o}}$, where $U_{\mathrm{o}}$ and $r_{\mathrm{o}}$ are the optimized surge velocity and yaw rate, respectively.
Recalling the error dynamics (14),
$$ \left\{\begin{array}{l} \dot{s}=\left(U_{e}+U_{\mathrm{cmd}}\right)\left(12 \sin ^{2}\left(\frac{\psi\psi_{i d}+\beta}{2}\right)\right)+w_{s} \\ \dot{e}=U_{0} \sin \left(\psi_{\mathrm{cmd}}+\psi_{e}+\beta\psi_{i d}\right)+w_{e} \end{array}\right. $$ (26) where $U_{e}=U_{\mathrm{o}}U_{\mathrm{cmd}}$ and $\psi_{e}=\psi\psi_{\text {cmd }}$.
By using the estimated information from the ESO (19), a LOS guidance law is designed on the basis of (26).
$$ \left[\begin{array}{c} U_{\mathrm{cmd}} \\ \psi_{\mathrm{cmd}} \\ r_{\mathrm{cmd}} \end{array}\right]=\left[\begin{array}{c} \frac{k_{u} s}{\sqrt{s^{2}+\Delta_{u}^{2}}}+f_{U}\hat{w}_{s} \\ \psi_{i d}\arctan \left(\frac{e+g}{\Delta_{\psi}}\right)\beta \\ \frac{k_{r} \psi_{e}}{\sqrt{\psi_{e}^{2}+\Delta_{r}^{2}}} \end{array}\right] $$ (27) where $f_{U}=2 U_{\mathrm{o}} \sin ^{2}\left(\frac{\psi\psi_{i d}+\beta}{2}\right) ; k_{u}>0$ and $k_{r}>0$ are constant controller gains; $\Delta_{u}>0, \Delta_{\psi}>0$ and $\Delta_{r}>0$ are parameters. The velocity guidance signal $U_{\mathrm{cmd}}$ is designed using feedback linearization. The second term of the heading guidance signal $\psi_{\mathrm{cmd}}$ is an LOS angle, which is used to guide the USV converging to the desired path. $g$ is a component additionally designed to compensate for the unknown ocean current in the $e$ direction.
Substituting Equation (27) into Equation (26),
$$ \left[\begin{array}{c} \dot{s} \\ \dot{e} \end{array}\right]=\left[\begin{array}{c} \frac{k_{u} s}{\sqrt{s^{2}+\Delta_{u}^{2}}}\tilde{w}_{s}+U_{e} \\ \frac{U_{0}(e+g)}{\sqrt{(e+g)^{2}+\Delta_{\psi}^{2}}}+w_{e}+G(\cdot) \end{array}\right] $$ (28) where $G$ is a perturbing term, which is given as follows:
$$ \begin{aligned} G(\cdot)= & U_{0}\left[1\cos \left(\psi_{e}\right)\right] \sin \left(\arctan \left(\frac{e+g}{\Delta_{\psi}}\right)\right) \\ & +U_{0} \cos \left(\arctan \left(\frac{e+g}{\Delta_{\psi}}\right)\right) \sin \left(\psi_{e}\right) \end{aligned} $$ (29) $G\left(\psi_{e}, \psi_{\mathrm{cmd}}, e, U_{\mathrm{o}}\right)$ satisfies $G\left(0, \psi_{\mathrm{cmd}}, e, U_{\mathrm{o}}\right)=0$ and $\G(\cdot)\ \leqslant \zeta\left(U_{0}\right)\left\\psi_{e}\right\$, where $\zeta\left(U_{0}\right)>0$ (Maghenem et al., 2017). $G(\cdot)$ is zero when the perturbing variable $\tilde{\psi}$ is zero, and it has maximal linear growth in perturbing variables.
In compensating for the ocean current component $w_{e}$ in (28), $g$ is selected to satisfy the following equality (Belleter et al., 2019):
$$ U_{0} \frac{g}{\sqrt{\Delta_{\psi}^{2}+(e+g)^{2}}}=\hat{w}_{e} $$ (30) Based on (30),
$$ \left(U_{\mathrm{o}}^{2}\hat{w}_{e}^{2}\right)\left(\frac{g}{\hat{w}_{e}}\right)^{2}=\Delta_{\psi}^{2}+e^{2}+2 e \hat{w}_{e}\left(\frac{g}{\hat{w}_{e}}\right) $$ (31) Let $a=\hat{w}_{e}^{2}U_{0}^{2}, b=e \hat{w}_{e}$ and $c=\Delta_{\psi}^{2}+e^{2}$. Considering that $U_{0}^{2}\hat{w}_{e}^{2}>0, b^{2}a c=\Delta_{\psi}^{2}\left(U_{0}^{2}\hat{w}_{e}^{2}\right)+e^{2} U_{0}^{2}>0$.
Based on the quadratic formula,
$$ g=\hat{w}_{e} \frac{b+\sqrt{b^{2}a c}}{a} $$ (32) where the negative root is abandoned to ensure that $g$ and $\hat{w}_{e}$ have the same sign.
Substituting $g$ into Equation (28), we obtain
$$ \left[\begin{array}{c} \dot{s} \\ \dot{e} \end{array}\right]=\left[\begin{array}{c} \frac{k_{u} s}{\sqrt{s^{2}+\Delta_{u}^{2}}}\tilde{w}_{s}+U_{e} \\ \frac{U_{o} e}{\sqrt{(e+g)^{2}+\Delta_{\psi}^{2}}}\tilde{w}_{e}+G(\cdot) \end{array}\right] $$ (33) Lemma 3. The error subsystem (33), viewed as a system with the states being sand eand the inputs being $\tilde{w}_{s}, \tilde{w}_{e}, U_{e}$, and $G(\cdot)$, is ISS.
Proof: Construct the following Lyapunov function
$$ \boldsymbol{V}_{2}=\frac{1}{2} s^{2}+\frac{1}{2} e^{2} $$ (34) and its derivative based on (28) is calculated as follows:
$$ \begin{aligned} \dot{\boldsymbol{V}}_{2}= & \bar{k}_{u} s^{2}\tilde{w}_{s} s+U_{e} s\bar{k}_{U o} e^{2}\tilde{w}_{e} e+G(\cdot) e \\ & \leqslant\lambda_{\min }(\boldsymbol{K})\left\\boldsymbol{E}_{2}\right\^{2}+\left\h_{1}\right\\left\\boldsymbol{E}_{2}\right\ \end{aligned} $$ (35) where $\bar{k}_{u}=k_{u} / \sqrt{s^{2}+\Delta_{u}^{2}}, \bar{k}_{U o}=U_{0} / \sqrt{(e+g)^{2}+\Delta_{\psi}^{2}}, \boldsymbol{K}=$ $\operatorname{diag}\left\{\bar{k}_{u}, \bar{k}_{U o}\right\}, \boldsymbol{E}_{2}=[s, e]^{\mathrm{T}}, \boldsymbol{h}_{1}=\left[\left\tilde{w}_{s}\right+\leftU_{e}\right, \left\tilde{w}_{e}\right+G(\cdot)\right]^{\mathrm{T}}$.
As
$$ \begin{aligned} \left\\boldsymbol{E}_{2}\right\ & \geqslant \frac{\left\tilde{w}_{s}\right}{\theta_{2} \lambda_{\min }(\boldsymbol{K})}+\frac{\leftU_{e}\right}{\theta_{2} \lambda_{\min }(\boldsymbol{K})} \\ & +\frac{\left\tilde{w}_{e}\right}{\theta_{2} \lambda_{\min }(\boldsymbol{K})}+\frac{G(\cdot)}{\theta_{2} \lambda_{\min }(\boldsymbol{K})} \\ & \geqslant \frac{\mid \boldsymbol{h}_{1} \}{\theta_{2} \lambda_{\min }(\boldsymbol{K})} \end{aligned} $$ (36) renders
$$ \dot{\boldsymbol{V}}_{2} \leqslant\left(1\theta_{2}\right) \lambda_{\text {min }}(\boldsymbol{K})\left\\boldsymbol{E}_{2}\right\^{2} $$ (37) where $0<\theta_{2}<1$. Consequently, the error subsystem (28) is ISS, and
$$ \left\\boldsymbol{E}_{2}(t)\right\ \leqslant \max \left\{\left\\boldsymbol{E}_{2}(0)\right\ e^{2 \lambda_{\min }(\boldsymbol{K})\left(1\theta_{2}\right)\left(tt_{0}\right)}, \frac{\left\\boldsymbol{h}_{1}\right\}{\theta_{2} \lambda_{\min }(\boldsymbol{K})}\right\} $$ (38) The time derivative of $\psi_{e}$ is obtained as follows: $\dot{\psi}_{e}=$ $rr_{\text {cmd }}+r_{\text {cmd }}\dot{\psi}_{\text {cmd }}$. By substituting (27) into $\dot{\psi}_{e}$, the resulting error system can be expressed as follows:
$$ \dot{\psi}_{e}=\frac{k_{r} \psi_{e}}{\sqrt{\psi_{e}^{2}+\Delta_{r}^{2}}}+r_{e}\dot{\psi}_{\mathrm{cmd}} $$ (39) where $r_{e}=r_{0}r_{\text {cmdd }}$.
Lemma 4. The error subsystem (39), viewed as a system with the state being $\psi_{e}$ and the inputs being $r_{e}$ and $\dot{\psi}_{\text {cmd }}$, is ISS.
Proof: Construct the following Lyapunov function
$$ \boldsymbol{V}_{3}=\frac{1}{2} \psi_{e}^{2} $$ (40) and its derivative based on (39) is calculated as follows:
$$ \dot{\boldsymbol{V}}_{3}=\bar{k}_{r} \psi_{e}^{2}+\psi_{e} r_{e}\dot{\psi}_{\mathrm{cmd}} \psi_{e} $$ (41) where $\bar{k}_{r}=k_{r} / \sqrt{\psi_{e}^{2}+\Delta_{r}^{2}}$.
As
$$ \left\psi_{e}\right \geqslant \frac{\leftr_{e}\right}{\theta_{3} \bar{k}_{r}}+\frac{\left\dot{\psi}_{\mathrm{cmd}}\right}{\theta_{3} \bar{k}_{r}} $$ (42) renders
$$ \dot{V}_{3} \leqslant\left(1\theta_{3}\right) \bar{k}_{r}\left\psi_{e}\right^{2} $$ (43) where $0<\theta_{3}<1$. Consequently, the error subsystem (39) is ISS, and
$$ \left\psi_{e}\right \leqslant \max \left\{\left\psi_{e}(0)\right e^{2 \bar{k}_{r}\left(1\theta_{3}\right)\left(tt_{0}\right)}, \frac{\leftr_{e}\right+\left\dot{\psi}_{\mathrm{cmd}}\right}{\theta_{3} \bar{k}_{r}}\right\} $$ Lemma 5. The cascaded system formed by subsystem (20), subsystem (33), and subsystem (39) is ISS.
Proof: Based on Lemmas 2 and 3, the ESO subsystem and error subsystem (33) can be considered a cascade system, with the states being $s, e$ and the input being $w$, which is ISS. Based on Lemmas 3 and 4, the error subsystems (33) and (39) can be regarded as a cascade system, with the states being $s, e$ and the inputs being $r_{e}, \dot{\psi}_{\mathrm{cmd}}$, which is ISS. Based on Lemma 4.6 in Khalil (2015), the closedloop system composed of (20), (33), and (39) is ISS.
3.3 CBF design
In this subsection, the collision avoidance of waterway boundaries and stationary/moving obstacles is addressed and encoded as safety constraints by CBFs. Then, a quadratic optimization problem is established to optimize the command signals obtained in Section 3.2.
3.3.1 CBF design for avoiding stationary obstacles
Let $\boldsymbol{p}_{k s}=\left[x_{k s}, y_{k s}\right]^{\mathrm{T}}$ be the position of the stationary obstacles. In avoiding the stationary obstacles, the following CBF for the collision avoidance of stationary obstacles is constructed:
$$ \mathcal{S}_{1}=\left\{\boldsymbol{p} \in \Re^{2} \mid h_{k s}\left(\boldsymbol{p}, \boldsymbol{p}_{k s}\right)=\left\\boldsymbol{p}\boldsymbol{p}_{k s}\right\^{2}d_{k s}^{2} \geqslant 0\right\} $$ (44) Recalling (9), it follows that
$$ \dot{\boldsymbol{p}}=\left[\begin{array}{c} U_{0} \cos (\psi+\beta) \\ U_{0} \sin (\psi+\beta) \end{array}\right]+\left[\begin{array}{c} \hat{w}_{x} \\ \hat{w}_{y} \end{array}\right]\left[\begin{array}{c} \tilde{w}_{x} \\ \tilde{w}_{y} \end{array}\right] $$ (45) where $\left[\hat{w}_{x}, \hat{w}_{y}\right]^{\mathrm{T}}=\underline{R}\left(\psi_{i d}\right)\left[\hat{w}_{s}, \hat{w}_{e}\right]^{\mathrm{T}}\left[\tilde{w}_{x}, \tilde{w}_{y}\right]^{\mathrm{T}}=\underline{R}\left[\tilde{w}_{s}, \tilde{w}_{e}\right]^{\mathrm{T}}$ and
$$ \underline{R}\left(\psi_{i d}\right)=\left[\begin{array}{cc} \cos \left(\psi_{i d}\right) & \sin \left(\psi_{i d}\right) \\ \sin \left(\psi_{i d}\right) & \cos \left(\psi_{i d}\right) \end{array}\right] $$ Using (8), the second time derivatives of $h_{k s}$ in (44) can be expressed as follows:
$$ \ddot{h}_{k s}+2 \alpha_{s} \dot{h}_{k s}+\alpha_{s}^{2} h_{k s} \geqslant 0, k=1, 2, \cdots, M_{1} $$ (46) and the corresponding constraints are expressed as follows:
$$ \begin{aligned} & \mathcal{U}_{1}\left(r_{\mathrm{o}}\right)=\left\{r_{\mathrm{o}} \mid A_{k s} r_{\mathrm{o}}+B_{k s} \alpha_{s}+C_{k s} \alpha_{s}^{2}+M_{k s} \geqslant D_{k s}\right\} \\ & k=1, 2, \cdots, M_{1} \end{aligned} $$ (47) where
$$ \begin{aligned} A_{k s}= & 2 U_{o}\left(\left(xx_{k s}\right) \sin (\psi+\beta)\right. \\ & \left.\left(yy_{k s}\right) \cos (\psi+\beta)\right) \\ B_{k s}= & 4 U_{o}\left(\left(xx_{k s}\right) \cos (\psi+\beta)+\left(yy_{k s}\right) \sin (\psi+\beta)\right) \\ & +4\left(xx_{k s}\right) \hat{w}_{x}+4\left(yy_{k s}\right) \hat{w}_{y} \\ C_{k s}= & \left(xx_{k s}\right)^{2}+\left(yy_{k s}\right)^{2}d_{k s}^{2} \\ D_{k s}= & 2 \dot{U}_{o}\left(\left(xx_{k s}\right) \cos (\psi+\beta)\right. \\ & \left.+\left(yy_{k s}\right) \sin (\psi+\beta)\right) \\ & 2\left(U_{0}^{2}+\hat{w}_{x}^{2}+\hat{w}_{y}^{2}+2 U \hat{w}_{x} \cos (\psi+\beta)\right. \\ & \left.+2 U_{o} \hat{w}_{y} \sin (\psi+\beta)\right) \\ M_{k s}= & 4 \alpha_{o}\left(\tilde{w}_{x}\left(xx_{k s}\right)+\tilde{w}_{y}\left(yy_{k s}\right)\right) \\ & 2 \tilde{w}_{x}\left(2 U_{o} \cos (\psi+\beta)+2 \hat{w}_{x}\tilde{w}_{x}\right) \\ & 2 \tilde{w}_{y}\left(2 U_{o} \sin (\psi+\beta)+2 \hat{w}_{y}\tilde{w}_{y}\right) \end{aligned} $$ and $\alpha_{s} \in \Re$ is a positive constant.
3.3.2 CBF design for avoiding moving obstacles
In avoiding the moving obstacles, the following $\mathrm{CBF}$ is constructed as follows:
$$ \mathcal{S}_{2}=\left\{\boldsymbol{p} \in \mathfrak{R}^{2} \mid h_{k m}\left(\boldsymbol{p}, \boldsymbol{p}_{k m}\right)=\left\\boldsymbol{p}\boldsymbol{p}_{k m}\right\^{2}d_{k m}^{2} \geqslant 0\right\} $$ (48) Using (8), the time derivatives of $h_{k m}$ in (48) can be expressed as follows:
$$ \dot{h}_{k m}\left(\boldsymbol{p}, \boldsymbol{p}_{k m}\right) \geqslant\alpha_{m} h_{j}\left(\boldsymbol{p}, \boldsymbol{p}_{k m}\right) $$ (49) and the corresponding constraints are expressed as follows:
$$ \begin{aligned} & \mathcal{U}_{2}\left(U_{\mathrm{o}}\right)=\left\{U_{\mathrm{o}} \mid A_{k m} U_{\mathrm{o}}+B_{k m} \alpha_{m}+M_{k m} \geqslant D_{k m}\right\} \\ & k=1, 2, \cdots, M_{2} \end{aligned} $$ (50) where
$$ \begin{aligned} & A_{k m}=2\left(xx_{k m}\right) \cos (\psi+\beta)+2\left(yy_{k m}\right) \sin (\psi+\beta) \\ & B_{k m}=\left(xx_{k m}\right)^{2}+\left(yy_{k m}\right)^{2}d_{k m}^{2} \\ & D_{k m}=2 \hat{w}_{x}\left(xx_{k m}\right)2 \hat{w}_{y}\left(yy_{k m}\right) \\ & M_{k m}=2 \tilde{w}_{x}\left(xx_{k m}\right)2 \tilde{w}_{x}\left(yy_{k m}\right) \end{aligned} $$ and $\alpha_{m} \in \Re$ is a positive constant.
Remark 1: Based on Rule 9(e) of the International Regulations for Preventing Collisions at Sea (COLREGS), in a narrow waterway or fairway, overtaking can only occur if the vessel to be overtaken takes action to permit safe passing. Otherwise, overtaking behavior is not permitted. This paper considers the situation in that USV is not allowed to overtake, and it has to follow the vessel ahead at a low speed. Hence, the speed is optimized to avoid collisions with the vessel ahead.
3.3.3 CBF design for avoiding waterway boundaries
The boundaries of the waterway are represented by two straight lines, denoted by $L_{i j}$ (Figure 4), and their expressions are defined as follows:
$$ a_{i j} x+b_{i j} y+c_{i j}=0, \quad i=1, 2, \cdots, n, \quad j=1, 2 $$ (51) where $a_{i j}, b_{i j}$, and $c_{i j} \in \Re$ are the parameters of the line.
Based on the property of (51), the area where the two straight lines are larger than zero is defined as a safety set for the USV, and the safety area $\mathcal{C}$ can be expressed as follows:
$$ \begin{gathered} C=\left\{p \in \Re^{2} \mid\left(a_{i 1} x+b_{i 1} y+c_{i 1}>0\right)\right. \\ \left.\cap\left(a_{i 2} x+b_{i 2} y+c_{i 2}>0\right)\right\} \end{gathered} $$ The distance between the USV and the waterway boundary is defined as follows:
$$ D_{i j}=\frac{a_{i j} x+b_{i j} y+c_{i j}}{\sqrt{a_{i j}^{2}+b_{i j}^{2}}}, \quad i=1, 2, \cdots, n, \quad j=1, 2 $$ (52) In ensuring the safety, the safety set is defined as follows:
$$ S_{3}=\left\{\boldsymbol{p} \in \Re^{2} \mid h_{i j}(\boldsymbol{p})=D_{i j}\frac{\sqrt{L^{2}+W^{2}}}{2}d_{i j} \geqslant 0\right\} $$ (53) indicating that the distance between each edge of the USV and the waterway boundaries should be larger than distance $d_{i j}$. By using (8), the second time derivatives of $h_{i j}$ in (53) can be expressed as follows:
$$ \ddot{h}_{i j}+\alpha_{c} \dot{h}_{i j}+\alpha_{c}^{2} h_{i j} \geqslant 0, \quad i=1, 2, \cdots, n, \quad j=1, 2 $$ (54) and the corresponding waterway boundary constraints are expressed as follows:
$$ \begin{gathered} \mathcal{U}_{3}\left(r_{\mathrm{o}}\right)=\left\{r_{\mathrm{o}} \mid A_{i j} r_{\mathrm{o}}+B_{i j} \alpha_{c}+C_{i j} \alpha_{c}^{2}+M_{i j} \geqslant D_{i j}\right\} \\ i=1, 2, \cdots, n, \quad j=1, 2 \end{gathered} $$ (55) where
$$ \begin{aligned} A_{i j}= & U_{0}\left(b_{i j} \cos (\psi+\beta)a_{i j} \sin (\psi+\beta)\right) \\ B_{i j}= & a_{i j}\left(U_{0} \cos (\psi+\beta)+\hat{w}_{x}\right) \\ & +b_{i j}\left(U_{o} \sin (\psi+\beta)+\hat{w}_{y}\right) \\ C_{i j}= & a_{i j} x+b_{i j} y+c_{i j}\frac{\sqrt{\left(L^{2}+W^{2}\right)\left(a_{i j}{ }^{2}+b_{i j}{ }^{2}\right)}}{2} \\ & d_{i j} \sqrt{a_{i j}{ }^{2}+b_{i j}{ }^{2}} \\ D_{i j}= & a_{i j} \dot{U}_{o} \cos (\psi+\beta)a_{i j} \dot{U}_{o} \sin (\psi+\beta) \\ M_{i j}= & a_{i j} \alpha_{c} \tilde{w}_{x}b_{i j} \alpha_{c} \tilde{w}_{y} \end{aligned} $$ and $\alpha_{c} \in \Re$ is a positive constant.
3.4 Safetycertificated guidance law design
By using the safety constraints determined by CBFs, two quadratic programming problems are formulated herein to optimize the obtained guidance law in a minimal invasion way to ensure the safety of the USV. In addition, the following velocity constraints are enforced to satisfy the following equation:
$$ \begin{aligned} & \underline{U} \leqslant U_{0} \leqslant \bar{U} \\ & \underline{r} \leqslant r_{0} \leqslant \bar{r} \end{aligned} $$ (56) where $\underline{U} \in \Re, \bar{U} \in \Re, \underline{r} \in \Re$, and $\bar{r} \in \Re$ are constants.
The optimized velocity $U_{0}$ is obtained by solving the following quadratic programming problem:
$$ \begin{array}{ll} U_{\mathrm{o}}= & \underset{U_{\mathrm{o}} \in \Re}{\arg \min } J\left(U_{\mathrm{o}}\right)=\leftU_{\mathrm{o}}U_{\mathrm{cmd}}\right^{2} \\ \text { s.t. } & A_{k m} U \geqslant D_{k m}B_{k m} \alpha_{m}M_{k m} \\ & k=1, 2, \cdots, M_{2}, \underline{U} \leqslant U_{\mathrm{o}} \leqslant \bar{U} \end{array} $$ (57) Similarly, the optimized yaw rate $r_{\mathrm{o}}$ is obtained as follows:
$$ \begin{array}{ll} r_{\mathrm{o}}= & \underset{r_{\mathrm{o}} \in \Re}{\arg \min } J\left(r_{\mathrm{o}}\right)=\leftr_{\mathrm{o}}r_{\mathrm{cmd}}\right^{2} \\ \text { s.t. } & A_{k s} r_{\mathrm{o}} \geqslant D_{k s}C_{k s} \alpha_{s}^{2}B_{k s} \alpha_{s}M_{k s}, \\ & k=1, 2, \cdots, M_{1} \\ & A_{i j} r_{o} \geqslant D_{i j}C_{i j} \alpha_{c}^{2}B_{i j} \alpha_{c}M_{i j}, \\ & j=1, 2, \quad \underline{r} \leqslant r_{\mathrm{o}} \leqslant \bar{r} \end{array} $$ (58) The safety of the USV system is given by the following lemma.
Lemma 6. Given an underactuated USV with dynamics (9), if the optimal control signal $U_{0} \in \mathcal{U}_{2}$ and $r_{0} \in \mathcal{U}_{1} \cap \mathcal{U}_{3}$ for the USV, and $\boldsymbol{p}\left(t_{0}\right) \in \mathcal{S}_{1} \cap \mathcal{S}_{2} \cap \mathcal{S}_{3}, \forall t>t_{0}$, then, the USV system is ISSf.
Proof: The set $\mathcal{S}=\mathcal{S}_{1} \cap \mathcal{S}_{2} \cap \mathcal{S}_{3}$ is forward invariant by using the optimal control signal $U_{0} \in \mathcal{U}_{2}$ and $r_{0} \in \mathcal{U}_{1} \cap \mathcal{U}_{3}$; that is, the set $\mathcal{S}$ is ISSf. Therefore, if the initial position of the USV satisfies $\boldsymbol{p}\left(t_{0}\right) \in \mathcal{S}_{1} \cap \mathcal{S}_{2} \cap \mathcal{S}_{3}$, then $\boldsymbol{p}(t)$ will stay in $\mathcal{S}_{1} \cap \mathcal{S}_{2} \cap \mathcal{S}_{3}$. Therefore, the USV system is ISSf.
The stability and safety of the proposed system of USV are given by the following theorem.
Theorem 1. Consider a USV with dynamics (9), the ESO (19), safety constraints (47), (50), and (55), optimal surge velocity (57), and optimal yaw rate (58). All error signals in the closedloop system are uniformly and ultimately bounded, and the USV system is ISSf.
Proof: Based on Lemma 6, the USV will not violate the safety requirements; that is, the safety objectives (16), (17), and (18) are achieved. Lemma 3 shows that the tracking error signal $\boldsymbol{E}_{2}$ is bounded; that is, there exists a positive constant such that the geometric objective (15) is achieved.
4 Simulation of a USV in the yangtze river
Consider a motion scenario that a USV runs in the waterway of the Yangtze River. Moreover, consider one sta tionary obstacle and one moving obstructive vehicle running at a low velocity ahead of the USV.
In the simulation, the length and width of the USV are set as $L=1.5$ and $W=0.4$, respectively. The ocean currents are set as $w_{s}=0.5$ and $w_{e}=0.2$. The velocity constraints are given as $\underline{U}=0, \bar{U}=1, \underline{r}=0.5$, and $\bar{r}=0.5$. The initial position of the USV is $\boldsymbol{p}(0)=[2, 72.5]^{\mathrm{T}}$. The desired straight lines are determined by three waypoints, that is, $\boldsymbol{p}_{1 d}=[0, 72.5]^{\mathrm{T}}, \boldsymbol{p}_{2 d}=[21.6, 60.0]^{\mathrm{T}}$, and $\boldsymbol{p}_{3 d}=[88.0, 0]^{\mathrm{T}}$. The parameters of the four waterway boundaries are $119 x+$ $195 y13494=0, 152 x233 y+17800.2=0, 573 x+$ $635 y47559=0$, and $566 x662 y53852.8=0$. The stationary obstacle locates $\boldsymbol{p}_{1 s}=[34.0, 50.0]^{\mathrm{T}}$. The obstructive vehicle moves at a speed of $0.7 \mathrm{~m} / \mathrm{s}$ on the route. The safe distances are set as follows:
$$ d_{11}=d_{12}=d_{21}=d_{22}=d_{31}=d_{32}=2, d_{1 s}=3 \text {, and } d_{1 m}=20 \text {. } $$ The ESO parameters are selected as $k_{s 1}=1, k_{e 1}=1$, $k_{s 2}=0.25$, and $k_{e 2}=0.25$. The LOS guidance parameters are selected as $k_{u}=1, \Delta_{u}=0.5, \Delta_{\psi}=8, k_{r}=0.5$, and $\Delta_{r}=0.3$. The CBF parameters are set as $\alpha_{c}=0.5$, $\alpha_{s}=0.45$, and $\alpha_{m}=0.05$. In the simulation, the quadratic optimization problem is solved by the builtin Python toolbox cvxpy.
The simulation results are provided in Figures 59. Figure 5(a) shows the simulation results of the proposed guidance method. Compared with Figure 5(b), safety is ensured; that is, the collisions with waterway boundaries and obstacles are prevented by using the proposed CBFbased guidance method. Compared with Figure 5(c), the USV can accurately track the desired route by using the proposed ESObased guidance method. Figure 6 shows the tracking errors of the USV in the $s$ and $e$ directions. Based on the error shown in the $s$ direction, the proposed method and the method without ESO can reduce the velocity when encountering a moving obstacle. Based on the error in the $e$ direction, the error cannot be eliminated by using the method without ESO as the effect of unknown ocean currents. Figure 7 shows the estimation performance of the ocean current ESO. The unknown constant ocean currents are estimated accurately. Figure 8 shows the yaw rate tracking performance. The commanded yaw rate is optimized at $020 \mathrm{~s}$ and $7080 \mathrm{~s}$ to ensure the collision avoidance of waterway boundaries and obstructive vehicles, respectively. The peak at $50 \mathrm{~s}$ is induced by the change of the desired straightline route. Figure 9 shows the surge velocity tracking performance. The peak at $50 \mathrm{~s}$ is also induced by the change of the desired straightline route. Considering the role of CBF, the USV can decelerate after $130 \mathrm{~s}$ because of the presence of a moving vessel in front of it. Figure 10 shows the quadratic programming time for the surge and yaw directions. The optimization time is less than the sampling time $\Delta T$ in each cycle, which can be accomplished in each cycle. Figure 11 shows the ratio of the quadratic programming time to the total execution time in each cycle. As shown in the figure, optimization occupies more than $90 \%$ of the total execution time in each cycle.
5 Conclusion
This paper presents a safetycertified straightline following of a USV in a constrained water region with waterway boundaries and stationary/moving obstacles. An ESO is designed to estimate external environmental disturbances. Design guidance laws based on the principle of LOS, and compensate for external disturbances based on the ESO results. Then, a quadratic programming problem is formulated such that the safety constraints encoded by CBFs and velocity constraints are satisfied. Therefore, all tracking errors of the closedloop system are uniformly and ultimately bounded, and the system is ISSf. The simulation results substantiate the effectiveness of the proposed safetycertified straightline following guidance method. In future work, the USV dynamic model must be considered, and the antidisturbance safecertificated path following control must be investigated for a USV in a constrained water region.
Competing interest Zhouhua Peng is an editorial board member for the Journal of Marine Science and Application and was not involved in the editorial review, or the decision to publish this article. All authors declare that there are no other competing interests. 
Abdurahman B, Savvaris A, Tsourdos A (2019) Switching LOS guidance with speed allocation and vertical course control for pathfollowing of unmanned underwater vehicles under ocean current disturbances. Ocean Engineering 182: 412–426. https://doi.org/10.1016/j.oceaneng.2019.04.021 Aguiar AP, Hespanha JP (2007) Trajectorytracking and pathfollowing of underactuated autonomous vehicles with parametric modeling uncertainty. IEEE Transactions on Automatic Control 52(8): 1362–1379. DOI: 10.1109/TAC.2007.902731 Ames AD, Xu X, Grizzle JW, Tabuada P (2017) Control Barrier function based quadratic programs for safety critical systems. IEEE Transactions on Automatic Control 62(8): 3861–3876. DOI: 10.1109/TAC.2016.2638961 Belleter D, Maghenem MA, Paliotta C, PettersenK Y (2019) Observer based path following for underactuated marine vessels in the presence of ocean currents: A global approach. Automatica 100: 123–134. https://doi.org/10.1016/j.automatica.2018.11.008 Breivik M, Hovstein VE, Fossen TI (2008) Straightline target Tracking for unmanned surface vehicles. Modeling, Identification and Control: A Norwegian Research Bulletin 29(4): 131–149. DOI: 10.4173/mic.2008.4.2 Campbell S, Naeem W, Irwin GW (2012) A review on improving the autonomy of unmanned surface vehicles through intelligent collision avoidance manoeuvres. Annual Reviews in Control 36(2): 267–283. https://doi.org/10.1016/j.arcontrol.2012.09.008 Caharija W, Pettersen KY, Bibuli M, Calado P, Zereik E, Braga J, Gravdahl JT, Sørensen AJ, Milovanovic M, Bruzzone G (2016) Integral lineofsight guidance and control of underactuated marine vehicles: Theory, simulations, and experiments. IEEE Transactions on Control Systems Technology 24(5): 1623–1642. DOI: 1109.2015/TCST.2504838 https://doi.org/ 10.1109/TCST.2015.2504838 Chen YY, Wei P (2014) Coordinated adaptive control for coordinated pathfollowing surface vessels with a timeinvariant orbital velocity. Journal of Automatica Sinica 1(4): 337–346. DOI: 10.1109/JAS.2014.7004662 Das E, Murray RM (2022) Robust safe control synthesis with disturbance observerbased control barrier functions. 2022 IEEE 61st Conference on Decision and Control (CDC), 5566–5573. https://doi.org/10.48550/arXiv.2201.05758 Deng Y, Zhang X, Zhang G (2020) Lineofsightbased guidance and adaptive neural pathfollowing control for sailboats. Ocean Engineering 45(4): 1177–1189. DOI: 10.1109/JOE.2019.2923502 Fossen TI, Lekkas AM (2017) Direct and indirect adaptive integral lineofsight pathfollowing controllers for marine craft exposed to ocean currents. International Journal of Adaptive Control and Signal Processing 4: 445–463. https://doi.org/10.1002/acs.2550 Fossen TI, Pettersen KY (2014) On uniform semiglobal exponential stability (USGES) of proportional lineofsight guidance laws. Automatica 50(11): 2912–2917. DOI: 10.1016/j.automatica.2014.10.018 Gu N, Wang D, Peng ZH, Wang J, Han QL (2022) Disturbance observers and extended state observers for marine vehicles: A survey. Control Engineering Practice 123: 105158. https://doi.org/10.1016/j.conengprac.2022.105158 Gu N, Wang D, Peng ZH, Wang J (2021) Safetycritical containment maneuvering of underactuated autonomous surface vehicles based on neurodynamic optimization with control barrier functions. IEEE Transactions on Neural and Learning Systems, 1–14. DOI: 10.1109/TNNLS.2021.3110014 Gu N, Wang D, Peng ZH, Wang J, Han QL (2023) Advances in lineofsight guidance for path following of autonomous marine vehicles: An overview. IEEE Transactions on Systems, Man, and Cybernetics: Systems 53(1): 12–28. DOI: 10.1109/TSMC.2022.3162862 He W, Yin Z, Sun C (2017) Adaptive neural network control of a marine vessel with constraints using the asymmetric barrier lyapunov function. IEEE Transactions on Cybernetics 47(7): 1641–1651. DOI: 10.1109/TCYB.2016.2554621 Jiang H, Liang Y (2018) Online path planning of autonomous UAVs for bearingonly standoff multitarget following in threat environment. IEEE Access 6: 22531–22544. DOI: 10.1109/ACCESS.2018.2824849 Katayama H, Aoki H (2014) Straightline trajectory tracking control for sampleddata underactuated ships. IEEE Transactions on Control Systems Technology 22(4): 1638–1645. DOI: 10.1109/TCST.2013.2280717 Khalil HK (2015) Nonlinear control. Pearson Education Kolathaya S, Ames AD (2019) Inputtostate safety with control Barrier functions. IEEE Control Systems Letters 3(1): 108–113. DOI: 10.1109/LCSYS.2018.2853698 Li JJ, Xiaog XB, Yang SL (2022) Robust adaptive neural network control for dynamic positioning of marine vessels with prescribed performance under model uncertainties and input saturation. IEEE Transactions Automation Science and Engineering 484: 1–12. https://doi.org/10.1016/j.neucom.2021.03.136 Li TS, Zhao R, Chen CLP, Fang LY, Liu C (2018) Finitetime formation control of underactuated ships using nonlinear sliding mode control. IEEE Transactions on Cybernetics 48(11): 3243–3253. DOI: 10.1109/TCYB.2018.2794968 Liu L, Wang D, Peng ZH (2017) ESObased lineofsight guidance law for path following of underactuated marine surface vehicles with exact sideslip compensation. IEEE Journal of Ocean Engineering 42(2): 477–487. DOI: 10.1109/JOE.2016.2569218 Liu L, Wang D, Peng ZH, Wang Hao (2016) Predictorbased LOS guidance law for path following of underactuated marine surface vehicles with fast sideslip compensation. Ocean Engineering 124(2): 340–348. https://doi.org/10.1016/j.oceaneng.2016.07.057 Lv MG, Peng ZH, Wang D, Han QL (2022) Eventtriggered cooperative path following of autonomous surface vehicles over wireless network with experiment results. IEEE Transactions on Industrial Electronics 69(11): 11479–11489. DOI: 10.1109/TIE.2021.3120442 Maghenem M, Belleter DJW, Paliotta C, Pettersen KY (2017) Observer based path following for underactuated marine vessels in the presence of ocean currents: a local approach. IFACPapers OnLine 50(1): 13654–13661. https://doi.org/10.1016/j.ifacol.2017.08.2399 Ma Y, Hu MQ, Yan XP (2018) Multiobjective path planning for unmanned surface vehicle with currents effects. ISA Transactions 75: 137–156. https://doi.org/10.1016/j.isatra.2018.02.003 Ma Y, Zhao YJ, Li ZX, Bi HX, Wang J, Malekian R, Sotelo M (2022) CCIBA*: An improved BA* based collaborative coverage path planning method for multiple unmanned surface mapping vehicles. IEEE Transactions on Intelligent Transportation Systems 23(10): 19578–19588. DOI: 10.1109/TITS.2022.3170322 Ma Y, Zhao YJ Incecik Atilla, Yan XP, Wang YL, Li ZX (2021) A collision avoidance approach via negotiation protocol for a swarm of USVs. Ocean Engineering 224: 108713. https://doi.org/10.1016/j.oceaneng.2021.108713 Meng W, Guo G, Liu Y (2012) Robust adaptive path following for underactuated surface vessels with uncertain dynamics. Journal of Marine Science and Application 11(2): 244–250. https://doi.org/10.1007/s118040121129y Molnar TG, Cosner RK, Singletary AW, Ubellacker W, Ames AD (2022) Modelfree safetycritical control for robotic systems. Robotics and Automation Letters 7(2): 944–951. DOI: 10.1109/LRA.2021.3135569 Paliotta C, Lefeber E, Pettersen KY, Pinto J, Costa M, de Figueiredo Borges de Sousa JT (2019) Trajectory tracking and path following for underactuated marine vehicles. IEEE Transactions on Control Systems Technology 27(4): 1423–1437. DOI: 10.1109/TCST.2018.2834518 Peng ZH, Wang C, Yin Y, Wang J (2023) Safetycertified constrained control of maritime autonomous surface ships for automatic berthing. IEEE Transactions on Vehicular Technology, early access. DOI: https://doi.org/10.1109/TVT.2023.3253204 Peng ZH, Wang D, Wang J (2021) Datadriven adaptive disturbance observers for modelfree trajectory tracking control of maritime autonomous surface ships. IEEE Transactions on Neural Networks and Learning Systems 32(12): 5584–5594. DOI: 10.1109/TNNLS.2021.3093330 Peng ZH, Wang J, Han QL (2019) Pathfollowing control of autonomous underwater vehicles subject to velocity and input constraints via neurodynamic optimization. IEEE Transactions on Industrial Electronics 66(11): 8724–8732. DOI: 10.1109/TIE.2018.2885726 Peng ZH, Wang J, Wang D, Han QL (2021) An overview of recent advances in coordinated control of multiple autonomous surface vehicles. IEEE Transactions on Industrial Informatics 17(2): 732–745. DOI: 10.1109/TII.2020.3004343 Qu Y, Xu HX, Yu WZ, Feng H, Han X (2017) Inverse optimal control for speedvarying path following of marine vessels with actuator dynamics. Journal of Marine Science and Application 16(2): 225–236. https://doi.org/10.1007/s1180401714101 Shi Y, Shen C, Fang H, Li H (2017) Advanced control in marine mechatronic systems: A survey. IEEE Transactions on Mechatronics 22(3): 1121–1131. DOI: 10.1109/TMECH.2017.2660528 Skjetne R, Fossen TI, Kokotovic PV (2005) Adaptive maneuvering, with experiments, for a model ship in a marine control laboratory. Automatica 41(2): 289–298. DOI: 10.1016/j.automatica.2004.10.006 Veremey EI (2014) Dynamical correction of control laws for marine ships accurate steering. Journal of Marine Science and Application 13(2): 127–133. https://doi.org/10.1007/s1180401412501 Wang NJ, Liu HB, Yang WH (2012) Pathtracking control of a tractoraircraft system. Journal of Marine Science and Application 11(4): 512–517. https://doi.org/10.1007/s118040121162x Wang Y, Tong H, Fu M (2019) Lineofsight guidance law for path following of amphibious hovercrafts with big and timevarying sideslip compensation. Ocean Engineering 172: 531–540. https://doi.org/10.1016/j.oceaneng.2018.12.036 Wang Z, Yang SL, Xiang XB, Antonio V, Nikola M, Dula N (2021) Cloudbased mission control of USV fleet: Architecture, implementation and experiments. Control Engineering Practice 106: 104657. https://doi.org/10.1016/j.conengprac.2020.104657 Wu F, Wang XG, Liu T (2020) An empirical analysis of highquality marine economic development driven by marine technological innovation. Journal of Coastal Research 115: 465–468. https://doi.org/10.2112/JCRSI115129.1 Wu WT, Peng ZH, Liu L, Wang D (2022a) A general safetycertified cooperative control architecture for interconnected intelligent surface vehicles with applications to vessel train. IEEE Transactions on Intelligent Vehicles 7(3): 627–637. DOI: 10.1109/TIV.2022.3168974 Wu WT, Peng ZH, Wang D, Liu L, Gu N (2022b) Antidisturbance leaderfollower synchronization control of marine vessels for underway replenishment based on robust exact differentiators. Ocean Engineering 248: 110686. https://doi.org/10.1016/j.oceaneng.2022.110686 Wu WT, Peng ZH, Wang D, Liu L, Han QL (2021) Networkbased lineofsight path tracking of underactuated unmanned surface vehicles with experiment results. IEEE Transactions on Cybernetics 52(10): 10937–10947. DOI: 10.1109/TCYB.2021.3074396 Yu C, Liu C, Lian L, Xiang X, Zeng Z (2019a) ELOSbased path following control for underactuated surface vehicles with actuator dynamics. Automatica 187: 106139. https://doi.org/10.1016/j.oceaneng.2019.106139 Yu C, Xiang X, Wilson PA, Zhang Q (2020) Guidanceerrorbased robust fuzzy adaptive control for bottom following of a flightstyle AUV with saturated actuator dynamics. IEEE Transactions on Cybernetics 50(5): 1887–1899. DOI: 10.1109/TCYB.2018.2890582 Yu Y, Guo C, Yu H (2019b) Finitetime PLOSbased integral sliding mode adaptive neural path following for unmanned surface vessels with unknown dynamics and disturbances. IEEE Trans Automation Science and Engineering 16(4): 1500–1511. DOI: 10.1109/TASE.2019.2925657 Zereik E, Bibuli M, Miskovic N, Ridao P, Pascoal A (2018) Challenges and future trends in marine robotics. Annual Reviews in Control 46: 350–368. https://doi.org/10.1016/j.arcontrol.2018.10.002 Zhang Q, Zhang JL, Chemori A, Xiang XB (2018) Virtual submerged floating operational system for robotic manipulation. Complexity 9528313: 1076–2787. https://doi.org/10.1155/2018/9528313 Zheng ZW, Huang Y, Xie L (2018) Errorconstrained LOS path following of a surface vessel with actuator saturation and faults. IEEE Transactions on Systems, Man, and Cybernetics: Systems 48(10): 1794–1805. DOI: 10.1109/TSMC.2017.2717850 Zheng ZW (2020) Moving path following control for a surface vessel with error constraint. Automatica 118: 109040. https://doi.org/10.1016/j.automatica.2020.109040