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 support for quaternion in URDF #195

Open
doisyg opened this issue Jan 20, 2024 · 3 comments
Open

Add support for quaternion in URDF #195

doisyg opened this issue Jan 20, 2024 · 3 comments

Comments

@doisyg
Copy link

doisyg commented Jan 20, 2024

Following conversation here: #123 (comment)

Reopening as new PRs

And a draft on urdf_parser_py (because I never use python and have no proper clue of what's going on): ros/urdf_parser_py#84

Other packages to consider :

@traversaro
Copy link
Contributor

Thanks for proposing this! Given what was discussed in #123 (comment), I think that it is useful to clarify what version number this is new URDF+quaternion will use (as requested in #123 (comment)).

It is going to be URDF spec 2.0 or 1.1? I am not an expert of versioning for file formats, and the usually used semantic versioning refers to software APIs (with corresponding ABIs), not file formats. The only example that I know of strictly defined versioning rules for a file format are FMI's versioning rules, defined in https://fmi-standard.org/docs/3.0/#VersioningLayered .

However, philosophy aside, the version support was added in #133, but unless I am missing something no explicit semantics was defined for it. However, there is an implicit semantic defined by the check in

if (!version.equal(1, 0))
: all existing urdfdom version will refuse to load any document that URDF that have a version different from "1.0" . From that point of view, this means that we can safely call the URDF with quaternion both 1.1 or any other number, as old urdfdom that do not read quaternions will always do the right thing: refuse to load the document.

Regardless of weather we use "1.1" or "2.0" as a version, I guess we need to modify the following point in the code:

@traversaro
Copy link
Contributor

traversaro commented Jan 20, 2024

https://github.com/ros/sdformat_urdf ?

I guess no modification is required in this? This code creates a urdf::ModelInterfaceSharedPtr from a SDF model, without passing via the textual representation of the URDF, that is modified by this proposal. In memory, the urdf::Rotation struct already uses quaternion.

Whatever gazebo is using when doing gz sdf -p robot.urdf > robot.sdf or when spawning robot from an urdf robot description ? @ahcorde

This code is the URDF parser in https://github.com/gazebosim/sdformat/blob/sdf14/src/parser_urdf.cc . However, I do not think it needs any modification as it already uses urdfdom and so it reads the urdf pose from urdfdom's structures, see https://github.com/gazebosim/sdformat/blob/sdf14/src/parser_urdf.cc#L2802 . However, I think the problem here is of deployment. If I recall correctly (but things may have changed, I do not have a Humble install to quickly check) sdformat and gazebo packages use the urdfdom that ships with official Debian/Ubuntu repos (apt package: liburdfdom-dev, see for example https://packages.ubuntu.com/jammy/liburdfdom-dev), while ROS2 installs its own version of urdfdom package (ros-humble-urdfdom or something similar, see http://repo.ros2.org/ubuntu/main/pool/main/r/ros-humble-urdfdom/). So, to ensure that any change is available and supported in Gazebo for ROS Jazzy, we would need to make sure that urdfdom with this modifications is available in Ubuntu 24.04 repos. I am not sure if we are still in time for that, probably @j-rivero knows more. A possible alternative is that ROS installs its own ABI compatible sdformat package, to avoid any relation with the system's urdfdom.

@traversaro
Copy link
Contributor

Another related question: unfortunatly we still do not have the spec in a github repo (mainly my fault, see ros/urdfdom_headers#62). However, could you propose here or somewhere how you would edit the spec in http://wiki.ros.org/urdf/XML to document quaternions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants