36 import geometry_msgs.msg
39 if __name__ ==
'__main__':
40 rospy.init_node(
'dynamic_tf2_broadcaster')
42 t = geometry_msgs.msg.TransformStamped()
44 t.header.frame_id =
"turtle1" 45 t.child_frame_id =
"carrot1" 47 rate = rospy.Rate(10.0)
48 while not rospy.is_shutdown():
49 x = rospy.Time.now().to_sec() * math.pi
51 t.header.stamp = rospy.Time.now()
52 t.transform.translation.x = 10 * math.sin(x)
53 t.transform.translation.y = 10 * math.cos(x)
54 t.transform.translation.z = 0.0
55 t.transform.rotation.x = 0.0
56 t.transform.rotation.y = 0.0
57 t.transform.rotation.z = 0.0
58 t.transform.rotation.w = 1.0