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

NodeHandle namespaces

asked 2018-10-02 10:59:13 -0500

dlae gravatar image

This is just an question about a very specific corner-case of the NodeHandle API, that is not covered by its documentation. I have no bug for you to solve or anything, I just need to know whether the scenario I'm describing in a second is possible, for my Master Thesis.

So, in this C++ code snippet

using namespace ros;
...
NodeHandle nh("outer_namespace/inner_namespace");

a NodeHandle is specifying a nested namespace in its constructor. Does outer_namespace have to exist before nh is constructed, or will it be created on the spot? In other words, can NodHandle define a hierarchy of namespaces, or should all but the rightmost namespace exist at creation time?

Basically, does NodeHandle nh("outer_namespace/inner_namespace"); behave like the UNIX command mkdir outer_namespace/inner_namespace or like mkdir -p outer_namespace/inner_namespace?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-10-02 11:26:08 -0500

gvdhoorn gravatar image

namespaces don't "exist", they're just prefixes on names (ie: strings) and the semantics are given to them by humans.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-10-02 10:58:26 -0500

Seen: 588 times

Last updated: Oct 02 '18