Hi all, Is there any way to make one general callback in c++ that can be executed for every subscriber? I mean every callback needs type of the message but I want one callback that should be generally and dynamically executable for all subscriber. I can do this in python but need to do in c++. Has someone done this? Thanks in advance, regards, safdar
Originally posted by safzam on ROS Answers with karma: 111 on 2011-09-20
Post score: 1
Original comments
Comment by safzam on 2011-09-20:
I mean , for example I have two different nodes publishing one publishes int type message on toip1 and other publishes on topic2. Now I need to make certainly two subscriber s1 for topic1 and s2 for topic2. But I want to have one callback for both of these s1 and s2. Is it possible in C++?
regards
Comment by tfoote on 2011-09-20:
Can you be a little clearer about what you mean by a generally and dynamically executable callback? The roscpp implementation is designed to take advantage of C++ types and requires you to know the type of the function to call back. Maybe your use case or what you are doing in python would help.