## 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
3.2 Constant Altitude Mission with Terrain Following and Docking to a Moving Docking Station Situated Close to the Seafloor  
For inspection surveys, the vehicle needs to travel at a certain altitude above to the seafloor for gathering data with distance-dependent sensors such as vision sensors. A constant altitude survey is performed in such scenarios. Figure 16a,b shows the complete behavior of the vehicle performing a constant altitude survey mission (\(\mathcal{A}_{sa}\) and \(\mathcal{A}_{a}\)), homing (\(\mathcal{A}_{p}\)), and finally docking (\(\mathcal{A}_{d}\)) to a docking station moving at a depth close to the seafloor. The vehicle maintains a predefined altitude from the seafloor throughout the mission, it follows the terrain of the seafloor (an improvement over [32]) and also avoids various obstacles along its path. Once the vehicle completes the mission, it enters homing phase. Here, the AUV is required to dock on top of the docking station, therefore the pre-docking position is placed above the required dock position at a safety distance. The vehicle matches  
Figure 14: Constant depth mission: Time behavior of Obstacle Avoidance, Minimum Altitude, Vehicle Depth, and Seafloor Alignment task activation functions. The various phases of the mission are denoted in the plot as follows: P—Parking, CDS—Constant Depth Survey, H—Homing, D—Docking. Figure 15: Constant depth mission: Plot depicting the time behavior of desired velocities and the actual/system velocities of the vehicle. its position and orientation with the pre-docking position and orientation with the help of velocity field and eventually translates down to the final dock position on top the docking station. The spheres depicted around the docking station is the envelope obstacle to provide a safety area around the docking station for avoiding any collision with the docking structure as the vehicle approaches the dock while homing. In this survey mission, upon reaching a way-point, the vehicle can maintain its pitch aligned to the terrain of the seafloor even while orienting towards the next leg of the survey (\(\mathcal{A}_{a}\)). However, one can easily change this behavior and require the AUV to maintain a horizontal attitude, while it orients towards the next leg of the survey, by simply deactivating the _Seafloor Alignment_ Task in \(\mathcal{A}_{a}\) action. This is possible only because of the flexibility of the task priority approach in introducing specific behaviors to the vehicle. From Figure 17, at around time \(t=20\), the vehicle transitions from the parking maneuver (\(\mathcal{A}_{p}\)) to the path following using constant altitude survey maneuver (\(\mathcal{A}_{sa}\) and \(\mathcal{A}_{a}\)). At time \(t=331\), the vehicle enters homing maneuver (\(\mathcal{A}_{p}\)) and at time \(t=354\), the docking maneuver (\(\mathcal{A}_{d}\)) is initiated. The vehicle depth is represented as the altitude of vehicle above the seafloor and it is clear that the vehicle maintains a specific altitude above the seafloor with the help of _Vehicle Altitude_ task during all phases of the mission. Maintaining a safe minimum altitude from the seafloor is further carried out by the _Minimum Altitude_ Task during the homing phase. The vehicle pitch data show the variation of pitch orientation of the vehicle while it follows the terrain of the seafloor. However, due to the pitch limitation implemented via _Horizontal Alignment_ Task, the vehicle pitch does not increase beyond its permissible limits. The vehicle encounters two obstacles along its path as depicted by spheres at positions [16.6, \(-4.5\), \(32.5\)] and [7; 12; 27]. Obstacle avoidance data from Figure 17 show 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.