0
$\begingroup$

I have 2 models one in URDF and another in SDF. I want to combine them together. While doing so, I was reading about these 2 formats and I want to know the main difference between these 2 based on usage efficiency with ROS and Gazebo. My final goal is to launch the Robot through ROS and Gazebo and then interfacing them through matlab.

Please let me know your views and details on the popular statement - URDF works well for ROS and SDF is preferred for Gazebo.

$\endgroup$

1 Answer 1

3
$\begingroup$

If you compare the specifications, you'll see that SDF is a richer and much more general format that has support for more types of physical interaction:

https://wiki.ros.org/urdf/XML

https://sdformat.org/

One simple example that I've encountered in real life is adding a spring to a joint. I did this for obstacles that could move a little in Gazebo when a position-controlled them. A native URDF joint specifies friction and damping, but not elasticity.

The <gazebo/> tag in URDF solves a lot of these problems for joints, and allows you to pass certain SDF information from the URDF through to the generated SDF description.

However, there are many supported tags and concepts in SDF that have no counterpart in URDF. SDF is a more general format for simulation and allows you to specify the world and other entities in it.

An example that's very different from what URDF can handle are "actors," entities which move around in a scripted way and provide a visual and (I think) a contact obstacle but whose motion does not necessarily need to be simulated using physics calculations. I've seen this used for people walking around in the sensor field of autonomous vehicles under test.

I don't have a good understanding of the history of URDF and SDF. I've considered using SDF in custom work because of URDF's limitations, but URDF has origins in ROS and so the overall ROS support of URDF really tips the scales toward choosing URDF over SDF. I think there are converters in both directions now, but converters can't map two conceptually different formats exactly, they can just do a good enough job for common use cases.

URDF is simpler than SDF which likely supports its popularity as well.

There's some discussion on formats here as a jumping-off place for more links and discussions about what a robot and/or simulation format should provide:

https://discourse.ros.org/t/urdf-ng-ros2-urdf2-discussion/511

$\endgroup$
1
  • $\begingroup$ Thank you for the good explanation. I am currently looking at these converters. I am unable to use them for my usecase as I have a layered XACRO file (multiple layers of URDFs) and trying to convert it to SDF as I feel it is richer and easier to integrate anything in future as well. Especically I am doing this for the CrazyS framework. $\endgroup$
    – vbalaji21
    Apr 9 at 15:57

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.