ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Yes, that is perfectly fine.
2 | No.2 Revision |
Yes, that reusing your NodeHandle
instance is perfectly fine.fine in general.
In your specific example though, you are creating a NodeHandle
referencing the private namespace ("~") of the node, then start creating publishers and subscribers through it that publish and subscribe to topics that appear to be in the global namespace. I'm not sure, but that either won't work, or the node will try to find /topic_name
in its private namespace, and fail.