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

Understanding xmlns: what are the links linked to?

asked 2017-08-21 10:36:49 -0500

alienmon gravatar image

I have read similar question here ,but It still hasn't answered my confusions.

I refer to this tutorial

here's the snipper:

<robot xmlns:sensor=""
   name="pr2" >

I know that XMLNS is namespace for XML

Quoting gvdhorn's commend on the thread I linked,

"xmlns is short for "XML NameSpace", and is a special XML construct that is expained in the links @VictorLamoine posted. @shawnysh: you can essentially consider them like import statements in the example you posted. But it's really an XML thing, not ROS specific"

Please help to clarify these things:

  1. What is the link specified in xmlns linked to? Is this link like a library (implying from gvdhorn's statement)? but why do we need the library?
  2. If I am to create my own robot. How is the xmlns somehow involved in the creation?
  3. How do i know which link to be linked to?
  4. In the tutorial code after specifying the namespace above, could you give examples which lines of code are being appended by the namespace?

Please elaborate

Thank you

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-08-21 16:24:02 -0500

Mark Rose gravatar image

It looks like you are looking at out-of-date URDF files. The current Gazebo documentation says you don't want those additional Gazebo namespaces, just the Xacro namespace (if you're using Xacro): Tutorial: Using a URDF in Gazebo

For your questions:

  1. The URL in the xmlns attribute is not required to be a location that responds to an HTTP request. Instead, it is just a unique moniker identifying the namespace. You can use an XML catalog or the "xsi:schemaLocation" attribute to create a mapping between namespaces and the actual location of the schemas.
  2. No, your robot specification in URDF does not need new namespaces for your robot. See the tutorial mentioned above, and the general URDF tutorials.
  3. N/A
  4. Adding a namespace does not add anything to the XML file, but it allows you to add additional elements from the schema corresponding to that namespace.
edit flag offensive delete link more

Question Tools



Asked: 2017-08-21 10:36:49 -0500

Seen: 670 times

Last updated: Aug 21 '17