8000 Allow passing existing node to IntrospectionServer to avoid duplicate node name by miguelprada · Pull Request #130 · ros/executive_smach · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow passing existing node to IntrospectionServer to avoid duplicate node name #130

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

Open
wants to merge 2 commits into
base: ros2
Choose a base branch
from

Conversation

miguelprada
Copy link

IntrospectionServer inheriting from Node is problematic when instancing it in a Python executable containing another node instance, which is likely the most common use case. In particular, the problem commonly arises when starting such executable from a launch file. In that case, the CLI arguments used by the launch system to set the node name will end up affecting both the nodes, resulting in duplicate nodes with the same name.

This MR proposes a possible fix by allowing to optionally pass an existing node instance to the IntrospectionServer class constructor.

Now server_name and the optional node i 8000 n the constructor are somewhat redundant. I would've rather removed server_name altogether but it would break backward compatibility. Assuming the current situation quite broken as it is you may consider it fine to do so and I'll be happy to change it if you want.

@miguelprada
Copy link
Author

Upon closer inspection of our own use-case, decided to restore some of the original behavior of using the server_name string to define the base name of the topics created by IntrospectionServer. This allows having more than one instance of the class in a single executable if more than one state machine needs to be run.

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.

1 participant
0