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

In what sense are nodehandles called "private_nh" private?

asked 2016-04-08 08:49:57 -0500

erwhelewoli gravatar image

updated 2016-04-10 13:28:36 -0500

gvdhoorn gravatar image

In some of the source files in the navigation stack, there are classes that uses multiple nodehandles, that are usually called nh and private_nh. They are of the same type ros::NodeHandle, so in what sense are the handle called private_nh private?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
8

answered 2016-04-08 09:56:30 -0500

gvdhoorn gravatar image

They are initialised such that they will resolve names in the private namespace of the Node. See wiki/roscpp/Overview/NodeHandles and wiki/Names.

edit flag offensive delete link more

Comments

From http://wiki.ros.org/Names : "In general, resources can create resources within their namespace and they can access resources within or above their own namespace"

Does this mean that it is impossible for another node to subscribe to any topic being published using the private nodehandle?

erwhelewoli gravatar image erwhelewoli  ( 2016-04-08 12:05:35 -0500 )edit

No, it's not impossible, but as 'searching' for resources is from child->parent, you'll need to provide the fully qualified name to reach something in a private namespace that is not your own.

gvdhoorn gravatar image gvdhoorn  ( 2016-04-08 12:23:12 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2016-04-08 08:49:57 -0500

Seen: 7,370 times

Last updated: Apr 10 '16