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

How do you come up with the "rotation" and "scale" value in the retarget config file? #62

Open
nicolasfischoeder opened this issue Sep 28, 2023 · 2 comments

Comments

@nicolasfischoeder
Copy link

Hello everyone,

I am trying to import my own MotionCapture-Data via the poselib examples.

When looking at the retarget_cmu_to_amp.json I see that there is a "scale" key and a "rotation" key. How would one calculate these values? Does anyone have a clue?

@nicolasfischoeder
Copy link
Author

I figured something out:

I read out the highest z-value in from the CMU t-pose (head point) and multiplied it with the scale from the retarget config. That gave me around 1.533258701. Which seemingly should be the target height after the scale is applied.

For my own skeleton from my unreal mannequin I also read out the highest position in the z-axis (head point) from the t-pose: Which turned out to be 165.51604. I divided the targetheight of 1.53325801 by the unreal mannequin height 165.51604 to get my scale value of 0.009263505.

I hope this is right... Would be great if somebody could validate my approach.

For the rotation quaternion, I simply checked whether the CMU t-pose is oriented towards the same axes as my unreal skeleton, which it was, so I kept the values. I converted the quaternion to angle-axis-degree values and figured out that this quaternion rotates the rig by 90 degrees along the Z axis.

I would really appreciate if someone could check my approach and comment. If it's already working, I hope it helps somebody and saves some time. :-)

@xbpeng
Copy link
Collaborator

xbpeng commented Oct 2, 2023

Your understanding is correct. The scale parameter is to convert between different units in different motion formats. Our motion files use meters as the default units, so if you have data that is in cm, then you should set the scale to 0.01. You can also use the scale parameter to adjust differences in the size of the different characters.

As you mentioned, the rotation is to align the coordinate axes of different motion formats as well. So you want to specify the rotation so that it aligns the t-pose of the source data to the target data.

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