sample_int_publisher_from_cluster_indices.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 import time
4 
5 from jsk_recognition_msgs.msg import ClusterPointIndices
6 from jsk_recognition_msgs.msg import Int32Stamped
7 import rospy
8 
9 
10 def cb(msg):
11  out_msg = Int32Stamped()
12  out_msg.header = msg.header
13  out_msg.data = int(time.time() % len(msg.cluster_indices))
14  pub.publish(out_msg)
15 
16 
17 if __name__ == '__main__':
18  rospy.init_node('sample_int_publisher_from_cluster_indices')
19  pub = rospy.Publisher('~output', Int32Stamped, queue_size=1)
20  sub = rospy.Subscriber('~input', ClusterPointIndices, cb, queue_size=1)
21  rospy.spin()


jsk_pcl_ros
Author(s): Yohei Kakiuchi
autogenerated on Mon May 3 2021 03:03:47