Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 import rospy
00019 from tf.msg import tfMessage
00020
00021
00022 def main():
00023 rospy.init_node('tf_remove_frames')
00024 publisher = rospy.Publisher('/tf_out', tfMessage, queue_size=1)
00025 remove_frames = rospy.get_param('~remove_frames', [])
00026
00027 def callback(msg):
00028 msg.transforms = [
00029 t for t in msg.transforms
00030 if t.header.frame_id.lstrip('/') not in remove_frames and
00031 t.child_frame_id.lstrip('/') not in remove_frames
00032 ]
00033 publisher.publish(msg)
00034
00035 rospy.Subscriber('/tf_in', tfMessage, callback)
00036 rospy.spin()
00037
00038
00039 if __name__ == '__main__':
00040 main()