Skip to content
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

Fix hardcoded services names in ROSAPI #992

Open
wants to merge 1 commit into
base: ros2
Choose a base branch
from

Conversation

FlorianLebecque
Copy link
Contributor

@FlorianLebecque FlorianLebecque commented Jan 14, 2025

Public API Changes
services name now have the namespace and node name as a prefix. If no namespace is defined, no change happens to the services

/rosapi/subscribers -> /namespace/nodename/subscribers
/rosapi/topic_type  -> /namespace/nodename/topic_type
/rosapi/topics      -> /namespace/nodename/topics

Description
Add missing namespace support for services in rosapi. Allowing more than one node running on the same network. This makes it easier to work with multi robot environment.

@bjsowa
Copy link
Collaborator

bjsowa commented Jan 14, 2025

Wouldn't it basically work the same if we just used topics in a private namespace? (e.g. ~/topics or ~/interfaces)

@FlorianLebecque
Copy link
Contributor Author

The services also need to be in a namespaces as we would have services collision if we run multiple node of rosapi

@bjsowa
Copy link
Collaborator

bjsowa commented Jan 14, 2025

The services also need to be in a namespaces as we would have services collision if we run multiple node of rosapi

IIRC putting the name of the service in private namespace should prepend the node's name as well as it namespace. For example, ~/subscribers should resolve to /namespace/rosapi/subscribers.

@FlorianLebecque
Copy link
Contributor Author

FlorianLebecque commented Jan 14, 2025

I've changed the modification, the rosapi services names were hardcoded. Now it should take into account the node name and namespace

@FlorianLebecque FlorianLebecque changed the title Add namespace to services names Fix hardcoded services names in ROSAPI Jan 14, 2025
@bjsowa
Copy link
Collaborator

bjsowa commented Jan 14, 2025

@FlorianLebecque This is not what I meant, just add ~ (tilde) character before topic name. For example, replace full_name + "/topics" with ~/topics. Tilde is a special character that will be resolved by client libraries to node's private namespace.

@FlorianLebecque
Copy link
Contributor Author

Ok, yeah, I misunderstood. It should be ok now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants