ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Explanation of Resolving paragraph 1.1.2 of Wiki "Names"

asked 2014-10-03 08:31:03 -0600

fabbro gravatar image

Hi to everyone,

I am new of ROS and I am trying to go through all the ROS tutorials. I ended up in this page:

and I didn't understand how to interpret the resolving paragraph 1.1.2 'RESOLVING'.

Could you please explain it to me in a better way?

thanks a lot, Fab.

edit retag flag offensive close merge delete


Please clarify how you interpret the section and why you think that's incorrect. The terms you're asking about, base, global, private, and relative, are all defined in that section.

tfoote gravatar image tfoote  ( 2014-10-04 19:28:54 -0600 )edit

I agree w tfoote. Anyway, detailed description below. Also maybe edit the question to include the phrase "graph resource name resolution" or something of the sort so others can find it.

2ROS0 gravatar image 2ROS0  ( 2014-11-18 00:27:29 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-10-03 11:28:54 -0600

2ROS0 gravatar image

updated 2014-10-24 18:02:21 -0600

It basically means that when you write your code, you don't need to worry about there being the same name somewhere else. All your resources - nodes, params, topics and services will be in the local scope. And then you can write a top level node to include all those nodes without any problem.

Edit: (based on comment to answer)

Global: ROS has a global namespace - "/". If you define any of your graph resource names with a leading /, they will be global names. You can have a bunch of hierarchical namespaces but as long as it starts with a "/", it is globally resolved.

Example: "/global/name/with/base"

Base: That brings us to the second type - base names. Refer to the example above, every global name in ROS has a base which in this case is "base". You can look at it as the last name in the hierarchy and it doesn't have the "/"

Relative: ROS also has something known as a default namespace. The default namespace can be specified but if not specified it is the global namespace - "/". Relative names DO NOT have the leading "/" and are resolved WRT this default namespace.

Example: If the default namespace were "/global/name", then "with/base" would be the relative name. Notice that there is no leading "/" to "with/base"

Private: These names too are relative names, just that they use their nodes name as their default namespace. And they have to be specified with a leading "~".

Example: If "/global/name/with" was the name of the node, then the pvt. name "~base" would be the private name.

edit flag offensive delete link more


Thanks for your reply but, what is the difference between base, relative, global, private ?

fabbro gravatar image fabbro  ( 2014-10-03 11:42:50 -0600 )edit

Check additions to answer

2ROS0 gravatar image 2ROS0  ( 2014-10-24 18:03:08 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-10-03 08:31:03 -0600

Seen: 178 times

Last updated: Oct 24 '14