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

Bridge specific topic or except bridge topic with ros2 ros1_bridge

asked 2019-08-01 13:54:21 -0500

NEET gravatar image

updated 2019-08-02 06:20:02 -0500

Following the tutorial of ros1_bridge

I can bridge the ros1 topics to ros2 and worked very well.

And I want to use this feature to communicate between multi-robots through DDS

But there is a problem with bridging big_data like image_raw when I use --bridge-all-topics

It will cause the network traffic jams

Is it possible to bridge specific topic or just except some topics that I don't want it bridged to ros2?

Thank you

edit retag flag offensive close merge delete



Which bridge executable are you currently using? There are different ones for different use cases: dynamic_bridge, parameter_bridge, static_bridge, ...

Dirk Thomas gravatar image Dirk Thomas  ( 2019-08-01 14:06:45 -0500 )edit

@Dirk Thomas I use dynamic_bridge. I have no idea about other methods...

NEET gravatar image NEET  ( 2019-08-01 14:21:00 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-08-02 09:16:19 -0500

pavel92 gravatar image

If you dig into the ros1_bridge source code you will find the answer.
dynamic_bridge has the following available flags that are of interest in this case:

--bridge-all-topics: Bridge all topics in both directions, whether or not there is a matching subscriber.
--bridge-all-1to2-topics: Bridge all ROS 1 topics to ROS 2, whether or not there is a matching subscriber.
--bridge-all-2to1-topics: Bridge all ROS 2 topics to ROS 1, whether or not there is a matching subscriber.

Regarding your question for bridging specific topics you should look at the parameter_bridge:

bridge all topics listed in a ROS 1 parameter. The parameter needs to be an array and each item needs to be a dictionary with the following keys; 
topic: the name of the topic to bridge
type: the type of the topic to bridge
queue_size: the queue size to use (default: 100)

or static_bridge which gives an example implementation of bridging one topic.

edit flag offensive delete link more


Thank you for your reply. And yes, I found the solution after I review the source code of ros1_bridge. Now, I feel so sorry about I did not try to look into ros1_bridge. Thank you so much!

NEET gravatar image NEET  ( 2019-08-02 15:23:23 -0500 )edit

Question Tools



Asked: 2019-08-01 13:54:21 -0500

Seen: 2,522 times

Last updated: Aug 02 '19