sample_cluster_indices_publisher_from_polygons.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 from jsk_recognition_msgs.msg import ClusterPointIndices
4 from jsk_recognition_msgs.msg import PolygonArray
5 from pcl_msgs.msg import PointIndices
6 import rospy
7 
8 
9 def cb(msg):
10  out_msg = ClusterPointIndices()
11  out_msg.header = msg.header
12  for _ in range(len(msg.polygons)):
13  indices = PointIndices()
14  out_msg.cluster_indices.append(indices)
15  pub.publish(out_msg)
16 
17 
18 if __name__ == '__main__':
19  rospy.init_node('sample_cluster_indices_publisher_from_polygons')
20  pub = rospy.Publisher('~output', ClusterPointIndices, queue_size=1)
21  sub = rospy.Subscriber('~input', PolygonArray, cb, queue_size=1)
22  rospy.spin()


jsk_pcl_ros_utils
Author(s): Yohei Kakiuchi
autogenerated on Mon May 3 2021 03:03:15