Skip to content

Instantly share code, notes, and snippets.

@thomasweng15
Last active July 26, 2017 02:20
Show Gist options
  • Save thomasweng15/f527b4465b78ecba53947cdf4dcc7381 to your computer and use it in GitHub Desktop.
Save thomasweng15/f527b4465b78ecba53947cdf4dcc7381 to your computer and use it in GitHub Desktop.
Get transform through transformlistener
#!/usr/bin/env python
import rospy
import tf
if __name__ == '__main__':
rospy.init_node("person_tf_broadcaster")
br = tf.TransformBroadcaster()
rate = rospy.Rate(10)
while not rospy.is_shutdown():
origin = rospy.get_param("/person/origin")
quat = rospy.get_param("/person/quaternion")
br.sendTransform(
(origin['x'], origin['y'], origin['z']),
(quat['x'], quat['y'], quat['z'], quat['w']),
rospy.Time().now(),
"person",
"base_link")
rate.sleep()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment