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):
......