ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
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()
2 | No.2 Revision |
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
and rospyroscpp
usingroscpprospy
std::string ns = ros::this_node::getNamespace();
and
ns = rospy.get_namespace()