Go to the documentation of this file.00001 import roslib; roslib.load_manifest('hai_sandbox')
00002 import rospy
00003 import message_filters
00004 from sensor_msgs.msg import Image
00005 from sensor_msgs.msg import PointCloud2
00006 import feature_extractor_fpfh.msg as fmsg
00007 import pdb
00008
00009
00010 def callback(image, fpfh_hist):
00011 print "got messages!"
00012
00013 print image.header.stamp.to_sec(), fpfh_hist.header.stamp.to_sec()
00014
00015 def fpfh_cb(fpfh):
00016
00017 print '>>', fpfh.header.stamp.to_sec()
00018
00019
00020 def image_cb(image):
00021
00022 print image.header.stamp.to_sec()
00023
00024 rospy.init_node('kinect_features')
00025 image_sub = message_filters.Subscriber('/camera/rgb/image_color', Image)
00026 fpfh_hist_sub = message_filters.Subscriber('fpfh_hist', fmsg.FPFHHist)
00027 depth_sub = message_filters.Subscriber('/camera/depth/points2', PointCloud2)
00028
00029
00030 ts = message_filters.TimeSynchronizer([image_sub, depth_sub], 10)
00031 ts.registerCallback(callback)
00032
00033
00034 print 'reading and spinning!'
00035 rospy.spin()
00036