getNamespace returns incorrect namespace
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.