# PDDL Task Planning for Tunnel Spraying Based on a Multivariate Coating Accumulation Model
## 2 Methods  
### Hierarchical Planning of Spraying Tasks Based on over- and Under-Excavation Volume  
#### 2.1.1 Estimation of Over-Excavation and Under-Excavation  
The estimation of over- and under-excavation at the tunnel blasting face forms the basis for the hierarchical planning of spraying tasks. Typically, a vehicle-mounted laser scanner is used to scan the tunnel working face. The obtained point cloud data are then aligned to the tunnel coordinate system and compared with the tunnel design profile to estimate the over- and under-excavation of the current working face.  
If the pose of the wet spraying vehicle body coordinate system, denoted as {O}, in the tunnel coordinate system {G} is known \(\overset{G}{\sigma}T\), the point cloud alignment process is as follows:  
\[\overset{G}{V}_{i}=\overset{G}{O}T^{O}{W}_{i}(i=1,\ldots,n) \tag{1}\]  
Here, \(\overset{O}{W}_{i}\) represents the vehicle body coordinates of the scanned point cloud, and \(\overset{O}{W}_{i}\) represents the transformed tunnel coordinates of the scanned point cloud. The point cloud data undergo slicing and projection processing to obtain the actual contour line \(\overset{G}{C}_{actual}\) of the tunnel blasting surface. By comparing this with the tunnel design contour line \(\overset{G}{C}_{design}\), the over-excavation and under-excavation amounts at various points on the tunnel wall, denoted as \(\Delta_{i}\), can be determined.  
\[\Delta_{i}=\overset{G}{C}_{actual,i}(\overset{G}{V}_{i})-\overset{G}{C}_{ design,i}(i=1,\ldots,n) \tag{2}\]  
Thus, determining the pose \(\overset{G}{O}T\) of the wet spraying vehicle inside the tunnel is key to estimating the over-excavation and under-excavation amounts. An inclinometer is installed on the vehicle body to measure the lateral tilt angle \(\alpha\) and the forward tilt angle \(\beta\). Two calibration points \(W_{1}\) and \(W_{2}\) are fixed on the vehicle body to calculate the horizontal rotation angle \(\gamma\) of the vehicle body, as shown in Figure 1.  
The coordinate system of the inclinometer is taken as the vehicle body coordinate system {O}, with the coordinates of calibration points \(W_{1}\) and \(W_{2}\) in the vehicle body coordinate system {O} denoted as \(\overset{O}{W}_{1}\), \(\overset{O}{W}_{2}\), \(\overset{O}{W}_{1}\), and \(\overset{O}{W}_{2}\), and the coordinates in the tunnel coordinate system {G} denoted as \(\overset{G}{W}_{1}\) and \(\overset{G}{W}_{2}\). The vector formed by two pointsin the {O} coordinate system is denoted as \(\overrightarrow{\mathbf{m}}\), and the vector in the {G} coordinate system is denoted as \(\overrightarrow{\mathbf{n}}\), that is,  
\[\overrightarrow{\mathbf{m}}=(m_{x},m_{y},m_{z})=\frac{\partial W_{1}-\partial W_{2 }}{\left\|{{}^{\text{O}}W_{1}-\partial W_{2}}\right\|} \tag{3}\]  
\[\overrightarrow{\mathbf{n}}=(n_{x},n_{y},n_{z})=\frac{\partial W_{1}-\partial W_ {2}}{\left\|{{}^{\text{G}}W_{1}-\partial W_{2}}\right\|} \tag{4}\]  
The deviation angle between the vectors \(\overrightarrow{\mathbf{m}}\) and \(\overrightarrow{\mathbf{n}}\) in the \(XOY\) plane is the horizontal rotation angle of the vehicle, denoted as \(\gamma\).  
\[\cos\gamma=\frac{m_{x}n_{x}+m_{y}n_{y}}{\sqrt{(m_{x}^{2}+m_{y}^{2})(n_{x}^{2} +n_{y}^{2})}} \tag{5}\]  
According to the relationship between the rotation matrix \(\zeta_{\text{G}}^{\text{G}}\mathbf{R}\) and the Euler angles, we have:  
\[\zeta_{\text{G}}^{\text{G}}\mathbf{R}=\begin{bmatrix}\cos\alpha\cos\beta&\cos \alpha\sin\beta\sin\gamma-\sin\alpha\cos\gamma&\cos\alpha\sin\beta+\sin\alpha \sin\gamma\\ \sin\alpha\cos\beta&\sin\alpha\sin\beta\sin\gamma+\cos\alpha\cos\gamma&\sin \alpha\sin\beta\cos\gamma-\sin\gamma\\ \sin\beta&\cos\beta\sin\gamma&\cos\beta\cos\gamma\end{bmatrix} \tag{6}\]  
\[\zeta_{\text{G}}^{\text{G}}\mathbf{t}=\zeta_{\text{G}}^{\text{G}}\mathbf{R}-\zeta_{ \text{G}}^{\text{G}}\mathbf{R}^{\text{O}}\mathbf{W} \tag{7}\]  
\[\zeta_{\text{G}}^{\text{G}}\mathbf{T}=\begin{bmatrix}\zeta_{\text{G}}^{\text{G}} \mathbf{R}&\zeta_{\text{G}}^{\text{G}}\mathbf{t}\\ 0&1\end{bmatrix} \tag{8}\]