Go to the documentation of this file.00001
00002
00003 from jsk_recognition_msgs.msg import ClusterPointIndices
00004 from jsk_recognition_msgs.msg import PolygonArray
00005 from pcl_msgs.msg import PointIndices
00006 import rospy
00007
00008
00009 def cb(msg):
00010 out_msg = ClusterPointIndices()
00011 out_msg.header = msg.header
00012 for _ in range(len(msg.polygons)):
00013 indices = PointIndices()
00014 out_msg.cluster_indices.append(indices)
00015 pub.publish(out_msg)
00016
00017
00018 if __name__ == '__main__':
00019 rospy.init_node('sample_cluster_indices_publisher_from_polygons')
00020 pub = rospy.Publisher('~output', ClusterPointIndices, queue_size=1)
00021 sub = rospy.Subscriber('~input', PolygonArray, cb, queue_size=1)
00022 rospy.spin()