ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

If something needs to subscribe to the control topic, if it is in the same namespace as the robot node then subscribing to control will automatically find the /robot_1/control topic. Subscribing to /control will not automatically find the one you want. More can be read here.

Also note that if for some reason you need to get the namespace of a particular node from within that node you can do this in both rospy and roscpp using

std::string ns = ros::this_node::getNamespace();

and

ns = rospy.get_namespace()

If something needs to subscribe to the control topic, if it is in the same namespace as the robot node then subscribing to control will automatically find the /robot_1/control topic. Subscribing to /control will not automatically find the one you want. More can be read here.

Also note that if for some reason you need to get the namespace of a particular node from within that node you can do this in both rospyroscpp and roscpprospy using

std::string ns = ros::this_node::getNamespace();

and

ns = rospy.get_namespace()