From d9698bd4e4d2b774ebb21f26fed3077b3f18660e Mon Sep 17 00:00:00 2001 From: Max Hunt Date: Mon, 10 Feb 2020 20:35:09 +0000 Subject: [PATCH] Update --- listener.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/listener.py b/listener.py index d9848a7..d759548 100644 --- a/listener.py +++ b/listener.py @@ -11,12 +11,11 @@ if __name__ == '__main__': while not rospy.is_shutdown(): try: (trans,rot) = listener.lookupTransform('left_gripper', 'base', rospy.Time(0)) - print((trans, rot)) - # except (tf.LookupException, tf.ConnectivityException, tf.ExtrapolationException): - except: continue + except (tf.LookupException, tf.ConnectivityException, tf.ExtrapolationException): + continue - Translation = [trans.x , trans.y , trans.z] - Quaternion = [rot.x , rot.y , rot.z, rot.w] + Translation = [trans[0] , trans[1] , trans[2]] + Quaternion = [rot[0] , rot[1] , rot[2], rot[3]] Angles = tf.transformations.euler_from_quaternion([rot.x , rot.y , rot.z, rot.w]) print("Translation: ", Translation)