Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gz sdf command that converts a file to an older version of the spec #1334

Open
scpeters opened this issue Oct 3, 2023 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@scpeters
Copy link
Member

scpeters commented Oct 3, 2023

Desired behavior

If I have a file using new features of the SDFormat spec, it means that it can't be loaded in software that only supports older versions of the spec (such as gzweb, which only supports up to SDFormat 1.6). It would be helpful to have a tool that could convert a file with version 1.7 or newer back to 1.6.

Alternatives considered

Implementation suggestion

Provide the interface as a --convert-to-version option to gz sdf --print:

gz sdf --print <new_file.sdf> --convert-to-version <old_version>

A short list of the types of conversions to be expected when converting between each version:

  • 1.7 -> 1.6: resolve all poses with the default value of //pose/@relative_to
  • 1.8 -> 1.7:
    • resolve joint parent/child frames to a link name or world
    • error if ellipsoid geometry is detected, or replace it with an equivalently scaled mesh
    • replace capsule geometries with equivalent cylinder and spheres
  • 1.9 -> 1.8: convert all poses to use Euler angles in radians
  • 1.10 -> 1.9: error if //world/joint tags are detected
  • 1.11 -> 1.10: resolve all auto-inertial values and print in an <inertial> block

It may be simplest to start with a tool that converts SDFormat 1.11 files to 1.10 by expanding any auto-inertial blocks to contain the full computed value.

Additional context

@scpeters scpeters added the enhancement New feature or request label Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To do
Development

No branches or pull requests

1 participant