Update
This commit is contained in:
parent
7ce4112146
commit
d7a9e5e087
@ -10,7 +10,7 @@ def tf_lookup(object_name):
|
|||||||
|
|
||||||
while not rospy.is_shutdown() and do_try:
|
while not rospy.is_shutdown() and do_try:
|
||||||
try:
|
try:
|
||||||
(trans,rot) = listener.lookupTransform('c1', 'base', rospy.Time(0))
|
(trans,rot) = listener.lookupTransform(object_name, 'base', rospy.Time(0))
|
||||||
do_try = False
|
do_try = False
|
||||||
except (tf.LookupException, tf.ConnectivityException, tf.ExtrapolationException):
|
except (tf.LookupException, tf.ConnectivityException, tf.ExtrapolationException):
|
||||||
print('Failed to get frame data, retrying...')
|
print('Failed to get frame data, retrying...')
|
||||||
@ -25,4 +25,7 @@ def tf_lookup(object_name):
|
|||||||
target_pose.orientation.y = rot[1]
|
target_pose.orientation.y = rot[1]
|
||||||
target_pose.orientation.z = rot[2]
|
target_pose.orientation.z = rot[2]
|
||||||
target_pose.orientation.w = rot[3]
|
target_pose.orientation.w = rot[3]
|
||||||
return target_pose
|
return target_pose
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
tf_lookup('c1')
|
||||||
Loading…
Reference in New Issue
Block a user