sample_int_publisher_from_cluster_indices.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 import time
00004 
00005 from jsk_recognition_msgs.msg import ClusterPointIndices
00006 from jsk_recognition_msgs.msg import Int32Stamped
00007 import rospy
00008 
00009 
00010 def cb(msg):
00011     out_msg = Int32Stamped()
00012     out_msg.header = msg.header
00013     out_msg.data = int(time.time() % len(msg.cluster_indices))
00014     pub.publish(out_msg)
00015 
00016 
00017 if __name__ == '__main__':
00018     rospy.init_node('sample_int_publisher_from_cluster_indices')
00019     pub = rospy.Publisher('~output', Int32Stamped, queue_size=1)
00020     sub = rospy.Subscriber('~input', ClusterPointIndices, cb, queue_size=1)
00021     rospy.spin()


jsk_pcl_ros
Author(s): Yohei Kakiuchi
autogenerated on Tue Jul 2 2019 19:41:45