0
$\begingroup$

Rosanswers logo

I'm using ROS melodic and Gazebo 9.9.0 on an Ubuntu 18.04.2 LTS.

I've been reading this: http://wiki.ros.org/roscpp/Overview/NodeHandles, but I don't understand what is (or are) the different between this two declarations:

ros::NodeHandle n;

And

ros::NodeHandle n("~");

What are the different between a private and a not private node handler?


Originally posted by Elric on ROS Answers with karma: 71 on 2019-07-18

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The first will look for your parameter in the global namespace (ei it will find /my_param) the second will look under the nested namespaces of the node itself (ei it will find /namespace/my_node_name/my_param).

You can still find the local namespace copy of that parameter with the global nodehandle, but you will need to type in alot more information.


Originally posted by stevemacenski with karma: 8272 on 2019-07-18

This answer was ACCEPTED on the original site

Post score: 4

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.