## 4 Software-Based Implementation of the System and the Mathematical Models of UUV and MM  
The above-considered upgraded methods for processing sensor-derived information and building trajectories of a MM working tool were implemented in the C++ programming language. The created program makes it possible to build triangulation models of surfaces  
Figure 5: Trajectories projected onto the surfaces of the object (red) and its model (green). of seafloor objects by the algorithm [31]. The input data for the program are a multitude of points lying on the bottom and object surfaces obtained using MVS, and also the point cloud of the object model. Based on the input data, the program starts a cycle (iterations) of object identification and, as a result, values of \(H_{D},M_{r1},M_{r2}\) are determined. Then the alignment of point clouds is tested, and, in case of successful identification of the object, the program transfers the sequence of points \(X_{j}\) pre-set in the CS _Oxyz_ and their respective vectors \(\overset{\rightarrow}{a}_{j}\) and \(\overset{\rightarrow}{b}_{j}\) onto the surface of the actual object. A graphical interface using PCL has been created to display and test alignment of point clouds and build MM working tool trajectories (Figure 6). Using visual information, the operator can additionally evaluate the results of the system operation. A system operability test was performed through numerical simulation in the virtual environment of the V-Rep robot simulation software. A scene of one manipulative operation to clean an object from fouling is shown in Figure 7. As MVS, we used a model of multibeam echosounder sonar with a resolution of 32 \(\times\) 32 dots and unidirectional scanning. This resolution is sufficient to perform operations with the target object. The sequence of points \(X_{j}\) (or \(T_{j}\)) and their respective vectors \(\overset{\rightarrow}{a}_{j}\) and \(\overset{\rightarrow}{b}_{j}\) of the MM working tool, formed by the software, were smoothed by parametric 3 rd-order B-splines [32] and sent to the Matlab/Simulink software package via the TCP protocol. The programmed signals to control the MM electric drives of the respective degrees of freedom were formed on the basis of these sequences. In the simulation, we used the well-tested mathematical model of UUV [33] and MM with the PUMA kinematic scheme having the first five degrees of freedom (three in translation and two in orientation). The basic parameters of the UUV and the manipulator are shown in Table 1. A complete list of parameters of the UUV model is provided in the works [34; 35]. The MM model used and its parameters are described in detail in [26]. This model includes a recurrent algorithm for solving IDP [13], which takes into account not only mutual influences in the MM degrees of freedom, but also specifics of the effect of a viscous fluid on the moving links of MM and the experimentally determined parameters of this effect [15]. The MM attachment point in the SC _Oxyz_ had coordinates \(M\) = (0.6, 0.6, 0.45)\({}^{T}\) (Figure 7). Figure 6: A graphical interface displays the processes of object identification and overlaying a working tool trajectory onto the object surface. In our work, we used the dynamic models of UUV and MM implemented in Matlab/Simulink. Therefore, in order to simplify interactions of the subsystems included in the created multilevel control system of UUV (Figure 1), the methods for stabilizing the UUV in the hovering mode near the object, controlling its movements and correcting the MM working tool trajectory, with undesirable displacements of the UUV taken into account, were also implemented in Matlab/Simulink. To stabilize the UUV in the hovering mode, we used a combined system [13; 14] that provides compensation for the effect of sea currents and the dynamic effects of the moving manipulator, calculated in real time, using the propulsion thrusters of the vehicle.