Repository navigation
Description
Since rmw_zenoh was released as a binary (pending the next Jazzy sync) we should be able to migrate to it. Incidentally this will also help cutting down compilation time since we don't need to vendor / build the bridge from source anymore.
We can update nexus_network_configuration to generate the json5 config files needed for zenoh configuration.
This ticket is to discuss what the architecture would look like. One possible architecture (but I'm in no way an rmw_zenoh expert!):
One router per workcell
Each workcell would have its own zenoh router, from what I understand this is pretty much necessary to allow nodes within a workcell to communicate with each other. If there was only one global router at the system orchestrator level they would need to connect to it to discover nodes.
Workcell sessions
Each workcell node will have a workcell specific session config file where it connects to the workcell's router. We will use the domainid to namespace the workcell topics. We probably (?) don't need to set up an ACL in the workcell nodes themselves.
Workcell ACL
The workcell routers will have an ACL to make sure that only liveliness tokens / pub / sub / services that are relevant to the system orchestrator are forwarded, while the rest is blocked. An alternative would be to implement the ACL on the sessions (or both?).
System orchestrator
The system orchestrator would be fairly similar to workcells, with its router and communication to local nodes. The only difference is that it will use wildcards to allow communication with all workcells regardless of their domain id.
CC @Yadunund for feedback / ideas on whether this is a viable architecture or what a better one would look like.
Activity
Yadunund commentedon Jan 9, 2025
Here's my recommendation which does not require any namespacing as that can get tricky.
ros_domain_idfor each and assign a port for thezenohdrouter. Eg.7447+ros_domain_id.luca-della-vedova commentedon Jan 16, 2025
A caveat I came upon during implementation, if we set the ACL to default to
denyhere (the same way we do in the currentnexus_network_configurationpipeline), topics will not be able to be discovered.I asked in the Zenoh discord and it seems we need to add an additional rule that allows the
ros2_lvADMIN_SPACE, (as per this conversation):aaronchongth commentedon Jan 16, 2025
Nice! Just started venturing down this path and glad that a solution has already been found. Yeah, can confirm that setting ACL with the
"@ros2_lv/**"key expression works like a charm.this seems to be the minimal ACL config required to listen to a topic, leaving it here for reference. (edit: saw that @luca-della-vedova posted a working config too, not too sure how specific we'd like to be to differential between pub, sub, server, client, action server, action client)
I'll try out services and actions, then start prototyping the changes required to
nexus_network_configurationwhen I canYadunund commentedon Jan 17, 2025
Sounds good! We can work with static files first and update
nexus_network_configurationlater since the existing tests rely on static config files anyways.aaronchongth commentedon Mar 12, 2025
I've started prototyping here, #76, and ran into some issues and concerns.
In the event where we launch everything with the same domain ID, and rely on ACL, important messages like
/tfand/tf_staticget crossed between workcells and stuff starts to break. Since we are "simulating" multiple workcells locally, I'm guessing we should still handle the separation withROS_DOMAIN_ID.Keeping each workcell on separate domain IDs (like we are doing now already), will however separate the workcell registration service and workcell task request action. I've so far not found support for bridging between 2 different domain IDs in
rmw_zenoh, other than usingzenoh_bridge_ros2ddslike what we are already using.The one thing I've not tried, is to use the same domain ID for everything, and for the peers under each workcell, use multicast for scouting instead of gossip, and give them dedicated ports as well. So in theory, the sessions from different workcells should ignore each other.
Curious to hear if I'm missing something obvious!
Yadunund commentedon Jul 28, 2025
With Zenoh 1.4 and the latest
rmw_zenoh(eg 0.2.5 binary version on Jazzy), routers can attach and strip namespaces on the fly. See example config.Each workcell (and system orchestrator) can start it's own Zenoh router and have nodes for that workcell connect only to this router.
We can connect different routers while apply ACLs to ensure only topics we care about are bridged. The outgoing keyexpressions from workcells can have a namespace applied. The system orchestrator router can strip this namespace.
Should we try this out?
aaronchongth commentedon Jul 28, 2025
I tried it out the namespacing a while ago for other projects, but not on this multi-router setup, not sure if things have changed. From what I remember the namespace is applied on the whole zenoh key expression, and not the ROS 2 topic itself, and therefore for a connecting router to translate that key expression back into a ROS 2 topic, the connecting router will also need to have the same namespace applied, before the key expression->topic demangling can happen.
So if we have a few workcells with their namespaced routers connected to the system orchestrator's router, for example
/chatter/workcell_n/*/chatter/*/**/chatter/*, which will accept all the namespaced key expressionsHowever I believe there might be no way to translate the namespaced key expressions into namespaced ROS 2 topics/services/actions, unless we work directly with Zenoh pub/sub/get/queryable, and move the namespaces
For more specific topics like
/tfand/tf_static, we'd want to strip namespace but not namespace ROS 2 topics. So different behaviors will need to be accommodated.I haven't tried it out yet to verify this limitation, but just in case I missed something, is there a way around this?
Yadunund commentedon Jul 29, 2025
Summarizing what we discussed earlier,
/sonexus/nexus_demos/config/zenoh/nexus_network_config.yaml
Lines 38 to 40 in 4446069
Haven't tried it myself.
In addition we can
nexus_network_configurationpackage together with the zenoh_bridge_dds_vendor.