ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You should use a nodehandle with a relative namespace instead.
The node's namespace includes the full path of the node, including the root. However, your nodehandle is probably the default, which is relative to the node. In this case, it's /
. Creating a new nodehandle with the node's private namespace, ~
should fix your error.
Try this:
ros::NodeHandle private_n("~");
ros::Subscriber sub = private_n.subscribe("attitude", queue_size, callbackAngularVelocities);
2 | No.2 Revision |
You should use a nodehandle with a relative namespace instead.
The node's namespace includes the full path of the node, including the root. However, your nodehandle is probably the default, which is relative to the node. In this case, it's /
. Creating a new nodehandle with the node's private namespace, ~
should fix your error.
Try this:
ros::NodeHandle private_n("~");
ros::Subscriber sub = private_n.subscribe("attitude", queue_size, callbackAngularVelocities);
EDIT for further reading:
http://wiki.ros.org/roscpp/Overview/NodeHandles
http://wiki.ros.org/Names