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

Better rotation matrix identity check. #180

Closed
wants to merge 2 commits into from
Closed

Conversation

jeongseok-meta
Copy link
Contributor

Summary: Matching coeffs doesn't really do what you expect for quaternions, so let's compare the rotation matrices instead.

Reviewed By: yutingye, jeongseok-meta

Differential Revision: D67655916

Summary:

In this function, there was some really suspicious-looking code, namely this:
      const Eigen::Quaternionf localRotation{
          joint_params[iFrame].coeff(iJoint, 3),
          joint_params[iFrame].coeff(iJoint, 4),
          joint_params[iFrame].coeff(iJoint, 5),
          joint_params[iFrame].coeff(iJoint, 6),
      };

Digging into why this function worked at all given how wrong the above code is revealed that we were actually completely ignoring the skeleton state passed into this function and just constructing a brand new skeleton state from the joint parameters.  

This seems non-ideal to me since it violates the contract: if you pass in skel_states that don't match the joint parameters you won't get what you expect.  Therefore let's rewrite this function to work directly from the skel_state, which means we can toss out the joint parameters altogether.  This lets us delete a bunch of skel_state_to_joint_params calls.

Also fixing the API to be less annoying (use buffers instead of lists of buffers), since this appears to be what everyone wants anyways.

Reviewed By: yutingye, jeongseok-meta

Differential Revision: D67655918
Summary: Matching coeffs doesn't really do what you expect for quaternions, so let's compare the rotation matrices instead.

Reviewed By: yutingye, jeongseok-meta

Differential Revision: D67655916
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jan 7, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67655916

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 9282fb2.

@jeongseok-meta jeongseok-meta deleted the export-D67655916 branch January 10, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants