diff --git a/mycobot_ai/ai_mecharm_270/res/blue/goal9.jpeg b/mycobot_ai/ai_mecharm_270/res/blue/goal9.jpeg new file mode 100644 index 0000000..ef91257 Binary files /dev/null and b/mycobot_ai/ai_mecharm_270/res/blue/goal9.jpeg differ diff --git a/mycobot_ai/ai_mecharm_270/res/gray/goal9.jpeg b/mycobot_ai/ai_mecharm_270/res/gray/goal9.jpeg new file mode 100644 index 0000000..e92138f Binary files /dev/null and b/mycobot_ai/ai_mecharm_270/res/gray/goal9.jpeg differ diff --git a/mycobot_ai/ai_mecharm_270/res/green/goal1.jpeg b/mycobot_ai/ai_mecharm_270/res/green/goal1.jpeg deleted file mode 100644 index ab8991c..0000000 Binary files a/mycobot_ai/ai_mecharm_270/res/green/goal1.jpeg and /dev/null differ diff --git a/mycobot_ai/ai_mecharm_270/res/green/goal11.jpeg b/mycobot_ai/ai_mecharm_270/res/green/goal11.jpeg index b1242b0..e4315ee 100644 Binary files a/mycobot_ai/ai_mecharm_270/res/green/goal11.jpeg and b/mycobot_ai/ai_mecharm_270/res/green/goal11.jpeg differ diff --git a/mycobot_ai/ai_mecharm_270/res/red/goal8.jpeg b/mycobot_ai/ai_mecharm_270/res/red/goal8.jpeg new file mode 100644 index 0000000..0eaceae Binary files /dev/null and b/mycobot_ai/ai_mecharm_270/res/red/goal8.jpeg differ diff --git a/mycobot_ai/ai_mecharm_270/res/takephoto.jpeg b/mycobot_ai/ai_mecharm_270/res/takephoto.jpeg index 1798785..54c25d7 100644 Binary files a/mycobot_ai/ai_mecharm_270/res/takephoto.jpeg and b/mycobot_ai/ai_mecharm_270/res/takephoto.jpeg differ diff --git a/mycobot_ai/ai_mecharm_270/scripts/advance_detect_obj_color.py b/mycobot_ai/ai_mecharm_270/scripts/advance_detect_obj_color.py index ec46a57..ebd2336 100644 --- a/mycobot_ai/ai_mecharm_270/scripts/advance_detect_obj_color.py +++ b/mycobot_ai/ai_mecharm_270/scripts/advance_detect_obj_color.py @@ -17,8 +17,8 @@ __version__ = "1.0" class Object_detect(Movement): - def __init__(self, camera_x = 140, camera_y = 5): # m5 - # def __init__(self, camera_x = 140, camera_y = -5): # pi + def __init__(self, camera_x = 148, camera_y = 5): # m5 + # def __init__(self, camera_x = 148, camera_y = -5): # pi # inherit the parent class super(Object_detect, self).__init__() # get path of file @@ -35,10 +35,10 @@ class Object_detect(Movement): # 移动坐标 self.move_coords = [ - [92.3, -104.9, 211.4, -179.6, 28.91, 131.29], # above the red bucket - [165.0, -93.6, 201.4, -173.43, 46.23, 160.65], # above the green bucket - [88.1, 126.3, 193.4, 162.15, 2.23, 156.02], # above the blue bucket - [-5.4, 120.6, 204.6, 162.66, -6.96, 159.93], # above the gray bucket + [109.1, -118.8, 164.9, -179.02, 11.07, 132.93], # above the red bucket + [178.4, -98.5, 172.7, -175.8, 41.25, 159.41], # above the green bucket + [97.9, 139.9, 170.7, 163.54, 2.03, 156.04], # above the blue bucket + [-1.8, 143.8, 172.4, 170.69, -4.62, 161.79], # above the gray bucket ] # which robot: USB* is m5; ACM* is wio; AMA* is raspi @@ -165,9 +165,9 @@ class Object_detect(Movement): self.mc.send_coords([x, y, 103, 179.12, -0.18, 179.46], 30, 0) # -178.77, -2.69, 40.15 m5 - # self.mc.send_coords([x, y, 90, 179.12, -0.18, 179.46], 30, 0) # -178.77, -2.69, 40.15 pi + # self.mc.send_coords([x, y, 103, 179.12, -0.18, 179.46], 30, 0) # -178.77, -2.69, 40.15 pi time.sleep(3) - self.pub_marker(x/1000.0, y/1000.0, 90/1000.0) + self.pub_marker(x/1000.0, y/1000.0, 103/1000.0) # open pump diff --git a/mycobot_ai/ai_mecharm_270/scripts/advance_detect_obj_img_folder.py b/mycobot_ai/ai_mecharm_270/scripts/advance_detect_obj_img_folder.py index f2bc2c1..1eadbbf 100644 --- a/mycobot_ai/ai_mecharm_270/scripts/advance_detect_obj_img_folder.py +++ b/mycobot_ai/ai_mecharm_270/scripts/advance_detect_obj_img_folder.py @@ -16,7 +16,7 @@ __version__ = "1.0" # Adaptive seeed class Object_detect(Movement): - def __init__(self, camera_x = 145, camera_y = -5): + def __init__(self, camera_x = 148, camera_y = 5): # inherit the parent class super(Object_detect, self).__init__() # get path of file @@ -32,10 +32,10 @@ class Object_detect(Movement): # 移动坐标 self.move_coords = [ - [92.3, -104.9, 211.4, -179.6, 28.91, 131.29], # above the red bucket - [165.0, -93.6, 201.4, -173.43, 46.23, 160.65], # above the green bucket - [88.1, 126.3, 193.4, 162.15, 2.23, 156.02], # above the blue bucket - [-5.4, 120.6, 204.6, 162.66, -6.96, 159.93], # above the gray bucket + [109.1, -118.8, 164.9, -179.02, 11.07, 132.93], # above the red bucket + [178.4, -98.5, 172.7, -175.8, 41.25, 159.41], # above the green bucket + [97.9, 139.9, 170.7, 163.54, 2.03, 156.04], # above the blue bucket + [-1.8, 143.8, 172.4, 170.69, -4.62, 161.79], # above the gray bucket ] # 判断连接设备:ttyUSB*为M5,ttyACM*为seeed @@ -147,18 +147,17 @@ class Object_detect(Movement): def move(self, x, y, color): # send Angle to move 270 self.mc.send_angles(self.move_angles[0], 30) - time.sleep(7) + time.sleep(4) print("x %s ,y %s" % (x,y)) # send coordinates to move 270 根据不同底板机械臂,调整吸泵高度 self.mc.send_coords([x, y, 140, 179.12, -0.18, 179.46], 30, 0) - time.sleep(7) - print("ntm") + time.sleep(3) self.mc.send_coords([x, y, 103, 179.12, -0.18, 179.46], 30, 0) # -178.77, -2.69, 40.15 m5 # self.mc.send_coords([x, y, 90, 179.12, -0.18, 179.46], 30, 0) # -178.77, -2.69, 40.15 pi # self.mc.send_coords([x, y, 92, 179.12, -0.18, 179.46], 30, 0) # -178.77, -2.69, 40.15 - time.sleep(6) + time.sleep(3) # open pump if "dev" in self.robot_m5 or "dev" in self.robot_wio: