## 6 Simulation and Experiment
### Experiment
#### 6.2.1 Path Following for a Lawnmower  
Set the reference path as a lawnmower shown by the black dotted line in Figure 17a, which is converted to Universal Transverse Mercator (UTM) coordinates during data processing, and (0,0) is the first path point. Set the desired speed of AUV as 1 m/s. The comparison of performance indicators (trajectory, cross-track error, look-ahead distance, compensation and heading performance) is shown in Figure 17. Table 7 tabulates the MAE and RMSE of two methods. Figure 16: Salifish AUV in sea trials. Figure 15: Salifish AUV. Figure 17a shows the resulting motion of AUV. The red line is the trajectory of _APLOS_, the blue line is _LOS_ and the black dashed line is the reference path. From this plot, it can be clearly seen that _APLOS_ has a better tracking performance than _LOS_. Especially at the apex, _LOS_ with constant look-ahead distance has a serious overshoot. _APLOS_ with time-varying look-ahead distance fits turning well. In addition, _APLOS_ based AUV sails along the desired path with smaller deviations compared with _LOS_. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Algorithms** & **MAE(m)** & **RMSE(m)** \\ \hline LOS & 3.2244 & 4.0926 \\ APLOS & 1.4683 & 2.4597 \\ Improvement & 54.46\% & 39.90\% \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Performance metric of lawnmower path following (\(u=1\) m/s). Figure 17: Lawnmower path following (\(u=1\) m/s). (**a**) comparison of trajectory; (**b**) comparison of cross-track error; (**c**) comparison of look-ahead distance; (**d**) comparison of velocity and drift angle; (**e**) comparison of heading effect. Figure 17b illustrates the comparison of cross-track error. The red line denotes _APLOS_ and the blue line denotes _LOS_. Note that, after determining that AUV has reached the receiving circle, AUV is ready to follow another path. Hence, when the cross-track error suddenly increases, AUV converges to the path of the new direction. Clearly, compared with _LOS_, the cross-track error of _APLOS_ is not only reduced faster, but also smaller in size. Hence, it is feasible to consider the cross-track error in the tracking process. Figure 17c presents the time evolution of look-ahead distance. The red line denotes _APLOS_ and the blue line denotes _LOS_. _LOS_ uses a constant look-ahead 15 m in both the convergence and guidance stage. _APLOS_ uses a varied look-ahead distance between the determined range. Figure 17d gives the time history of velocity and drift angle. In four plots, the pink line and the black line are the forward speed and sway speed of AUV, respectively. The blue line is the real-time drift angle. Combining Figure 17d with Figure 17a, in practical application, _APLOS_ makes the AUV fit the path well, while _LOS_ based AUV is affected by drift angle and has obvious deviation from the path. Therefore, _APLOS_ can resist the effects of drift angles. Figure 17e gives the performance of heading control. In four plots, the current heading is denoted by the blue line, and the desired heading is denoted by the red line. Significantly, the current heading of four methods track the desired heading well because they all use the same heading controller FOPID. Therefore, the final tracking performance mainly depends on the design of guidance law. In Table 7, whether MAE or RMSE, the path following performance of _APLOS_ is greatly improved compared with _LOS_. The MAE and the RMSE reduce to 1.4683 m and 2.4597 m, improving 54.46% and 39.90%, respectively. Then, AUV's desired speed is adjusted to 1.5 m/s. The first path point of reference path is (0,0), and the initial position of AUV is about (\(-\)10,0). The comparisons are sketched in Figure 18 and Table 8.  
Figure 18a shows the resulting motion of AUV. The red line and the blue line denote the trajectory of _APLOS_ and _LOS_, respectively. The black dashed line denotes the reference path. Note that AUV starts as a convergence stage because the initial position is not near the first point.