getNamespace returns incorrect namespace

asked 2018-10-18 16:55:58 -0600

debonair gravatar image

updated 2018-10-19 12:50:13 -0600

whenever I call, ros::this_node::getNamespace() it always returns with double slash everywhere.

I have ros::NodeHandle as a member of a class. Then I am creating object of that class inside one static function. Now main() is calling this static function. I ros::Init() inside my main. When I try to query nodehandle.getNameSpace() inside constructor of that class. it returns namespace with extra slash. If I launch node using ns="temp"it returns "//temp". If I pass nodehandle from main() to constructor of that class and use that node handle, then it returns "/temp" which is expected. This is puzzling to me. I am not using private handle here.

edit retag flag offensive close merge delete