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

multiple topics subscribers with single callback

asked 2015-08-07 08:16:15 -0500

rosdino gravatar image

updated 2015-08-07 08:16:46 -0500

Hello everyone,

How to create subscribers to multiple topics with single callback in cpp?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2015-08-11 01:32:50 -0500

Willson Amalraj gravatar image

You can look into message_filters package. This package filters messages from more than one subscribed topics and passes it to a single call back. All the subscribed topics need to have a time_stamp, for this to work.

edit flag offensive delete link more

Comments

Hi, just have a doubt, does it work with rosserial arduino subscribers?

rosdino gravatar image rosdino  ( 2015-08-11 09:03:30 -0500 )edit

I may not be of help here. I do not use ROS on arduino.

Willson Amalraj gravatar image Willson Amalraj  ( 2015-09-08 04:20:37 -0500 )edit
0

answered 2015-08-07 10:21:57 -0500

NEngelhard gravatar image

I haven't tried to create several callbacks but you can remap the different topics to a single topic in the launch file and process them with a single subscriber.

edit flag offensive delete link more

Comments

Hi thanks for your answer. I am creating rosserial subscribers on Arduino. It works fine with several callbacks, but I am looking for single callback. Any example? Is it available in ros arduino documentation?

rosdino gravatar image rosdino  ( 2015-08-07 10:41:58 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-08-07 08:16:15 -0500

Seen: 2,876 times

Last updated: Aug 11 '15