This commit is contained in:
Max Hunt 2020-02-13 14:26:33 +00:00
parent 06cc778e3c
commit ff287d9e2c
2 changed files with 9 additions and 9 deletions

View File

@ -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):

View File

@ -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)