一、手眼矩陣的分類
1、歐拉角版
2、四元數版
3、旋轉矩陣版本
[
[r11,r12,r13,x],
[r21,r22,r23,y],
[r31,r32,r33,z]
]
4、齊次矩陣
[
[r11,r12,r13,x],
[r21,r22,r23,y],
[r31,r32,r33,z],
[0, 0, 0, 1]
]
二、手眼标定的分類
三、用python将歐拉角版轉換為齊次矩陣
import numpy as np
import math
def eulerAnglesToRotationMatrix(theta):
R_x = np.array([[1, 0, 0],
[0, math.cos(theta[0]), -math.sin(theta[0])],
[0, math.sin(theta[0]), math.cos(theta[0])]])
R_y = np.array([[math.cos(theta[1]), 0, math.sin(theta[1])],
[0, 1, 0],
[-math.sin(theta[1]), 0, math.cos(theta[1])]])
R_z = np.array([[math.cos(theta[2]), -math.sin(theta[2]), 0],
[math.sin(theta[2]), math.cos(theta[2]), 0],
[0, 0, 1]])
R = np.dot(R_x, np.dot(R_y, R_z))
return R
# 需要将角度值轉換為弧度值
Rx = math.radians(189.4)
Ry = math.radians(0.6782)
Rz = math.radians(0.5492)
# 将轉換坐标輸入a
a = np.array([178.67, 731.98, 625.06])
theta = [Rx, Ry, Rz]
# 将轉換結果放入m
m = eulerAnglesToRotationMatrix(theta)
# 合成旋轉矩陣
d = np.array([0, 0, 0, 1])
b = np.row_stack((np.column_stack((m, a)), d))
n = np.array([[-63.51], [92.75], [723.51], [1]])
# 輸出轉換坐标
print(np.dot(b, n))
輸出結果:
[[ 122.8422612 ]
[ 759.36439782]
[-104.48517409]
[ 1. ]]