37 import geometry_msgs.msg
43 self.
pub_tf = rospy.Publisher(
"/tf", tf.msg.tfMessage, queue_size=1)
45 while not rospy.is_shutdown():
49 t = geometry_msgs.msg.TransformStamped()
50 t.header.frame_id =
"turtle1" 51 t.header.stamp = rospy.Time.now()
52 t.child_frame_id =
"carrot1" 53 t.transform.translation.x = 0.0
54 t.transform.translation.y = 2.0
55 t.transform.translation.z = 0.0
57 t.transform.rotation.x = 0.0
58 t.transform.rotation.y = 0.0
59 t.transform.rotation.z = 0.0
60 t.transform.rotation.w = 1.0
62 tfm = tf.msg.tfMessage([t])
63 self.pub_tf.publish(tfm)
65 if __name__ ==
'__main__':
66 rospy.init_node(
'fixed_tf_broadcaster')