Compare commits

...

2 Commits

Author SHA1 Message Date
raiot fda0fb343c Merge branch 'master' of https://gitea.everains.com/raiot/StackBots 2024-11-08 10:25:36 +08:00
raiot 1aa3e974b0 some update from robot side 2024-11-08 10:18:42 +08:00
4 changed files with 17 additions and 6 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,3 +27,14 @@ 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))

BIN
camera_params.npz Normal file

Binary file not shown.

View File

@ -22,7 +22,7 @@ obj_points = []
img_points = []
# 读取标定板图像
images = ["1723983285.6120198.jpg"] # 替换为实际的图像文件
images = ["1724898532.521401.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([-1.5, -216, -30])
taT = np.array([-15.5, -187, -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))
# 604, 109 [-115, -150.94, -25]
# 485300 [-135, -135.94, -30]
if __name__ == '__main__':
# print(pixel2robot(468, 254))
print(pixel2robot(469, 254))
print(pixel2robot(485, 300))
# print(pixel2robot(956, 448))