Compare commits

..

No commits in common. "fda0fb343cdd2fd81d3e0c624ca7b73c46115a65" and "0f784cecc799da2e26937443c74ec01be71cc2b3" have entirely different histories.

4 changed files with 6 additions and 17 deletions

View File

@ -18,8 +18,8 @@ ele_point = (-110, -50.94, 75)
# px, py = input("请输入像素坐标:").split()
# px, py = int(px), int(py)
# target = pixel2robot(877, 628)
# print(target)
target = pixel2robot(877, 628)
print(target)
# jetmax.set_position((target[0], target[1], -30), 1)
# jetmax.set_position((-75.41654829, -156.86319459, 70), 1)
@ -27,14 +27,3 @@ jetmax.set_position(ele_point, 1)
time.sleep(1)
print(jetmax.position)
def move_to_pixel_position(x, y):
target = pixel2robot(x, y)
print(target)
jetmax.set_position((target[0], target[1], -30), 1)
if __name__ == "__main__":
pix_pos = input("分别输入 pixspy 上测得的横坐标和纵坐标,用空格分开:")
print(pix_pos)
x, y = pix_pos.split()
move_to_pixel_position(int(x), int(y))

Binary file not shown.

View File

@ -22,7 +22,7 @@ obj_points = []
img_points = []
# 读取标定板图像
images = ["1724898532.521401.jpg"] # 替换为实际的图像文件
images = ["1723983285.6120198.jpg"] # 替换为实际的图像文件
for fname in images:
img = cv2.imread(fname)

View File

@ -54,7 +54,7 @@ def pixel2robot(p_x, p_y, Zc=380):
[0, -1, 0],
[0, 0, 0]])
taT = np.array([-15.5, -187, -30])
taT = np.array([-1.5, -216, -30])
# print(np.dot(taR, base_coords))
base_coords = np.dot(taR, base_coords) + taT
# base_coords = base_coords + taT
@ -79,11 +79,11 @@ def pixel2robot(p_x, p_y, Zc=380):
# print(covert([993,10],260))
# print(covert([554,559],260))
# 485300 [-135, -135.94, -30]
# 604, 109 [-115, -150.94, -25]
if __name__ == '__main__':
# print(pixel2robot(468, 254))
print(pixel2robot(485, 300))
print(pixel2robot(469, 254))
# print(pixel2robot(956, 448))