Skip to content

Conversation

@stefaniapedrazzi
Copy link
Member

@stefaniapedrazzi stefaniapedrazzi commented Jul 7, 2023

Description
Scale is integrated in the transform matrix computation differently in Webots and WREN causing mismatches.

Related Issues
This pull-request also fixes issues #6298 and #6063.

Tasks

  • fix transform matrix computation in Webots to match WREN
  • fix data displayed in Node Editor > Position Viewer(Issues with scaled Transform nodes #6063)
  • cleanup duplicated code to convert from/to different rotation format

@stefaniapedrazzi stefaniapedrazzi added bug Something isn't working cleanup Any design, code, file or folder cleanup labels Jul 7, 2023
@stefaniapedrazzi stefaniapedrazzi added this to the R2023b-rev1 milestone Jul 7, 2023
@stefaniapedrazzi stefaniapedrazzi self-assigned this Jul 7, 2023
@stefaniapedrazzi stefaniapedrazzi added the test suite Start the test suite label Jul 7, 2023
@stefaniapedrazzi
Copy link
Member Author

Actually, the formulas used in WREN are the common ones used to correctly handle non-uniform scale and correctly apply the scale without shear component.

But then. the formulas in Webots to compute the absolute matrix and absolute position don't match what is displays by WREN and should be updated accordingly to have consistent data.

Instead of multiplying directly the transform matrices to retrieve the absolute pose, the following formulas are used (pseudo-code):

absoluteTranslation = parent->absoluteTranslation + parent->absoluteOrientation * (parent->absoluteScale * relativeTranslation);
absoluteRotation = parent->absoluteRotation * relativeRotation;
absoluteScale = parent->absoluteScale() * relativeScale;
matrix.fromVrml(absoluteTranslation, absoluteRotation,absoluteScale);

@stefaniapedrazzi stefaniapedrazzi changed the title Fix handling scaled nodes in WREN Fix handling scaled nodes in Webots/WREN Jul 12, 2023
@stefaniapedrazzi stefaniapedrazzi marked this pull request as ready for review July 12, 2023 15:04
@stefaniapedrazzi stefaniapedrazzi requested a review from a team as a code owner July 12, 2023 15:04
@ygoumaz ygoumaz self-requested a review July 17, 2023 11:48
@ygoumaz ygoumaz requested a review from BenjaminDeleze July 18, 2023 12:18
Copy link

@BenjaminDeleze BenjaminDeleze left a comment

Choose a reason for hiding this comment

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

Thank you

@ygoumaz ygoumaz merged commit c3e94a8 into master Jul 18, 2023
@ygoumaz ygoumaz deleted the hotfix-wren-scale branch July 18, 2023 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cleanup Any design, code, file or folder cleanup test suite Start the test suite

Development

Successfully merging this pull request may close these issues.

4 participants