point_to_tf.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 import rospy
3 import tf
4 from geometry_msgs.msg import PointStamped
5 
6 def callback(point):
7  global br
8  global frame_id
9  local_frame_id = point.header.frame_id
10  if not local_frame_id:
11  local_frame_id = frame_id
12  br.sendTransform(
13  (point.point.x, point.point.y, point.point.z),
14  tf.transformations.quaternion_from_euler(0,0,0),
15  point.header.stamp,
16  local_frame_id,
17  fixed_frame_id)
18 
19 if __name__ == "__main__":
20 
21  rospy.init_node("point_to_tf", anonymous=True)
22 
23  frame_id = rospy.get_param('~frame_id', 'point')
24  fixed_frame_id = rospy.get_param('~fixed_frame_id', 'world')
25 
27  rospy.Subscriber("point", PointStamped, callback, queue_size=1)
28  rospy.spin()


rtabmap_ros
Author(s): Mathieu Labbe
autogenerated on Fri Jun 7 2019 21:55:04