一、手眼矩陣的分類
1、歐拉角版
[x,y,z,rx,ry,rz]
2、四元數(shù)版
[x,y,z,qx,qy,qz,qw]
3、旋轉(zhuǎn)矩陣版本
[
[r11,r12,r13,x],
[r21,r22,r23,y],
[r31,r32,r33,z]
]
4、齊次矩陣文章來源:http://www.zghlxwxcb.cn/news/detail-567740.html
[
[r11,r12,r13,x],
[r21,r22,r23,y],
[r31,r32,r33,z],
[0, 0, 0, 1]
]
二、手眼標(biāo)定的分類
文章來源地址http://www.zghlxwxcb.cn/news/detail-567740.html
三、用python將歐拉角版轉(zhuǎn)換為齊次矩陣
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
# 需要將角度值轉(zhuǎn)換為弧度值
Rx = math.radians(189.4)
Ry = math.radians(0.6782)
Rz = math.radians(0.5492)
# 將轉(zhuǎn)換坐標(biāo)輸入a
a = np.array([178.67, 731.98, 625.06])
theta = [Rx, Ry, Rz]
# 將轉(zhuǎn)換結(jié)果放入m
m = eulerAnglesToRotationMatrix(theta)
# 合成旋轉(zhuǎn)矩陣
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]])
# 輸出轉(zhuǎn)換坐標(biāo)
print(np.dot(b, n))
輸出結(jié)果:
[[ 122.8422612 ]
[ 759.36439782]
[-104.48517409]
[ 1. ]]
到了這里,關(guān)于將歐拉角轉(zhuǎn)換為旋轉(zhuǎn)矩陣(手眼標(biāo)定)python版本的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!