Is there a way to get a node's current namespace?
Say I launch a node like this
<launch>
<group ns="robot_1">
<node pkg="myrobot" type="robot" name="robot"/>
</group>
</launch>
then this node is really called /robot_1/robot
. Now what if it should publish something on a topic whose name depends on the namespace?
So in this case the topic may be /robot_1/control
.
Is there a way I can get my code to dynamically find this namespace?
Originally posted by Claudio on ROS Answers with karma: 859 on 2013-05-13
Post score: 6
Original comments
Comment by SL Remy on 2013-05-13:
Do you mean that you'd prefer to select that the node publishes in /robot_1/robot
instead of /robot
?