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

Revision history [back]

click to hide/show revision 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);

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