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

Feature: merge a fixed joint's child link to the parent #1110

Open
scpeters opened this issue Aug 11, 2022 · 5 comments
Open

Feature: merge a fixed joint's child link to the parent #1110

scpeters opened this issue Aug 11, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@scpeters
Copy link
Member

Desired behavior

By default, parser_urdf.cc currently merges links connected by fixed joints, lumping the inertia together and moving collisions, visuals, and sensors from parent to child and updating poses (also referred to as fixed-joint reduction). During this process, the original child link frame location is lost; though it would be possible to add a //frame to memorialize it.

This is a useful feature, so I would propose adding it to the SDFormat specification. This would also greatly simplify the code in parser_urdf.cc that currently implements this functionality.

Alternatives considered

  • Status quo: keep it only as a feature of the URDF parser.

Implementation suggestion

Add data to a //joint/fixed tag to enable and configure this behavior:

  • //joint/fixed/merge_child_to_parent/@enabled: boolean
  • //joint/fixed/merge_child_to_parent/@discard_child_inertia: boolean

Additional context

@scpeters scpeters added the enhancement New feature or request label Aug 11, 2022
@scpeters
Copy link
Member Author

though it would be possible to add a //frame to memorialize it.

I have a prototype for adding these //frame tags in branch scpeters/debug_urdf_frame_13

@azeey
Copy link
Collaborator

azeey commented Oct 17, 2022

I have a fundamental question about joint reduction. As far as I know, it was added as an optimization for physics engines that use maximal coordinates. As such, shouldn't the feature be an implementation detail in the physics engine? Why should SDFormat be involved in any of it?

@scpeters
Copy link
Member Author

though it would be possible to add a //frame to memorialize it.

I have a prototype for adding these //frame tags in branch scpeters/debug_urdf_frame_13

//frame tags are now added to memorialize each link and joint that are lost when reducing fixed joints (#1148, #1182)

@scpeters
Copy link
Member Author

I have a fundamental question about joint reduction. As far as I know, it was added as an optimization for physics engines that use maximal coordinates. As such, shouldn't the feature be an implementation detail in the physics engine? Why should SDFormat be involved in any of it?

The best argument I can make is to improve consistency between how SDFormat and URDF files are parsed since this feature only applies to URDF files and can be confusing to users. Outside of historical reasons and consistency, I don't have a principled argument for why this should be part of libsdformat and not a physics engine detail

@azeey
Copy link
Collaborator

azeey commented Oct 28, 2022

I would argue that the change should be made in our URDF parser to make it more consistent with SDFormat. From my experience, joint reduction causes confusion, especially for new users, and it's currently done in a way that doesn't hide this optimization/implementation detail from the users (eg. Gazebo UI will not show the original joint and lumped links, saved models will have lost the original content, etc.).

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

2 participants