## 4 Simulation Results
### Vehicle Performing a Complete Mission
#### 4.3.1 Constant Depth Mission with Docking to a Moving Docking Station Close to the Surface  
Here, the vehicle performs a survey mission at constant depth. Figure 12a,b shows the vehicle performing the mission, homing and then docking to a moving docking station close to the surface. The vehicle performs the constant depth survey mission (\(\mathcal{A}_{sd}\) and \(\mathcal{A}_{a}\)) by maintaining a predefined depth throughout the mission. The _Seafloor Alignment_ Task in the \(\mathcal{A}_{a}\) action is disabled while performing the constant depth survey mission phase. Once the mission is completed, the vehicle enters homing phase (\(\mathcal{A}_{p}\)) and returns to the docking station situated close to the seafloor. The vehicle is required to dock to the starboard side of the moving docking station and hence the pre-docking position is placed at a position to the right of the required dock position on the docking station. Here, as the vehicle starts the homing phase, the docking station is moving in front of the vehicle in the opposite direction. As the orientation error in yaw is high and thanks to the _Field Velocity_ Task, the vehicle will make a wider turn while approaching the starboard side of the moving dock as seen in Figure 12. The vehicle, after matching its position and orientation with the pre-docking position and orientation using velocity field, eventually translates sideways to the final dock position on the vehicle (\(\mathcal{A}_{d}\)). At every phase, the vehicle reactively avoids the obstacles along its path. The spheres depicted around the docking station is the envelope obstacle to provide a safety area around the docking station while the vehicle approaches the dock during homing. It is also used for guiding the vehicle towards the required approach position for a safe docking. From Figure 13, at around time \(t=20\), the vehicle changes from the parking maneuver (\(\mathcal{A}_{p}\)) to the path following at constant depth survey maneuver (\(\mathcal{A}_{sd}\) and \(\mathcal{A}_{a}\)). At time \(t=336\), the vehicle starts the homing maneuver (\(\mathcal{A}_{p}\)), and at time \(t=374\), the docking maneuver (\(\mathcal{A}_{d}\)) is initiated. During the mission, the depth of the vehicle is maintained at the desired level by the _Vehicle Depth_ task. However, the vehicle encounters two obstacles along its path as depicted by spheres at positions [10, \(-5.5\), 20.5] and [\(-10\), 4, 17]. Obstacle avoidance data from Figure 13 shows that the vehicle is able to estimate the distance to the obstacles (only the distance to the nearest obstacle at each instant is plotted) and reactively avoids them along the path. Looking at Figure 12, notice how the obstacle found during the homing stage is avoided by traveling beneath it, due to the availability of free space without conflicting with the desired minimum altitude from the seafloor. Figure 14 highlights the time behavior of the tasks that are used in the mission (_Obstacle Avoidance_, _Minimum Altitude_, and _Vehicle Depth_) and homing (_Obstacle Avoidance_, _Minimum Altitude_, and _Seafloor Alignment_) phases. In this mission, the roll values of the vehicle vary from \(-4\) degrees to \(4\) degrees, therefore confirming that the roll angles are negligible and acceptable. Figure 15 depict the time behavior of desired velocities and the actual/system velocities of the vehicle. From the plots, it can be noticed how the translation on the lateral and vertical axis are mainly of a transient nature, with the exception of the terminal docking phase. Figure 12: Constant depth mission: Plot showing the mission and docking to a moving docking station situated close to the sea-level (**a**) in the 3D space (**b**) from top view. Figure 13: Constant depth mission: Time behavior of the vehicle depth, pitch, and obstacle avoidance data. The various phases of the mission are denoted in the plot as follows: P—Parking, CDS—Constant Depth Survey, H—Homing, D—Docking.