ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Explanation of Resolving paragraph 1.1.2 of Wiki "Names"

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

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:

http://wiki.ros.org/Names#Graph

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

Comments

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 -0500 )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 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

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

2ROS0 gravatar image

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

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

Comments

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

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

Check additions to answer

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

Question Tools

1 follower

Stats

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

Seen: 202 times

Last updated: Oct 24 '14