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

Fixed parenting of SDF model and link entity transforms #591

Merged

Conversation

lemonade-dm
Copy link
Contributor

@lemonade-dm lemonade-dm commented Oct 25, 2023

The pose information from the SDF is a value relative to it's attached frame. The GetLocalTransfromURDF function was misnamed and returning the a local transform for any SDF link supplied to the function.

Also the PrefabMakerUtils::SetEntityParent function which is used to attach a child entity to a parent entity, preserves the world transform of the child entity. Therefore any pose information on child entities such as nested models or links on a model would be set in world space and not in local space.

How was this PR tested?

Verified that the nested model entities and link entities were transformed relative to the parent model entity
image

The pose information from the SDF is a value relative to it's attached frame.
The `GetLocalTransfromURDF` function was misnamed and returning the a local transform for any SDF link supplied to the function.

Also the `PrefabMakerUtils::SetEntityParent` function which is used to attach a child entity to a parent entity, preserves the world transform of the child entity. Therefore any pose information on child entities such as nested models or links on a model would be set in world space and not in local space.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
The parent child hierarchy is established through an SDF joint element which references a child and a parent link.

The hieararchy itself shouldn't be used to adjust the world transform between the two links, only to have the child link entity to be under parent link entity for organization purposes.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
Copy link
Contributor

@mbalfour-amzn mbalfour-amzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great! Both the aws-robomaker bookstore and the mini-pupper-ros imported correctly:
image

@adamdbrw adamdbrw merged commit f7ad62d into o3de:development Oct 30, 2023
2 checks passed
@lemonade-dm lemonade-dm deleted the sdf-model-transform-fixes branch October 30, 2023 16:07
mbalfour-amzn pushed a commit to aws-lumberyard-dev/o3de-extras that referenced this pull request Nov 9, 2023
* Fixed parenting of SDF model and link entity transforms
The pose information from the SDF is a value relative to it's attached frame.
The `GetLocalTransfromURDF` function was misnamed and returning the a local transform for any SDF link supplied to the function.
Also the `PrefabMakerUtils::SetEntityParent` function which is used to attach a child entity to a parent entity, preserves the world transform of the child entity. Therefore any pose information on child entities such as nested models or links on a model would be set in world space and not in local space.

* Fixed the setup of the parent child entity hierarchy between SDF links
The parent child hierarchy is established through an SDF joint element which references a child and a parent link.
The hieararchy itself shouldn't be used to adjust the world transform between the two links, only to have the child link entity to be under parent link entity for organization purposes.

---------

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
amzn-changml added a commit that referenced this pull request Nov 10, 2023
This PR cherry-picks PR #578 and PR #591 into the point-release so that nested model SDF imports work correctly.

Tested by importing aws-robomaker-bookstore in the point-release branch and verifying that it imported correctly.
michalpelka pushed a commit to RobotecAI/o3de-extras that referenced this pull request Nov 17, 2023
* Fixed parenting of SDF model and link entity transforms
The pose information from the SDF is a value relative to it's attached frame.
The `GetLocalTransfromURDF` function was misnamed and returning the a local transform for any SDF link supplied to the function.
Also the `PrefabMakerUtils::SetEntityParent` function which is used to attach a child entity to a parent entity, preserves the world transform of the child entity. Therefore any pose information on child entities such as nested models or links on a model would be set in world space and not in local space.

* Fixed the setup of the parent child entity hierarchy between SDF links
The parent child hierarchy is established through an SDF joint element which references a child and a parent link.
The hieararchy itself shouldn't be used to adjust the world transform between the two links, only to have the child link entity to be under parent link entity for organization purposes.

---------

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
michalpelka pushed a commit that referenced this pull request Dec 6, 2023
* Fixed parenting of SDF model and link entity transforms
The pose information from the SDF is a value relative to it's attached frame.
The `GetLocalTransfromURDF` function was misnamed and returning the a local transform for any SDF link supplied to the function.
Also the `PrefabMakerUtils::SetEntityParent` function which is used to attach a child entity to a parent entity, preserves the world transform of the child entity. Therefore any pose information on child entities such as nested models or links on a model would be set in world space and not in local space.

* Fixed the setup of the parent child entity hierarchy between SDF links
The parent child hierarchy is established through an SDF joint element which references a child and a parent link.
The hieararchy itself shouldn't be used to adjust the world transform between the two links, only to have the child link entity to be under parent link entity for organization purposes.

---------

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

None yet

4 participants