def init_transforms(self):
""" Initialize the tf2 transforms """
rospy.loginfo("Start transform calibration.")
self.tf_buffer = tf2_ros.Buffer(rospy.Duration(300.0))
self.tf_listener = tf2_ros.TransformListener(self.tf_buffer)
while True:
try:
now = rospy.get_rostime()
self.tf_buffer.lookup_transform('head',
'left_camera_optical_frame',
now - rospy.Duration(0.1))
except:
self.rate.sleep()
continue
break
rospy.loginfo('transform calibration finished.')
评论列表
文章目录