From ff287d9e2c32a03c0b43b485450b8dfa5a26d764 Mon Sep 17 00:00:00 2001 From: Max Hunt Date: Thu, 13 Feb 2020 14:26:33 +0000 Subject: [PATCH] Update --- main.py | 4 ++-- object_tf_client.py | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index 41b8be9..5b41f38 100755 --- a/main.py +++ b/main.py @@ -256,8 +256,8 @@ if __name__ == "__main__": load_objects() - # print("loaded all objects, starting tf service thread") - # tf_service(init=True) + print("loaded all objects, starting tf service thread") + tf_service(init=True) ###################################HACKING BEGIN # for i in range(0, 5): diff --git a/object_tf_client.py b/object_tf_client.py index cfe0bfe..9a330ec 100755 --- a/object_tf_client.py +++ b/object_tf_client.py @@ -10,13 +10,13 @@ def tf_lookup(object_name): listener = tf.TransformListener() while not rospy.is_shutdown() and do_try: - # try: - (trans,rot) = listener.lookupTransform('base', object_name, rospy.Time(0)) - # do_try = False - # except (tf.LookupException, tf.ConnectivityException, tf.ExtrapolationException): - # print('Failed to get frame data, retrying...') - # time.sleep(0.1) - # continue + try: + (trans,rot) = listener.lookupTransform('base', object_name, rospy.Time(0)) + do_try = False + except (tf.LookupException, tf.ConnectivityException, tf.ExtrapolationException): + print('Failed to get frame data, retrying...') + time.sleep(0.1) + continue object_angles = tf.transformations.euler_from_quaternion([rot[3] , rot[0], rot[1], rot[2]], axes='sxyz') xangle = object_angles[0] + radians(196)