kinect_fpfh.py
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   #print image.header.frame_id, fpfh_hist.header.frame_id
00013   print image.header.stamp.to_sec(), fpfh_hist.header.stamp.to_sec()
00014 
00015 def fpfh_cb(fpfh):
00016   #print fpfh.header.frame_id
00017   print '>>', fpfh.header.stamp.to_sec()
00018   #pdb.set_trace()
00019 
00020 def image_cb(image):
00021   #print "image", image.header.frame_id
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 #ts = message_filters.TimeSynchronizer([image_sub, fpfh_hist_sub], 10)
00030 ts = message_filters.TimeSynchronizer([image_sub, depth_sub], 10)
00031 ts.registerCallback(callback)
00032 #rospy.Subscriber('fpfh_hist', fmsg.FPFHHist, fpfh_cb)
00033 #rospy.Subscriber('/camera/rgb/image_color', Image, image_cb)
00034 print 'reading and spinning!'
00035 rospy.spin()
00036 


hai_sandbox
Author(s): Hai Nguyen
autogenerated on Wed Nov 27 2013 11:46:56