-
Notifications
You must be signed in to change notification settings - Fork 14
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
Hips Orthogonal basis and arm flip #10
Comments
Hi, Thanks for reading my post. The skeleton in my example code is defined in that way because of the keypoints that Mediapipe detects. But the ideas from my post should still carry over to other skeleton definitions.
I would suggest that you feed in all 0s angles to reproduce the Tpose first and then feed single angles to specific joints to make sure they are rotated as you expect. This usually helps me debug. If things still don't work, please leave another comment. I might be overlooking something and need to think more about it before I comment. |
By the way, are the hip joints rigidly attached to the pelvis? If not, then the formulation above will not work. Take a look at this drawing. In the first figure, how would you define the forward direction? In the second figure, the pelvis and hips are rigidly attached so you can define a forward direction. In the first figure, it is still possible to define the forward direction if you take the vector between the hips as u, not vector from pelvis to one hip. Keep this in mind. |
I just rename the hips to pelvis, it's the same joint |
Yeah I understand the joint names. If you see the left figure above, you can see that you might get very strange forward directions if you try to use pelvis_to_hips as u. So my suggestion is to use u = right_hip - left_hip. |
frame_pos[7] is spine? In any case, this looks correct. If you pass in all 0 angles, do you get the correct T pose? |
Looks like the hips are flat, unlike the 2nd image in your original post. Could you try to find out why the hips are not as expected? |
When I calculate, I use the offset of my standard joints in the 2nd image in my original post. In my original post, I set hips world position and joints local euler, so if I pass in all 0 angles, I will always get correct T pose. So I just apply the rotation result and all the world pos to the origin bone from motionbert result to debug T pose, maybe the debug is not correct |
Well, try to find out why this is happening. After that, set joint angles one by one to make sure they are rotating as you expect. |
Hi @TemugeB! Read your post and it has helped me a ton. When I wan't to use this way to other works, like MotionBert, it comes to 2 problem:
My skeleton is here, it's shoulder is connected to spine, and neck is connected to spine
Follow to you, I first calculate the local matrix, then calculate the world matrix by get_rotation_chain function, and then turn to euler in world space, finally, I assign the world euler to maya joints.
The problem is the arm will flip when I retarget to the lafan1 model
Is there any problem when convert euler or calculate joint rotation matrix? Maybe the sqrt in Decompose Function?
The text was updated successfully, but these errors were encountered: