# Laser Ablation Manipulator Coverage Path Planning Method Based on an Improved Ant Colony Algorithm
## 2 Point Cloud Pre-Processing
### Inverse Kinematics  
Figure 3 depicts a six-degree-of-freedom (6-DOF) serial manipulator. To describe the dynamic information of the manipulator during operation, the 3D point coordinates in the point cloud data must be converted into the joint angle of the manipulator at the corresponding position. The iterative solution method is used. A corresponding manipulator motion formula is needed in the solution process, and the key is the Denavit-Hartenberg (DH) parameters. The DH parameters express the position and angle relationship between two pairs of joint links with four parameters. The DH parameters of the manipulator depicted in Figure 3 are presented in Table 2.  
In the spatial neighbourhood of the joint rotation angle, the mapping relationship between the manipulator's pose and the manipulator's joint rotation angle can be considered linear. Therefore, the Jacobian matrix of the manipulator can be used to establish the relationship between the difference motion vector of the manipulator and the joint angle increments, such that the inverse kinematics gradually converge to an exact solution. To make the iteration converge, the iteration compensation decreases as the number of iterations increases until a solution that satisfies the convergence condition is obtained. The Jacobian matrix \(\mathbf{J}\) can establish the relationship between the joint speeds and the speed of the manipulator end-effector. \[\mathbf{v}=\mathbf{J}(\mathbf{\theta})\,\mathbf{\omega} \tag{1}\]  
where \(\mathbf{v}\) is the generalised velocity vector of the manipulator end-effector, \(\mathbf{J}\) is the Jacobian matrix of the manipulator, which is a function of the manipulator joint rotation angle \(\mathbf{\theta}\), and \(\mathbf{\omega}\) is a generalised velocity vector of each joint rotation angle. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \(\mathbf{i}\) & \(\mathbf{\alpha}_{i-1}\) & \(\mathbf{\alpha}_{i-1}\) & \(\mathbf{d}_{i}\) & \(\mathbf{\theta}_{i}\) \\ \hline
1 & –pi/2 & 175 & 495 & 0 \\
2 & 0 & 1095 & 0 & –pi/2 \\
3 & –pi/2 & 175 & 0 & 0 \\
4 & pi/2 & 0 & 1270 & 0 \\
5 & pi/2 & 0 & 0 & –pi \\
6 & 0 & 0 & 135 & 0 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Manipulator Denavit-Hartenberg (DH) parameters. Figure 3: Six-degree-of-freedom (6-DOF) serial manipulator. By replacing the differential with the difference, the relationship between the differential motion vector of the manipulator in a certain spatial neighbourhood and the increment of the joint rotation angle can be obtained. \[\Delta\mathbf{\theta}=\mathbf{J}^{-1}\mathbf{D} \tag{2}\]  
where \(\Delta\mathbf{\theta}\) is the increment of the joint rotation angle corresponding to different poses, and \(\mathbf{D}\) is the differential motion vector, which is calculated based on the differential motion matrix. \[\mathbf{D}=\left[ \begin{array}{cccc}d_{x}&d_{y}&d_{z}&\delta_{x}&\delta_{y}& \delta_{z}\end{array} \right]^{T} \tag{3}\]  
The calculation of the differential motion matrix is as follows:  
\[{}^{T_{c}}\Delta=\mathbf{T}_{c}^{-1}\mathbf{T}_{e}-\mathbf{I} \tag{4}\]  
The differential motion matrix elements and the elements of the differential motion vector \(\mathbf{D}\) have a corresponding relationship shown in Formula (5). After calculating the differential motion matrix according to Formula (4), each element in \(\mathbf{D}\) can be calculated according to Formula (5). \[{}^{T_{c}}\Delta=\left[ \begin{array}{cccc}0&-\delta_{z}&\delta_{y}&d_{x}\\ \delta_{z}&0&-\delta_{x}&d_{y}\\ -\delta_{y}&\delta_{x}&0&d_{z}\\ 0&0&0&0\end{array} \right] \tag{5}\]  
The relative rotation angles of each joint from the current pose to the target pose in the spatial neighbourhood can be calculated using Equation (2). When the Jacobian matrix is singular in the iterative process, it can be solved by using the generalised inverse matrix instead. Using Equation (2) for iteration can lead to a situation wherein the iterative compensation is significantly large and leads to nonconvergence.