update 初次融合+调试

This commit is contained in:
FrankCV2048
2024-09-03 23:28:16 +08:00
parent 051de571a8
commit 0af995b9cd
10 changed files with 108 additions and 69 deletions

View File

@ -58,12 +58,11 @@ def R_matrix(x,y,z,u,v,w):
return transformation_matrix
rotation = R_matrix(559.365,0.704,731.196,179.996,66.369,179.996)#张啸给我的值填这里
# 黄老师给我的xyz和法向量
def getPosition(x,y,z,a,b,c):
# 图像识别结果:xyz和法向量
def getPosition(x,y,z,a,b,c,rotation):
target = np.asarray([x, y, z,1])
camera2robot = np.loadtxt('D:\BaiduNetdiskDownload\机械臂\GRCNN\\real\cam_pose.txt', delimiter=' ')
camera2robot = np.loadtxt('D:\BaiduNetdiskDownload\机械臂\GRCNN\\real\cam_pose.txt', delimiter=' ') #相对目录且分隔符采用os.sep
robot2base = rotation
camera2base = robot2base @ camera2robot
target_position = np.dot(camera2base, target)
@ -75,6 +74,3 @@ def getPosition(x,y,z,a,b,c):
print(target_position, noraml_base)
return target_position,noraml_base
if __name__ =="__main__":
getPosition(-96.09919,56.339145,444.640084,-0.09619,-0.45399, 0.88579)