ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Synchronizing 2 topics and adding a third topic

asked 2015-08-25 10:12:36 -0500

pnambiar gravatar image

updated 2015-08-25 10:14:38 -0500

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)

  def callback_new(self,color):
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-12-16 04:11:01 -0500

Yacoub gravatar image

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

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-08-25 10:12:36 -0500

Seen: 290 times

Last updated: Dec 16 '15