Synchronizing 2 topics and adding a third topic
I managed to synchronize the depth and the color data of a Kinect sensor using the Approximate Time Synchronizer. Now I would like to add a new topic from another sensor (microphone- using pocketsphinx) to the callback
from std_msgs.msg import String
self.speech_sub = rospy.Subscriber("/recognizer/output", String)
How do I do that?
class image_converter:
def __init__(self):
print 'show window'
cv2.namedWindow("Image window", 1)
print 'start bridge and subscribe'
self.bridge = CvBridge()
self.depth_sub = message_filters.Subscriber("/camera/depth_registered/image_raw",Image)
self.image_sub = message_filters.Subscriber("/camera/rgb/image_color",Image)
self.speech_sub = rospy.Subscriber("/recognizer/output", String)
ts=message_filters.ApproximateTimeSynchronizer([self.image_sub, self.depth_sub], 1,1)
ts.registerCallback(self.callback_new)
def callback_new(self,color):
......
Asked by pnambiar on 2015-08-25 10:12:36 UTC
Answers
Hi Pnambiar I am trying to do something similar. but it seems that the callback function is not called. have you manage to sort it out? Regards Ali
Asked by Yacoub on 2015-12-16 05:11:01 UTC
Comments