2 import roslib; roslib.load_manifest(
'dynamic_tf_publisher')
10 def set_tf(pos, q, parent, child, freq):
11 rospy.wait_for_service(
'/set_dynamic_tf')
13 client = rospy.ServiceProxy(
'/set_dynamic_tf', SetDynamicTF)
14 pose = TransformStamped()
15 pose.header.frame_id = pa
16 pose.child_frame_id = ch
17 pose.transform.translation = Vector3(*pos)
18 pose.transform.rotation = Quaternion(*q)
20 res = client(freq, pose)
22 except rospy.ServiceException, e:
23 print "Service call failed: %s"%e
32 if __name__ ==
"__main__":
34 pos = map(float,sys.argv[1:4])
36 q = map(float,sys.argv[4:8])
39 rpy = map(float,sys.argv[4:7])
41 q = tf.transformations.quaternion_from_euler(*rpy, axes=
"rzyx")
46 hz = 1000.0 / float(rest[2])
50 print "args: x y z (r p y)|(x y z w) parent child msec" def set_tf(pos, q, parent, child, freq)