Ask Your Question

Revision history [back]

You should try two unique subscribers within a single node. You would end up with image_transport::Subscriber sub_image and image_transport::Subscriber sub_depth. Then use it.subscribe on each one with a different topic/callback for each. One subscriber per topic in ROS. The way that your example code is now (plus the fix for spelling error) you will only ever get to the depth callback because you are reassigning the single subscriber. You will still need multiple subscribers in a single node if you want both sets of messages.