ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
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.
2 | fixed missing parens |
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.