robotology / idyntree

Multibody Dynamics Library designed for Free Floating Robots
BSD 3-Clause "New" or "Revised" License
166 stars 66 forks source link

Support loading models from SDF (Simulation Description Format) #481

Open traversaro opened 5 years ago

traversaro commented 5 years ago

For a long time with iCub we used both the URDF format and the SDF format to represent our robots, see for example the models available at icub-models.

We use URDF for our control software, while we use SDF for Gazebo simulation.

The reason for this duality were two:

As the problem with fixed joints was solved years ago ( https://bitbucket.org/osrf/sdformat/pull-requests/194 ), the boost dependency has been finally removed by migrating to C++17 (https://bitbucket.org/osrf/sdformat/pull-requests/438/removal-of-boost/diff), and there is ongoing work to support purely kinematic frames (https://bitbucket.org/osrf/sdformat/issues/200/support-multiple-frames-in-a-single-parent), it may be interesting to also (not replacing URDF) support for import and export of iDynTree::Model to SDF.

The advantages of SDF over URDF are the following:

traversaro commented 4 years ago

This may be even more attractive with the recent developent of SDFormat 1.7, see the discussion in https://discourse.ros.org/t/sdformat-pose-frame-semantics-proposal/9852 . That adds some additional advantages:

diegoferigo commented 4 years ago

SDF support would be an excellent addition, particularly with the new frame semantics feature.

Beyond the comprehensive list of advantages your listed, I would add that we can directly use sdformat for the deserialization. It will provide an effortless parser for the SDF files.

Moreover, upstream there's a SDF -> URDF converter in WIP that we could make use.

traversaro commented 4 years ago

Also loading meshes from relative paths (see https://bitbucket.org/osrf/sdformat/pull-requests/558) would be a great feature that currently the "official" URDF specs lacks (see https://github.com/robotology/idyntree/issues/291).

traversaro commented 3 years ago

Related but different issue: support the export of SDF files: https://github.com/robotology/idyntree/issues/835 .