Exploring new tools to add to my toolbox

ROS Notes: URDF vs. Gazebo SDF

One of the higher-level mysteries to this ROS beginner is why Gazebo, a sibling product, has a separate XML-based description format SDF instead of using the same URDF files of ROS. The answer came in this particular page in Gazebo’s collection of tutorials. “Tutorial: Using a URDF in Gazebo” explains why a different format was invented, but it also outlines Gazebo features to bridge the two worlds. By adding Gazebo-specific tags to URDF files, authors can specify all the information necessary for Gazebo to convert it to a SDF for internal use.

My understanding can be boiled down to this: URDF specifies a robot, but SDF also specifies a world for the robot to live in, which is a much larger set of things. Based on this premise, SDF is designed to represent a superset of everything that can be represented in URDF.

Which leads to the obvious next question: if SDF is a proper superset, why not standardize on SDF across the board? The best answer I could find is the idea being floated (and shot down?) as something to do for ROS2. I can understand the perspective that ROS really only cares about the robot and doesn’t need all the extra features of specifying a simulation world.

And while reading that discussion thread, I also learned Gazebo isn’t the only one unhappy with URDF. There’s also a SRDF file format for describing things not in a URDF, and I have even less of an idea how SRDF relates to SDF. Fortunately, there is an enlighening comment block in the generic example on that page:

This does not replace URDF, and is not an extension of URDF.

So whatever SRDF may be, it’s not yet another way to specify a robot, which is a relief.

Summary of my current understanding:

URDF is the established format for describing robot structure in ROS, and it is not going away anytime soon.

URDF could not specify information necessary for other robotics domains.

SDF was devised by Gazebo to meet simulation needs, but Gazebo can consume URDF when it is augmented by information within <gazebo> tags.