From c0a2a5d7f440fa4d965b365f39f6131a495d9301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=AB=8B=E5=86=9B?= Date: Mon, 7 Jun 2021 10:17:07 +0800 Subject: [PATCH] rename and improve. --- ...ces.launch => mycobot_detect_marker_with_topic.launch} | 0 scripts/detect_marker.py | 2 +- scripts/follow_and_pump.py | 8 +++++--- 3 files changed, 6 insertions(+), 4 deletions(-) rename launch/{mycobot_detect_marker_with_services.launch => mycobot_detect_marker_with_topic.launch} (100%) diff --git a/launch/mycobot_detect_marker_with_services.launch b/launch/mycobot_detect_marker_with_topic.launch similarity index 100% rename from launch/mycobot_detect_marker_with_services.launch rename to launch/mycobot_detect_marker_with_topic.launch diff --git a/scripts/detect_marker.py b/scripts/detect_marker.py index 384ef77..d6734fe 100755 --- a/scripts/detect_marker.py +++ b/scripts/detect_marker.py @@ -69,7 +69,7 @@ class ImageConverter: # Just process first one detected. xyz = tvec[0, 0, :] - xyz = [xyz[0] - 0.045, xyz[1], xyz[2] - 0.01] + xyz = [xyz[0] - 0.045, xyz[1], xyz[2] -0.03] euler = rvec[0, 0, :] tf_change = tf.transformations.quaternion_from_euler(euler[0], euler[1], euler[2]) diff --git a/scripts/follow_and_pump.py b/scripts/follow_and_pump.py index c043f8e..b2fc2dd 100755 --- a/scripts/follow_and_pump.py +++ b/scripts/follow_and_pump.py @@ -18,7 +18,7 @@ pump = MycobotPumpStatus() x_offset = -20 y_offset = 20 -z_offset = 120 +z_offset = 110 flag = False @@ -98,7 +98,7 @@ def grippercallback(data): time.sleep(2.5) # down - for i in range(1,14): + for i in range(1,17): pub_coords(x, y, z - i * 5,rx=-160, sp=10) time.sleep(.1) @@ -117,12 +117,14 @@ def grippercallback(data): pub_coords(39.4, -174.7, put_z ,-177.13, -4.13, -152.59,70,2) time.sleep(1.5) - for i in range (1,7): + for i in range (1,8): pub_coords(39.4, -174.7, put_z-i*5, -177.13, -4.13, -152.59,15,2) time.sleep(.1) pub_pump(False) + time.sleep(.5) + pub_angles(0, 30, -50, -40, 0, 0, 50) time.sleep(1.5)