-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Denying/allowing topics on the subscriber side does not work as expected #241
Comments
Something to add to my colleague's issue description: you may wonder why we are not simply using a single Zenoh bridge on the sub side. The reason is that we are employing Zenoh in a system where we want to dynamically launch and shutdown certain communication channels, so we're effectively launching one bridge per topic. |
Initially I thought that because you do not deny sub2 to publish "/pub", it will be republishing sub1_bridge "/pub", but this did not help, and pub_bridge shouldn't subscribe to it anyway creating a loop. However, wouldn't having two Zenoh bridges on the same ROS_DOMAIN_ID be incorrect usage of the bridge? The readme states:
Running zenoh-bridge-dds-sub1 and zenoh-bridge-dds-sub2 on ROS_DOMAIN_ID=2 seems to break the system, as expected? |
Thank you for pointing out that sentence from the README. This might be an unfortunate limitation of the zenoh-bridge-ros2dds for us. Using separate ROS_DOMAIN_IDs for both subscribers does not make sense in our use case, as we want them to both operate on the same ROS domain. Effectively, what we are trying to do is build a dynamic system. Let's say we have two hosts and are already bridging We come from using mqtt_client for this. We would simply launch another two Another option could be to reconfigure an existing bridge, e.g., via ROS 2 services. I have found #45, but this doesn't really help us directly, I guess. Shutting down the existing bridge and launching a new one is not really an option, because we would lose traffic in the transition. Any help is appreciated. :) |
From what I understand, if you were able to whitelist topics at runtime, this would be a satisfactory solution? A very weird idea to try this would be if you are able to have strange topic names.
Then if you create a topic called "/pub1/sub1/battery_state" it would be sent from p1 to s1. Maybe this is not a solution for you but an interesting thought. This would still require all bridges running on different DOMAIN_ID's. |
Not really sure I understand your idea. However, we definitely need to be on the same ROS_DOMAIN_ID everywhere, as Sub1 and Sub2 (and others) also need to directly talk to each other, without Zenoh. As I mentioned, we could achieve the same if we had the option to dynamically reconfigure |
Hi @lreiher,
This was a bug that is now fixed by #344.
The cause is a loop between the 2 bridges on domain 1:
A simple fix is to also deny the publishers on |
Hi @JEnoch, First: Your bug fix in #344. Denying/allowing topics now works as expected. Second: We have to explicitely allow only those topics that should actually be published/subscribed by the corresponding bridge. Otherwise, our subscribing bridges also act as publishers which leads to (in our case) undesired behavior. As a result of the second aspect, we need to explicitely add empty lists to the ...
allow: {
publishers: [],
subscribers: ["/pub"],
},
... In summary, both aspects were important to achieve our desired functionality! |
Yes, you are right. This is also explained here in the DEFAULT_CONFIG.json5. Thanks for clarification! To sum it up: This issue is solved with the following two modifications:
So, we can close this issue. |
Describe the bug
Denying and allowing topics via the configuration file does not work as expected for
zenoh-bridge-ros2dds
. In the minimal example setup below, even if explicitely denying a specific topic, it is nevertheless subscribed by the Zenoh bridge (and published as a ROS2 topic).To reproduce
To reproduce the bug, start the following minimal example via
docker compose up
.In the setup, we have a publishing ROS2 node (with a publishing Zenoh bridge) with
ROS_DOMAIN_ID=1
in a specific Docker networkrosnet-pub
that publishes a topic with 1 Hz. On the other hand, we have two subscribing Zenoh bridges both withROS_DOMAIN_ID=2
and both in Docker networkrosnet-sub
.One of the subscribing Zenoh bridges allows the topic
/pub
. The other subscribing Zenoh bridge denies this topic. Nevertheless, it seems that both of these subscribing Zenoh bridges are publishing the ROS2 topic/pub
which is not expected. What is observed:ros2 topic info /pub
shows that it is published by two ROS2 nodes.ros2 topic hz /pub
gives a frequency in the range of 2000 - 4000 Hz (and not 1 Hz).Expected outcome: Zenoh subscriber sub1 publishes the ROS2 topic
/pub
. Zenoh subscriber sub2 does not publish anything.Actual outcome: Both Zenoh subscribers publish the ROS2 topic
/pub
.Docker Compose File
docker-compose.yml:
Zenoh Config of publisher
zenoh_pub.json5:
Zenoh Config of subscriber no. 1:
zenoh_sub1.json5:
Zenoh Config of subscriber no. 2
zenoh_sub2.json5:
System info
The text was updated successfully, but these errors were encountered: