Go to the documentation of this file.00001
00002 import rospy
00003 import tf
00004 from geometry_msgs.msg import PointStamped
00005
00006 def callback(point):
00007 global br
00008 global frame_id
00009 local_frame_id = point.header.frame_id
00010 if not local_frame_id:
00011 local_frame_id = frame_id
00012 br.sendTransform(
00013 (point.point.x, point.point.y, point.point.z),
00014 tf.transformations.quaternion_from_euler(0,0,0),
00015 point.header.stamp,
00016 local_frame_id,
00017 fixed_frame_id)
00018
00019 if __name__ == "__main__":
00020
00021 rospy.init_node("point_to_tf", anonymous=True)
00022
00023 frame_id = rospy.get_param('~frame_id', 'point')
00024 fixed_frame_id = rospy.get_param('~fixed_frame_id', 'world')
00025
00026 br = tf.TransformBroadcaster()
00027 rospy.Subscriber("point", PointStamped, callback, queue_size=1)
00028 rospy.spin()