3.1. Hand-eye calibration algorithm simulation experiments
In this paper, ROS and Gazebo simulation platforms are used to build the simulation environment to test the performance of the above four hand-eye calibration algorithms [17,20,24,25]. The true values of
and
in simulation experiments are shown in
Table 1, and the calculation results of each calibration algorithm are shown in
Table 2.
In order to quantitatively evaluate the performance of each calibration algorithm, the translation error
of the hand-eye transformation matrix is defined as the two norms of the difference between the calculated value
of the translation vector and the true value
. The translation error is measured by the Euclidean distance:
Similarly, the rotation matrix R is first converted to an Euler angle E, and the Euler angle is expressed in vector form as
, then the rotation error
of the hand-eye conversion matrix can be defined as:
According to the real values of the parameters in the simulation environment, the statistical results of the translation error and rotation error of the hand-eye transformation matrix calculated by each calibration algorithm are shown in
Figure 2. It can be seen from the statistical figure that the translation error of the hand-eye conversion matrix calculated by the Tsai-Lenz and Andreff algorithms is significantly lower than the other two algorithms, but the rotation error of the hand-eye conversion matrix calculated by the Tsai-Lenz algorithm is slightly higher than the other algorithms. Overall, the calibration accuracy of the Tsai-Lenz and Andreff algorithm is relatively high in the simulation environment.
3.3. Reprojection error analysis
From the results of heuristic error analysis, it can be seen that and may have some errors, so it is unreasonable to calculate by Equation 10. Since the position of the AR marker is fixed during the calibration process, the following error analysis process considers that is known and fixed.
According to the coordinate transformation relationship shown in
Figure 1, the pose representation of the AR marker in the camera coordinate system can be obtained:
If the AR marker coordinate system
is defined as the world coordinate system, then
. According to the pinhole camera imaging model, the conversion relationship between the coordinates
and pixel coordinates
in the AR marker coordinate system and the z-axis coordinate
in the camera coordinate system can be obtained as follows:
On the basis of the above definition, the coordinates of the origin
of the AR marker coordinate system in the world coordinate system
, so the pixel coordinates
of the AR marker center point can be calculated by the following formula:
In the above formula, is the inherent property of the camera, is the hand-eye conversion matrix to be calibrated, can be calculated by the forward kinematics equation of the manipulator, and is known and fixed.
Since the translation part of the homogeneous transformation matrix
reflects the coordinates of the AR marker center point in the base coordinate system of the manipulator, the function of Equation 13 is actually to remap the coordinates of the AR marker center point into the pixel coordinate system. For a certain position
, that the manipulator moves to during the calibration process, the AR mark image captured by the camera is denoted as
, and the pixel coordinate after the reprojection of the AR mark center point in
is denoted as
, then:
Since the real pixel coordinate
of the AR marker center point in
can be obtained by corner detection or manual labelling, the reprojection error
corresponding to
can be defined as the Euclidean distance between the real pixel coordinates of the AR marker center point and the reprojection coordinates:
If the manipulator moves to N positions during the hand-eye calibration process, the average reprojection error can be defined as:
According to Equation (15) and Equation (16), the reprojection error of each group of simulation experiment data is calculated. The results are shown in
Figure 4. The horizontal line in the figure reflects the average reprojection error of each calibration algorithm. It can be seen that the average reprojection error corresponding to the calculation results of Tsai-Lenz and Andreff algorithms is small, and the fluctuation of the reprojection error of each group of data is relatively small. In addition, from the previous analysis results, the Euclidean distance errors of these two algorithms are relatively small, which proves that the reprojection error can reflect the accuracy of the calibration results to a certain extent. In general, the smaller the reprojection error, the higher the accuracy of the calibration results. In the process of hand-eye calibration of the real manipulator, because the real value of the hand-eye transformation matrix cannot be obtained, the Euclidean distance error of calibration results cannot be calculated, and the reprojection error can be used as the evaluation standard of calibration accuracy.
3.4. Optimization calibration algorithm by minimizing reprojection error analysis
From the statistical results of the Euclidean distance error of each algorithm in
Figure 1, it can be seen that even if the hand-eye calibration is carried out in the simulation environment, the translation error of the hand-eye conversion matrix calculated by different calibration algorithms is also quite different, and both are greater than 2mm, which indicates that each calibration algorithm still has a large optimization space.
In the process of hand-eye calibration in the simulation environment, the only error source is the pose calculation error of the AR marker. However, when using the above four common algorithms for calibration, it is considered that the calculated is error-free, resulting in a certain error in the calibration results of each algorithm. In other words, the conventional hand-eye calibration algorithm pays more attention to versatility, and does not use the prior knowledge that the position of the AR marker is fixed in the calibration process, so it is difficult to obtain high-precision calibration results. The definition of the reprojection error of the hand-eye calibration results makes full use of this prior knowledge. According to the previous analysis, the smaller the average reprojection error is, the higher the accuracy of the calibration results. Therefore, by minimizing the reprojection error, the accuracy of the hand-eye calibration results may be improved.
Based on the above analysis, the following exploratory experiments are carried out by controlling variables to test whether smaller average reprojection errors can be obtained by adjusting the parameters in the calibrated hand-eye transformation matrix. In the experiment, the
used to calculate the reprojection error takes the real value in
Table 1, and the translation parameters calibrated by the Tsai-Lenz algorithm in
Table 2 are taken as the initial values. The three translation parameters
、
and
are adjusted with the step length of 0.001m, and the adjusted hand-eye transformation matrix is substituted into Equation 15 and Equation 16 to calculate the average reprojection error of each group of samples in the simulation experiment. The experimental results are shown in
Figure 5. The purple dotted line reflects the parameter value of the minimum point, and the black dotted line reflects the average reprojection error of the minimum point.
From
Figure 5, it can be seen that by adjusting the translation parameters separately, the average reprojection error can indeed be reduced to a certain extent, and the translation parameters calibrated by the Tsai-Lenz algorithm are used as the initial values, which can reduce the search space of the parameters and help quickly find the translation parameters corresponding to the lowest point of the reprojection error. However, when
0.03858m, the average reprojection error gets the minimum, but this value obviously deviates from the real value
0.0345m (in
Table 2). Therefore, by adjusting x, y, z alone, it is not guaranteed that the translation parameters with higher accuracy can be obtained.
Next, we take 0.001 m as the step length, and adjust x, y, z parameters at the same time. The change rule of reprojection error is shown in
Figure 6. The color of the data points in the figure reflects the size of reprojection error. It can be seen that the translation matrix that minimizes the average reprojection error is
, and the corresponding average reprojection error
0.69861. According to Equation 8, the corresponding translation error
0.00165 can be calculated. It can be seen from
Figure 2 and
Figure 4 that the translation
error 0.0022 and the average reprojection error
2.96867 of the calibration results are calculated by the Tsai-Lenz algorithm. It can be seen that there is a set of translation parameters
,that can minimize the average reprojection error, and the translation error of this set of parameters
is less than the parameters calibrated by the Tsai-Lenz algorithm. In other words, the accuracy of hand-eye calibration results can be improved by simultaneously adjusting the three parameters
and
to minimize the reprojection error.
In the calibration process, after a certain position
of the manipulator is determined, the four parameters
in Equation 15 are determined accordingly. Therefore,
determines the size of the reprojection
. According to Equation 16, if N positions are determined, then the magnitude of the average reprojection error
is uniquely determined by
, so the mapping function
of the hand-eye transformation matrix
to the average reprojection error
can be defined as:
Furthermore,
can be uniquely determined by the translation parameter
and the rotation parameter
, so the mapping function
of the translation and rotation parameters to the average reprojection error
can be defined:
Based on the above definition, this paper transforms the optimization problem of the hand-eye conversion matrix into the problem of finding the minimum value of the objective function, and optimizes the hand-eye conversion matrix from the perspective of minimizing the reprojection error.
Next, with a step size of 0.0001m, the three parameters 、 and are adjusted to search for the translation parameter that minimizes the function . The optimal translation parameter (-0.07058, 0.00039, 0.03483), and the corresponding average reprojection error is 0.36084, which is 87.845 % lower than that of the Tsai-Lenz algorithm. The translation erroris 0.0007836 m, which is 64.382 % lower than that of the Tsai-Lenz algorithm.
In the above optimization process, only the translation parameters in the hand-eye conversion matrix are adjusted. Because after many simulation calibration experiments, it is found that the translation parameters have a greater influence on the accuracy of the calibration results than the rotation parameters, and the number of translation parameters is less. In general, only adjusting the translation parameters can obtain ideal calibration results. Of course, if the translation and rotation parameters are adjusted at the same time, higher precision calibration results can be obtained theoretically, but this process will be very time-consuming.