# A Method for Supervisory Control of Manipulator of Underwater Vehicle
## 4 Building of Motion Trajectories for a MM Working Tool in Case of Rough Bottom Topography
These profiles can be represented as a set of points of intersection of the triangulation triangles sides and the plane formed by the vector \(A_{i}\overset{\rightarrow}{A_{i+1}}\), connecting neighboring target points, and the unit vector \(\overset{\rightarrow}{z}\) parallel to the axis \(z\) in the CS \(xyz\) (see Figure 4). To build the motion trajectory for the MM working tool passing through the points of the triangles' intersection with the plane formed by the vectors \(A_{i}\overset{\rightarrow}{A_{i+1}}\) and \(\overset{\rightarrow}{z}\), it is necessary to calculate which of all \(g\) triangles intersect the specified plane, and calculate the coordinates of the points of these intersections. When the fact that a side of the \(k\)th triangle intersects the specified plane has been established, the signs of the distances \(p_{ikh}\) from the \(h\)th vertex (\(h\) = 0, 1, 2) to the plane formed by the vectors \(A_{i}\overset{\rightarrow}{A_{i+1}}\) and \(\overset{\rightarrow}{z}\) are comparedfor each pair of its vertices by the algorithm [28]. The parameters \(p_{ikh}\) are calculated by the formula \(p_{ikh}=\overrightarrow{r}_{i}\cdot A_{i}\overrightarrow{V}_{kh}\), \(\overrightarrow{r}_{i}=\frac{A_{i}\overrightarrow{A}_{ik+1}\times \overrightarrow{z}}{\|A_{ik}\overrightarrow{z}_{i}\|}\), where \(A_{i}^{\rightarrow}\overrightarrow{V}_{kh}\) is the vector connecting the target point \(A_{i}\) with the \(h\)th vertex \(V_{kh}\) of the \(k\)th triangle. If values of \(p_{ikh}\) have the same signs (\(p_{ik0}p_{ik1}>0\) and \(p_{ik0}p_{ik2}>0\) or \(p_{ik0}p_{ik1}<0\) and \(p_{ik0}p_{ik2}<0\)) for any pair of the respective vertices of the \(k\)th triangle, then the plane does not intersect the \(k\)th triangle. If \(p_{ikh}\) have different signs (\(p_{ik0}p_{ik1}>0\) and \(p_{ik0}p_{ik2}<0\) or \(p_{ik0}p_{ik1}<0\) and \(p_{ik0}p_{ik2}>0\)), then the point \(T_{ikc}\), through which the MM working tools should move, is lying on the side of the \(k\)th triangle formed by this pair of vertices (in general, the sides of each triangle can have no more than two points of intersection with the plane). The coordinates of the point \(T_{ikc}\) for the side formed by the vertices \(V_{k0}\) and \(V_{k1}\) are determined by the formula [34]: \(T_{ikc}=V_{k0}+t_{ikc}\frac{V_{k0}V_{k1}}{|V_{k0}V_{k1}|}\), where \(t_{ikc}=\frac{-(\overrightarrow{r}_{i}\cdot\overrightarrow{O}_{k0}^{ \rightarrow}+\left|\overrightarrow{O}_{A_{i}}\cdot\overrightarrow{r}_{i} \right|)}{\overrightarrow{r}_{i}\cdot V_{k0}V_{k1}}\), \(V_{k0}^{\rightarrow}V_{k1}\) is the vector connecting the vertices \(V_{k0}\) and \(V_{k1}\) of the \(k\)th triangle [34], and \(\left|\overrightarrow{OA}_{i}\cdot\overrightarrow{r}_{i}\right|\) is the distance from the plane formed by the vectors \(A_{i}\overrightarrow{A}_{i+1}\) and \(\overrightarrow{z}\) to the origin \(O\) of the CS \(xyz\). The coordinates of the second point \(T_{ikc}\) on one of the two remaining sides of the \(k\)th triangle, formed by the vertices \(V_{k0}\) and \(V_{k1}\) or \(V_{k1}\) and \(V_{k2}\), are calculated in a similar way. If the equality \(p_{ikh}=0\) is true, then the \(h\)th vertex of the \(k\)th triangle is lying on the specified plane. In this case, \(T_{ikc}=V_{kh}\). As a result, there is a set of points \(T_{ikc}\), through which the MM should move its working tool. Thus, at the points \(T_{ik1}\) and \(T_{ik2}\), as well as during movement between these points, the vector \(\overrightarrow{a}_{ik}\) is always perpendicular to the plane of the \(k\)th triangle, to which these points belong. Therefore, in the CS \(xyz\), the vector \(\overrightarrow{a}_{ik}\) is always perpendicular to the plane defined by the three vertices of the \(k\)th triangle.