[ros-users] One node subscribes to multiple topics

Tully Foote tfoote at willowgarage.com
Wed Feb 9 23:02:25 UTC 2011


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


On Mon, Feb 7, 2011 at 12:20 PM, kadir <kadirfu at gmail.com> wrote:

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

Tully Foote
Systems Engineer
Willow Garage, Inc.
tfoote at willowgarage.com
(650) 475-2827
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20110209/f94bacfe/attachment-0004.html>

More information about the ros-users mailing list