Hi, <br><br>You can use boost::bind to add arguments to your callbacks such that you can know from which subscription a specific callback came.  For an example see the ros_tutorial on listener_with_userdata <a href="https://code.ros.org/trac/ros/browser/stacks/ros_tutorials/trunk/roscpp_tutorials/listener_with_userdata/listener_with_userdata.cpp">https://code.ros.org/trac/ros/browser/stacks/ros_tutorials/trunk/roscpp_tutorials/listener_with_userdata/listener_with_userdata.cpp</a><br>

<br>Tully<br><br><div class="gmail_quote">On Mon, Feb 7, 2011 at 12:20 PM, kadir <span dir="ltr"><<a href="mailto:kadirfu@gmail.com">kadirfu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
Hi folks,<br>
<br>
Let's say I have two nodes; one is publishing "n" different messages to "n"<br>
different topics and the other one subscribes to all of the topics. But I<br>
know that -more or less- the publisher node publishes new messages to the<br>
topics consecutively(I mean first to topic a, then to topic b, then c, and<br>
so on). All the messages being published have the same sequence_cnt.<br>
<br>
What I want from the listener node is that it polls these topics and read<br>
the new incoming message in each topic one by one to ensure that received<br>
messages have the same sequence_cnt to avoid checking each message if they<br>
have same seq_cnt, or synching them.<br>
<br>
Do you think it is necessary to create "n" number of callback functions to<br>
make the listener node grab updated data in an event-based fashion or is it<br>
better to use request-response based communication between these nodes? Does<br>
ROS services corresponds to a polling operation?<br>
<br>
I'm just wondering how would you approach in this case -of course it depends<br>
on the application, but any suggestions-?<br>
<font color="#888888">--<br>
View this message in context: <a href="http://ros-users.122217.n3.nabble.com/One-node-subscribes-to-multiple-topics-tp2446644p2446644.html" target="_blank">http://ros-users.122217.n3.nabble.com/One-node-subscribes-to-multiple-topics-tp2446644p2446644.html</a><br>


Sent from the ROS-Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Tully Foote<br>Systems Engineer<br>Willow Garage, Inc.<br><a href="mailto:tfoote@willowgarage.com">tfoote@willowgarage.com</a><br>(650) 475-2827<br>