Skip to content

Instantly share code, notes, and snippets.

@kor01
Last active June 24, 2017 00:58
Show Gist options
  • Save kor01/16f0cb70f4a7a7cf7cfde5c6d8a9c6b6 to your computer and use it in GitHub Desktop.
Save kor01/16f0cb70f4a7a7cf7cfde5c6d8a9c6b6 to your computer and use it in GitHub Desktop.
[tf_add_frame] add a new frame #tf #ros
#!/usr/bin/env python
import roslib
roslib.load_manifest('learning_tf')
import rospy
import tf
if __name__ == '__main__':
rospy.init_node('my_tf_broadcaster')
br = tf.TransformBroadcaster()
rate = rospy.Rate(10.0)
while not rospy.is_shutdown():
t = rospy.Time.now().to_sec() * math.pi
br.sendTransform((2.0 * math.sin(t), 2.0 * math.cos(t), 0.0),
(0.0, 0.0, 0.0, 1.0),
rospy.Time.now(),
"carrot1",
"turtle1")
rate.sleep()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment