ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You can always make sure there exists another NodeHandle outside of your class, e.g. in the main function, which is initialized before you create the object and lives as long as you want the node to live. However, as @Wolf points out, I see no benefit in not rather storing a node handle as a (private) member of your class and avoid potential bugs of your class depending on the existance of an external node handle.