zenoh-plugin-ros2dds icon indicating copy to clipboard operation
zenoh-plugin-ros2dds copied to clipboard

[Bug] Unable to work with two bridges on different namespace

Open iamkashish opened this issue 1 year ago • 9 comments

Describe the bug

If I start one bridge with a namespace "/left" and then the other with namespace "/right", the topics from left to right or vice-versa are created. But the publisher get lost, meaning: ros2 topic echo /right/ doesn't show anything. But if I use one bridge with a namespace "/left" and then other with no namespace. It works fine. Maybe there is some silly mistake, but I tried various ways.

To reproduce

  1. Start zenoh-bridge-ros2dds --namespace left -e tcp/<left-ip-address>:7447 in one machine.
  2. Start zenoh-bridge-ros2dds --namespace right -e tcp/<right-ip-address>:7447 in another machine.
  3. Start ros2 run demo_nodes_cpp talker in left machine
  4. Do ros2 echo /left/chatter in right machine

System info

  • Platform Ubuntu 24.04

iamkashish avatar Oct 21 '24 21:10 iamkashish

Hi @iamkashish, can you please share the logs of the two bridges when setting RUST_LOG=z=debug as environment variable?

gabrik avatar Oct 22 '24 06:10 gabrik

Hi @gabrik , I did two testing, one with router mode and the logs are left_log and right_log. I saw there is some looping going on (but i have set local host and different domain ids). And when I publish the topic, I publish with cyclonedds config as suggested.

So I tried with peer mode with deny in config file, the config file of left machine will have "^/right.*" in deny and vice-versa. The logs are left_log_2 and right_log_2.

left_log.txt left_log_2.txt right_log.txt right_log_2.txt

iamkashish avatar Oct 22 '24 13:10 iamkashish

Hey @gabrik , I hope you are doing amazing. I'll glad if I can get some insights from you, whether I'm doing something wrong while deploying the bridge or is it really a bug?

iamkashish avatar Nov 04 '24 19:11 iamkashish

Hey @gabrik , I hope you are doing well. Looking forward to your reply.

iamkashish avatar Nov 18 '24 10:11 iamkashish

Hi @iamkashish I think the behavior can be expected. Now zenoh-bridge-ros2dds doesn't support two hosts having different namespaces communicate with each other. While you try ros2 echo /left/chatter on your right machine, the bridge is actually trying to subscribe /right/left/chatter in Zenoh network, which is not correct.

The only way to exchange the data now is to have both sides using same namespace or one side without namespace. This is the limitation for the current implementation.

I think your requirement is indeed useful, but we need to think of a better way for bridge to identify whether /left is the namespace instead of part of topic.

evshary avatar Nov 19 '24 10:11 evshary

Can we expect this feature anytime soon?

RishikesavanRamesh avatar Dec 30 '24 12:12 RishikesavanRamesh

Can we expect this feature anytime soon?

As far as I know, this will not happen in the near future. However, the priority might change if the community makes more requests.

evshary avatar Dec 31 '24 03:12 evshary

had the same problem, spent hours on it before finding this, i think this would be hella helpful, how come is not a default behavior to be able to have different entities with different namespaces ? how complex would it be to change this? maybe if you point me in the right direction i can take some time to contribute for this.

Hope this gets introduced soon, i was relying on the possibility to have different nodes have their namespace kinda like /drone/ namespace for each uav (each one on a separate network).

murph12F avatar Jan 06 '25 01:01 murph12F

I've been hoping for this feature too — ran into the same limitation while setting up multiple AMRs in a warehouse scenario. Each robot ideally operates in its own namespace like /amr1/, /amr2/, etc., on separate networks. It works fine for centralized coordination, but things get tricky when robots need to talk directly to nearby peers.

That peer-to-peer use case — like when one robot wants to hand off a task or share a local map with a neighbor — is still something that's missing with Zenoh in this setup. Without proper namespace isolation and bridging, it becomes a tangled mess of remapping and workarounds.

It would be amazing if this were a default or at least an optional behavior.

rahul-auraml avatar Apr 22 '25 01:04 rahul-auraml