手眼标定结果不理想(手动输入机器人位姿时出错)

问题

手眼标定结果不理想(差或勉强合格),看起来像是以下几种组合之一:

手眼变换

手眼残差

投影验证

触碰测试

不安全

合理的

合理的

尚可

合理的

欠佳

尚可

If manually-entered robot poses contain typos, double-check the values (or the rotation convention used) and repeat the hand-eye calibration (see Potential Solution below).

手眼标定结果不佳的示例

手眼变换矩阵看起来不正确,因为它的几个值与物理测量值相差极大,对于这种设置来说不合理。

手眼变换矩阵

0.609

0.177

0.773

-467.320

-0.109

0.984

-0.140

17.581

-0.785

0.001

0.619

794.894

0

0

0

1

For this setup, the value 794.894 is expected to be approximately 130 mm, and the value 17.581 is expected to be roughly 90 mm (the expected values depend on your camera-to-calibration-object geometry). At this stage we ignore the sign (+/-), because it depends on the coordinate-system definitions; we focus only on the distances.

../../_images/eye_in_hand_approximate_hand_eye_matrix.png

标定残差也明显大于预期,高出几个数量级。

残差

N(位姿)

平均旋转角度(°)

最大旋转角度(°)

平均平移残差(mm)

最大平移残差(mm)

11

2.855

10.677

102.330

405.720

For smaller robots, we expect the residuals to be in the sub-millimeter range, while for larger robots, the residuals can be in the millimeter range. As for the rotational component of the residuals, we expect them to be in the sub-degree range.

全部的残差数据
残差

位姿

旋转角度(°)

平移量(mm)

1

1.685

405.720

2

1.816

90.325

3

0.215

74.578

4

1.901

143.061

5

2.296

21.398

6

10.678

94.157

7

5.541

102.133

8

0.235

40.173

9

3.979

48.811

10

1.894

76.962

11

1.177

28.309

Verification by Projection fails, which suggests that the hand-eye calibration is not correct, and that the touch test will fail badly.

../../_images/projection_verification_bad.png
临界状态的手眼标定结果示例

手眼变换矩阵看起来合理,与粗略的手动测量结果一致(见下表和图像)。

手眼变换矩阵

0.999

-0.003

0.040

-54.871

0.002

0.999

0.029

-90.920

-0.040

-0.029

0.999

128.709

0

0

0

1

../../_images/eye_in_hand_approximate_hand_eye_matrix.png

校准残差在可接受的范围内,表明优化已成功收敛。

残差

N(位姿)

平均旋转角度(°)

最大旋转角度(°)

平均平移残差(mm)

最大平移残差(mm)

11

0.027

0.059

0.160

0.388

For smaller robots, we expect the residuals to be in the sub-millimeter range, while for larger robots, the residuals can be in the millimeter range. As for the rotational component of the residuals, we expect them to be in the sub-degree range.

全部的残差数据
残差

位姿

旋转角度(°)

平移量(mm)

1

0.025

0.388

2

0.016

0.270

3

0.021

0.098

4

0.028

0.197

5

0.014

0.057

6

0.056

0.154

7

0.018

0.086

8

0.019

0.230

9

0.031

0.074

10

0.059

0.167

11

0.015

0.043

Verification by Projection technically succeeds, but the resulting error is still too large to be acceptable. Projection verification error can seem acceptable even if the hand-eye calibration is incorrect, so treat a passing result with caution.

../../_images/projection_verification_poor.png

触碰测试结果不理想(差或勉强合格)。

Bad Touch Test

触感测试工具的尖端对 ArUco 标记施加的压力过大。

Marginal Touch Test

触碰测试工具的尖端轻轻按压 ArUco 标记。

潜在原因

将机器人位姿从机器人控制器复制到电脑时出现人为错误(录入错误)。

机器人位姿中的录入错误会导致位姿-图像对不一致,从而破坏手眼标定所需的几何假设。即使是一个很小的错误数字,也足以扭曲一个位姿,使整个优化过程偏离正确解,最终导致残差较大、变换不合理,以及整体标定结果不理想。

潜在解决方案

  1. 如果您要手动将机器人控制器中的位姿复制到 PC,请仔细检查数值,确保没有输入错误。

  2. 将机器人控制器输出的机器人位姿转换为 Zivid 手眼标定所需的变换矩阵时,确保使用正确的旋转约定。

  3. 使用同一数据集重复进行手眼标定。

  4. 验证手眼标定结果(变换矩阵、残差、投影)。

  5. Run the touch test (if the hand-eye calibration results are good).

../../_images/touching-test-result-aruco.jpg
重现问题(手眼标定效果不佳)

良好的数据集

使用下图所示的数据集成功进行了手眼标定。

../../_images/hand-eye-calibration-small-movements-dataset-only-11.png

标定结果如下:

手眼变换矩阵

0.999

-0.002

0.041

-55.598

0.001

0.999

0.028

-90.654

-0.041

-0.028

0.999

129.044

0

0

0

1

残差

N(位姿)

平均旋转角度(°)

最大旋转角度(°)

平均平移残差(mm)

最大平移残差(mm)

11

0.025

0.054

0.109

0.192

全部的残差数据
残差

位姿

旋转角度(°)

平移量(mm)

1

0.025

0.388

2

0.016

0.270

3

0.021

0.098

4

0.028

0.197

5

0.014

0.057

6

0.056

0.154

7

0.018

0.086

8

0.019

0.230

9

0.031

0.074

10

0.059

0.167

11

0.015

0.043

The Hand-Eye calibration was verified with a touch test.

../../_images/touch_test_correct.png

触碰测试成功,证实了手眼标定的正确性和准确性。

错误数据集(翻译错误严重)

为了模拟人工手动输入机器人位姿时可能出现的错误,我们在良好数据集中的一个位姿处引入了一个较大的平移误差。平移向量的 X 值从 -742.58 毫米变为 -142.58 毫米(首位整数:7 → 1)。

标定结果如下:

手眼变换矩阵

0.609

0.177

0.773

-467.320

-0.109

0.984

-0.140

17.581

-0.785

0.001

0.619

794.894

0

0

0

1

残差

N(位姿)

平均旋转角度(°)

最大旋转角度(°)

平均平移残差(mm)

最大平移残差(mm)

11

2.855

10.677

102.330

405.720

全部的残差数据
残差

位姿

旋转角度(°)

平移量(mm)

1

1.685

405.720

2

1.816

90.325

3

0.215

74.578

4

1.901

143.061

5

2.296

21.398

6

10.678

94.157

7

5.541

102.133

8

0.235

40.173

9

3.979

48.811

10

1.894

76.962

11

1.177

28.309

Verification by Projection failed, which suggests that the hand-eye calibration is not correct, and that the touch test will fail badly. Therefore, the touch test was skipped for safety reasons.

../../_images/projection_verification_bad.png

比较

下表比较了手眼标定矩阵(平移值)和手眼标定残差的结果。

手眼变换矩阵中的转换值

数据集

X (mm)

Y (mm)

Z (mm)

-55.598

-90.654

129.044

差(非常大的平移误差)

-467.320

17.581

794.894

Δ(好 - 差)

411.722

-108.235

-665.850

残差

数据集

N

平均旋转角度(°)

最大旋转角度(°)

平均平移残差(mm)

最大平移残差(mm)

11

0.025

0.054

0.109

0.192

差(非常大的平移误差)

11

2.855

10.677

102.330

405.720

重现问题(手眼标定结果尚可)

良好的数据集

使用下图所示的数据集成功进行了手眼标定。

../../_images/hand-eye-calibration-small-movements-dataset-only-11.png

标定结果如下:

手眼变换矩阵

0.999

-0.002

0.041

-55.598

0.001

0.999

0.028

-90.654

-0.041

-0.028

0.999

129.044

0

0

0

1

残差

N(位姿)

平均旋转角度(°)

最大旋转角度(°)

平均平移残差(mm)

最大平移残差(mm)

11

0.025

0.054

0.109

0.192

全部的残差数据
残差

位姿

旋转角度(°)

平移量(mm)

1

0.025

0.388

2

0.016

0.270

3

0.021

0.098

4

0.028

0.197

5

0.014

0.057

6

0.056

0.154

7

0.018

0.086

8

0.019

0.230

9

0.031

0.074

10

0.059

0.167

11

0.015

0.043

The Hand-Eye calibration was verified with a touch test.

../../_images/touch_test_correct.png

触碰测试成功,证实了手眼标定的正确性和准确性。

为了模拟人工手动输入机器人位姿时出现的录入错误,我们对原始数据集进行了修改,通过三种不同的方式引入错误,从而得到了三个新的数据集:

Small Angle Error

在记录某个位姿的其中一个 Roll-Pitch-Yaw 角度时,出现了一个微小的角度误差(即小数点后的第一位数字输错)。例如,Yaw 值被错误地从 6.82° 改成了 6.22°(小数点后第一位由 8 变成了 2)。

The calibration resulted in the following hand-eye matrix and residuals:

手眼变换矩阵

0.999

-0.002

0.044

-57.032

0.001

1.000

0.029

-90.899

-0.044

-0.029

0.999

129.580

0

0

0

1

残差

数据集

N

平均旋转角度(°)

最大旋转角度(°)

平均平移残差(mm)

最大平移残差(mm)

小角度误差

11

0.104

0.536

0.256

0.877

全部的残差数据
残差

位姿

旋转角度(°)

平移量(mm)

1

0.536334

0.877

2

0.055345

0.431

3

0.057495

0.189

4

0.064677

0.301

5

0.054738

0.115

6

0.059730

0.029

7

0.070040

0.238

8

0.062262

0.119

9

0.060767

0.069

10

0.060585

0.288

11

0.062108

0.160

Comparison with Good Dataset

手眼变换矩阵中的转换值

数据集

X (mm)

Y (mm)

Z (mm)

-55.598

-90.654

129.044

差(小角度误差)

-57.032

-90.899

129.580

Δ(好 - 差)

1.434

0.244

-0.536

残差

数据集

N

平均旋转角度(°)

最大旋转角度(°)

平均平移残差(mm)

最大平移残差(mm)

11

0.025

0.054

0.109

0.192

差(小角度误差)

11

0.104

0.536

0.256

0.877

触碰测试

触感测试工具的尖端对 ArUco 标记施加的压力过大。

Large Angle Error

在记录某个位姿的其中一个 Roll-Pitch-Yaw 角度时,出现了一个较大的角度误差(即整数部分的第一位数字输错)。例如,偏航 Yaw 值被错误地从 6.93° 改成了 3.93°(首位整数由 6 变成了 3)。

The calibration resulted in the following hand-eye matrix and residuals:

手眼变换矩阵

0.999

0.005

0.047

-58.558

-0.006

1.000

0.029

-87.455

-0.047

-0.029

0.998

131.117

0

0

0

1

残差

数据集

N

平均旋转角度(°)

最大旋转角度(°)

平均平移残差(mm)

最大平移残差(mm)

大角度误差

11

0.505

2.742

0.966

4.393

全部的残差数据
残差

位姿

旋转角度(°)

平移量(mm)

1

2.742018

4.393

2

0.280878

1.050

3

0.269892

0.750

4

0.288396

1.053

5

0.291592

0.435

6

0.247856

0.691

7

0.315325

0.886

8

0.278548

0.410

9

0.297165

0.382

10

0.262904

0.314

11

0.285421

0.262

Comparison with Good Dataset

手眼变换矩阵中的转换值

数据集

X (mm)

Y (mm)

Z (mm)

-55.598

-90.654

129.044

差(大角度误差)

-58.558

-87.455

131.117

Δ(好 - 差)

2.960

-3.199

-2.073

残差

数据集

N

平均旋转角度(°)

最大旋转角度(°)

平均平移残差(mm)

最大平移残差(mm)

11

0.025

0.054

0.109

0.192

差(大角度误差)

11

0.505

2.742

0.966

4.393

触碰测试

触碰测试工具的尖端无法触及 ArUco 标记。

Small Translation Error

在记录某个位姿的平移向量时,出现了一个微小的平移误差(即小数点后的第一位数字输错)。例如,X 轴的值被错误地从 -48.81 改成了 -48.21(小数点后第一位由 8 变成了 2)。

The calibration resulted in the following hand-eye matrix and residuals:

手眼变换矩阵

0.999

-0.003

0.040

-54.871

0.002

1.000

0.029

-90.920

-0.040

-0.029

0.999

128.709

0

0

0

1

残差

数据集

N

平均旋转角度(°)

最大旋转角度(°)

平均平移残差(mm)

最大平移残差(mm)

小平移错误

11

0.027

0.059

0.160

0.388

全部的残差数据
残差

位姿

旋转角度(°)

平移量(mm)

1

0.025433

0.388

2

0.016149

0.270

3

0.021316

0.098

4

0.027773

0.197

5

0.013938

0.057

6

0.056120

0.154

7

0.018387

0.086

8

0.019042

0.230

9

0.031110

0.074

10

0.059334

0.167

11

0.014671

0.043

Comparison with Good Dataset

手眼变换矩阵中的转换值

数据集

X (mm)

Y (mm)

Z (mm)

-55.598

-90.654

129.044

差(小平移误差)

-54.871

-90.920

128.709

Δ(好 - 差)

-0.727

0.265

0.335

残差

数据集

N

平均旋转角度(°)

最大旋转角度(°)

平均平移残差(mm)

最大平移残差(mm)

11

0.025

0.054

0.109

0.192

差(小平移误差)

11

0.027

0.059

0.160

0.388

触碰测试

触接测试工具的尖端落在了 ArUco 标记的中心位置。