diff --git a/mycobot_ai/ai_mycobot_280/scripts/combine_detect_obj_color.py b/mycobot_ai/ai_mycobot_280/scripts/combine_detect_obj_color.py index d16dc18..b11e25c 100755 --- a/mycobot_ai/ai_mycobot_280/scripts/combine_detect_obj_color.py +++ b/mycobot_ai/ai_mycobot_280/scripts/combine_detect_obj_color.py @@ -19,7 +19,7 @@ __version__ = "1.0" class Object_detect(Movement): - def __init__(self, camera_x = 160, camera_y = -10): + def __init__(self, camera_x = 160, camera_y = -5): # inherit the parent class super(Object_detect, self).__init__() # get path of file @@ -162,7 +162,7 @@ class Object_detect(Movement): # self.mc.send_coords([x, y, 150, 179.87, -3.78, -62.75], 25, 0) # time.sleep(3) - self.mc.send_coords([x, y, 105, 179.87, -3.78, -62.75], 10, 0) + self.mc.send_coords([x, y, 105, 179.87, -3.78, -62.75], 25, 0) time.sleep(3) # open pump @@ -197,7 +197,8 @@ class Object_detect(Movement): self.pump_off() elif "dev" in self.robot_raspi or "dev" in self.robot_jes: self.gpio_status(False) - time.sleep(6) + time.sleep(4) + if color == 1: self.pub_marker( self.move_coords[color][0]/1000.0+0.04, self.move_coords[color][1]/1000.0-0.02) diff --git a/mycobot_ai/ai_mycobot_280/scripts/combine_detect_obj_img_folder_opt.py b/mycobot_ai/ai_mycobot_280/scripts/combine_detect_obj_img_folder_opt.py index bfd6025..ee5ca7d 100644 --- a/mycobot_ai/ai_mycobot_280/scripts/combine_detect_obj_img_folder_opt.py +++ b/mycobot_ai/ai_mycobot_280/scripts/combine_detect_obj_img_folder_opt.py @@ -179,7 +179,9 @@ class Object_detect(Movement): # self.mc.send_coords([x, y, 150, 179.87, -3.78, -62.75], 25, 0) # time.sleep(3) - self.mc.send_coords([x, y, 105, 179.87, -3.78, -62.75], 10, 0) + # self.mc.send_coords([x, y, 105, 179.87, -3.78, -62.75], 25, 0) + self.mc.send_coords([x, y, 60, 179.87, -3.78, -62.75], 25, 0) + time.sleep(3) # open pump @@ -199,21 +201,21 @@ class Object_detect(Movement): # print(tmp) self.mc.send_angles([tmp[0], -0.71, -54.49, -23.02, -0.79, tmp[5]],25) # [18.8, -7.91, -54.49, -23.02, -0.79, -14.76] - time.sleep(3) + time.sleep(5) self.mc.send_coords(self.move_coords[color], 25, 1) self.pub_marker(self.move_coords[color][0]/1000.0, self.move_coords[color] [1]/1000.0, self.move_coords[color][2]/1000.0) - time.sleep(3) + time.sleep(4) # close pump if "dev" in self.robot_m5 or "dev" in self.robot_wio: self.pump_off() elif "dev" in self.robot_raspi or "dev" in self.robot_jes: self.gpio_status(False) - time.sleep(6) + time.sleep(4) self.mc.send_angles(self.move_angles[0], 25) time.sleep(3) @@ -433,7 +435,7 @@ def parse_folder(folder): elif os.path.exists(path2): path = path2 - print("path:",path) + # print("path:",path) for i, j, k in os.walk(path): for l in k: diff --git a/mycobot_description/urdf/mycobot/mycobot_with_vision.urdf b/mycobot_description/urdf/mycobot/mycobot_with_vision.urdf index 816b554..6551fdf 100755 --- a/mycobot_description/urdf/mycobot/mycobot_with_vision.urdf +++ b/mycobot_description/urdf/mycobot/mycobot_with_vision.urdf @@ -6,7 +6,7 @@ - +