Ask Your Question
1

In what sense are nodehandles called "private_nh" private?

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

erwhelewoli gravatar image

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

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
4

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

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 imageerwhelewoli ( 2016-04-08 12:05:35 -0600 )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 imagegvdhoorn ( 2016-04-08 12:23:12 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 2,641 times

Last updated: Apr 10 '16