Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I would recommend to read the NodeHandles wiki and the Names in ros.

If your first node define a nodehandle with a private namespace then if you want to have the same namespace in your second node you would have to define the nodehandle with the fully qualified name of the first one :

//In node A
ros::NodeHandle n("~"); //Consider the private namespace to be node_a
//In node B
ros::NodeHandle n("node_a");

You could also use a remapping in a launch file if you have one.