-
Notifications
You must be signed in to change notification settings - Fork 42
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
Handle duplicate node names by including zenoh session id in liveliness tokens #87
Conversation
Signed-off-by: Yadunund <[email protected]>
Signed-off-by: Yadunund <[email protected]>
Signed-off-by: Yadunund <[email protected]>
Signed-off-by: Yadunund <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left two minor things to fix, this otherwise looks good to me.
@@ -83,6 +83,18 @@ static const std::unordered_map<std::string, EntityType> str_to_entity = { | |||
{CLI_STR, EntityType::Client} | |||
}; | |||
|
|||
std::string convert(z_id_t id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about:
std::string convert(z_id_t id) | |
std::string zid_to_str(z_id_t id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 6d3acd3
Co-authored-by: Chris Lalancette <[email protected]> Signed-off-by: Yadu <[email protected]>
Signed-off-by: Yadunund <[email protected]>
…ss tokens (#87) * Include zenoh session id in liveliness tokens * Switch to multimap for NodeMap Signed-off-by: Yadunund <[email protected]> Co-authored-by: Chris Lalancette <[email protected]>
This PR addresses #84.
It so does so by including the zenoh session id in the liveliness token.
The token is updated to:
<ADMIN_SPACE>/<domainid>/<id>/<entity>/<namespace>/<nodename>
where<id>
is meant to be a unique ID to identify this entity. However, until the zenoh API exposes the globally unique IDs for each participant/entity, this id is currently set to the zenoh session's id with elements concatenated into a string using '.' as separator.The
NodeMap
data structure is updated to anstd::multimap
to allow storing multiple nodes with the same name in the same namespace. Codebase is updated accoridngly.Now after running two instances of
/talker
, running the commandros2 node list
should correctly list two separate/talker
nodes.Note: Make sure to kill all ros2 nodes and daemons before trying this.