## 2 Target Recognition and Pose Estimation of the Fuel Tank Inlet
### Recognition Method and Results Based on RGB-D Camera
\begin{bmatrix}R&T\\ 0&1\end{bmatrix}\begin{bmatrix}X_{w}\\ Y_{w}\\ Z_{w}\\ 1\end{bmatrix}  \tag{1}\]  
\[z_{c} \begin{bmatrix}u\\ v\\ 1\end{bmatrix} =x \begin{bmatrix}f_{11}&f_{12}&f_{13}&f_{14}\\ f_{21}&f_{22}&f_{23}&f_{24}\\ f_{31}&f_{32}&f_{33}&f_{33}\end{bmatrix}\begin{bmatrix}X_{w}\\ Y_{w}\\ Z_{w}\\ 1\end{bmatrix}  \tag{2}\]  
This can be expanded and organized as follows:  
\[f_{11}X_{w}+f_{12}Y_{w}+f_{13}Z_{w}+f_{14}-f_{31}X_{w}u_{c}-f_{32}Y_{w}u_{c}-f_ {33}Y_{w}u_{c}-f_{33}Z_{w}u_{c}-f_{34}u_{c}=0 \tag{3}\]  
\[f_{21}X_{w}+f_{22}Y_{w}+f_{23}Z_{w}+f_{24}-f_{31}X_{w}u_{c}-f_{32}Y_{w}u_{c}-f_ {33}Z_{w}u_{c}-f_{34}u_{c}=0 \tag{4}\]  
Each pair of 2D-3D matched points corresponds to two equations. There are a total of 12 unknowns, and at least six sets of matching points are required to solve for the [R 1T] matrix. The above equation can be expressed in matrix form AF = 0 as follows:  
\[\text{A}= \begin{bmatrix}X_{1}&Y_{1}&Z_{1}&1&0&0&0&0&-u_{1}X_{1}&-u_{1}Y_{1}& -u_{1}Z_{1}&-u_{1}\\ 0&0&0&0&X_{1}&Y_{1}&Z_{1}&1&-v_{1}Y_{1}&-v_{1}Y_{1}&-v_{1}Z_{1}&-v_{1}\\ \vdots&&&\vdots&&&\vdots&&&\vdots\\ X_{n}&Y_{n}&Z_{n}&1&0&0&0&0&-u_{n}X_{n}&-u_{n}Y_{n}&-u_{n}Z_{n}&-u_{n}\\ 0&0&0&0&X_{n}&Y_{n}&Z_{n}&1&-v_{n}X_{n}&-v_{n}Y_{n}&-v_{n}Z_{n}&-v_{n}\\ \end{bmatrix}  \tag{5}\]  
\[\text{F}= \begin{bmatrix}f_{11}&f_{12}&f_{13}&f_{14}&f_{21}&f_{22}&f_{23}&f_{24 }&f_{31}&f_{32}&f_{33}&f_{34}\\ \end{bmatrix} ^{T} \tag{6}\]  
When N = 6, the equations can be directly solved. When N \(\geq\) 6, the least squares solution is obtained, 1 \(|\) AF \(|\) 1\({}^{2}\). Performing Singular Value Decomposition (SVD) on the A matrix yields SVD(A) = UEV, where both U and V matrices are orthogonal, and \(\Sigma\) is the matrix of eigenvalues of A. In the experiment, the A matrix was obtained as follows:  
\[\text{R}= \begin{bmatrix}0.99998854&0.00216014&0.00427195\\ -0.00221074&0.99992702&0.01187697\\ -0.00424598&-0.011886270&0.99992034\end{bmatrix} \text{T}=[-0.0501434,\ 0,\ 0] \tag{7}\]  
After solving for the transformation matrix from the pixel coordinate system to the camera coordinate system, it is also necessary to unify the camera coordinate system with the robotic arm's coordinate system. Considering the relative installation method between the camera and the robotic arm, this paper adopts the eye-in-hand calibration method to calculate the transformation matrix between the robotic arm and the camera, as shown in Figure 4:  
Figure 4: Relationship of transformation between coordinate systems. We designate the robot's base coordinate system as the world coordinate system (base), define the end of the robotic arm as the end effector coordinate system (end), the camera's coordinate system (cam), and the fuel tank's coordinate system (box). Based on these definitions, we can establish the following mathematical model: \(endbaseT=TboxbascancandTboxcamT\), \(\mathit{baseT}\) represents the transformation relationship between the robot's base coordinate system and the fuel tank's coordinate system. \(\mathit{baseT}\) represents the transformation relationship between the robot's base coordinate system and the end effector coordinate system of the robotic arm. \(\mathit{cminT}\) represents the transformation relationship between the end effector coordinate system and the camera's coordinate system. \(\mathit{cmaxT}\) represents the transformation relationship between the camera's coordinate system and the fuel tank's coordinate system. In the diagram, the transformation matrix A between the fuel tank's coordinate system and the camera's coordinate system (shown in blue) is known. The transformation matrix C between the robot's base coordinate system and the end effector coordinate system (shown in orange) is known. The transformation matrix H between the camera's coordinate system and the end effector coordinate system (shown in red) is to be determined. Multiplying these three matrices yields the transformation matrix B from the fuel tank's coordinate system to the robot's base coordinate system, as shown in the orange part of the above diagram.