Accessing node namespace in code assigned by roslaunch
Hello everyone,
I have the following problem. I am running a node from a launch file based on a group ns.
<launch>
<group ns = "transferunit_1">
<node name="transferunit1_hardware", pkg="transferunit_hardware"/>
</group>
</launch>
This makes the node correctly be started in the namespace. /transferunit_1/transferunit_hardware
In the .cpp file of the node I'am currently doing the following:
ros::init(argc, argv, "transferunit_hardware");
std::string ns = ros::thisnode::getNamespace();
However, ns is just empty "/" ....
How can I access the namespace that has been assigned during roslaunch?