Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I think your problem arises from the difference between a NodeHandle (constructed as NodeHandle nh; and a private NodeHandle (as Nodehandle nh("~");) that you probably use.

I suspect you only use the second, which will put everything in the node's namespace (mynode). This is what you want for parameters, but not necessarily for topics, etc.

So: Use the private NodeHandle for getting parameters and a "normal" NodeHandle for creating topics/services. That should clean up a lot of your problems.

I think your problem arises from the difference between a NodeHandle (constructed as NodeHandle nh; ) and a private NodeHandle (as (Nodehandle nh("~");) that you probably use.

I suspect you only use the second, which will put everything in the node's namespace (mynode). This is what you want for parameters, but not necessarily for topics, etc.

So: Use the private NodeHandle for getting parameters and a "normal" NodeHandle for creating topics/services. That should clean up a lot of your problems.