## 3 Control Architecture
### Description of Tasks within an Action  
The following section provides more information on the various tasks composing each one of the above-considered actions, as reported in Table 1. Some tasks are common to multiple actions. For example, the _Minimum Altitude_ Task is common to \(\mathcal{A}_{p}\), \(\mathcal{A}_{sa}\), and \(\mathcal{A}_{sd}\) actions. Concerning safety tasks, the _Minimum Altitude_ Task allows the vehicle to maintain a safe altitude above the seafloor. This prevents the vehicle from crashing into the seafloor or other structures below itself. Due to the varying environments through which the vehicle operates, its very likely that it will encounter obstacles along its path. The _Obstacle Avoidance_ Task enables the vehicle to avoid any obstacles along the path. Multiple obstacles are considered, and once they are known with the help of on-board sensors, the task will be able to avoid them in a reactive fashion and proceed towards the goal. Moving to complementary tasks, the _Velocity Alignment_ Task aligns the longitudinal axis of the vehicle to the reference linear velocity vector. In this way, translations are limited, allowing the main thruster to perform the majority of the work, increasing the overall efficiency as the vehicle moves in the least damping direction. The _Alignment to Seafloor_ Task is a complementary task to the _Minimum Altitude_ Task, and allows the vehicle to follow the terrain and its slope. This helps the vehicle from preventing crashing to the seafloor while maneuvering over rough terrain. This is executed aligning the body \(z\) axis to the direction of the seafloor normal \(n_{b}\). Details on how the normal can be computed \begin{table}
\begin{tabular}{l c c c c c c} \hline \hline
**Task** & **Task Type** & \(\mathcal{A}_{p}\) & \(\mathcal{A}_{sa}\) & \(\mathcal{A}_{sd}\) & \(\mathcal{A}_{a}\) & \(\mathcal{A}_{d}\) \\ \hline Minimum Altitude & I & 1 & 1 & 1 & & \\ Obstacle Avoidance & I & 2 & 2 & 2 & & \\ Horizontal Alignment & I & 3 & & & & \\ Vehicle Altitude & E & & 3 & & & \\ Vehicle Depth & E & & & 3 & & \\ Seafloor Alignment & E & 4 & 4 & & 1 & \\ Field Velocity & E & 5 & & & & \\ Follow 2D Path & E & 5 & 5 & & & \\ Velocity Alignment & E & 6 & 6 & 6 & & \\ Hold Position & E & & & & 2 & \\ Survey Leg & E & & & & 3 & \\ Alignment & & & & & & \\ Terminal Dock & E & & & & & 1 \\ Dock Attitude & E & & & & & 2 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: List of tasks in actions that encompass the various behaviors of the vehicle. In task type, I refers to an inequality objective and E refers to an equality objective. The numbers denote the priority of each task in their respective action where lower values represent a higher priority for that task in the action. from the specific sensors will be given later in Section 4.1. Furthermore, as it is always convenient not to allow the vehicle to reach high values of pitch, the _Horizontal Alignment_ Task allows the vehicle to control its pitch so that it will not exceed its permissible limits. Moving to the homing and docking maneuvers, we recall that they can be subdivided into a long-range parking (homing) and a short-range parking (terminal docking) as depicted in Figure 3. The latter can be realized by explicitly taking advantage of the holonomic capabilities exhibited by the vehicle within the execution of short range and slow final maneuvering. For the former maneuver, as already stated, it is instead advisable to reduce translations as much as possible that will otherwise lead to unnecessary energy consumption. This is possible with the help of a velocity field based control. The _Field Velocity_ Task employs the velocity field control discussed in [46, 47], recalled in the following.