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

Pose Solver in Unity #17

Closed
FarzanAlipour opened this issue Nov 17, 2022 · 10 comments
Closed

Pose Solver in Unity #17

FarzanAlipour opened this issue Nov 17, 2022 · 10 comments
Labels
wontfix This will not be worked on

Comments

@FarzanAlipour
Copy link

Hey guys,
I've been trying to implement Moetion logic on Unity but the logic doesn't seem to work.
I think you are using different orientation and different 3d rigs.
Unity uses left handed (Y axis up) and I'm using mixamo rigs,
please inform me about the used orientation and rig so I can translate the code for Unity.
thanks ^^

@sr229
Copy link
Member

sr229 commented Nov 17, 2022

Please see if you have the same issue as GH-11. We have a different representation for angles.

@FarzanAlipour
Copy link
Author

FarzanAlipour commented Nov 17, 2022

I confirm that I convert radians to degrees
for me in order to apply the correct calculations in PoseSolver class it's crucial to know the orientation system used in this project
can you briefly explain the representation for axis orientation?

@sr229 sr229 added the wontfix This will not be worked on label Nov 21, 2022
@sr229
Copy link
Member

sr229 commented Nov 21, 2022

Marking wontfix as this seems to be more of a human-induced error contributed by its usage on a unsupported environment.

@sr229 sr229 closed this as completed Nov 21, 2022
@FarzanAlipour
Copy link
Author

Hey again
I didn't ask for a fix!!
I asked for information on the used rig (I'm using mixamo characters) and the axis orientation on this package.
it would be great if you can provide these informations. otherwise your answer was not helpful at all.
anyway thanks for responding.

@sangww
Copy link

sangww commented Nov 21, 2022

Hi I am also bumping this up, as I have run into the same issue as @FarzanAlipour. Mixamo rig seems to not utilize the same coordinate system for rotation (more precisely, local rotation) and wonder if there could be tutorial on rigging based on the avatar model you guys have used.

@sr229
Copy link
Member

sr229 commented Nov 22, 2022

I apologise but the fact you are using an early stage library we have never personally tested yet (since we're still working on our own project and as such we cannot test it), and we only put up the packages for our own use later, means you have not taken appropriate steps to debug and fix under your own power.

We may fix it ourselves only if we confirmed it on our side but for now please fix it yourself if you can.

@Speykious
Copy link
Contributor

Speykious commented Nov 22, 2022

Just wanted to step in a bit, Moetion is supposed to be a 1:1 port of Kalidokit from Typescript to C#. So it should work relatively the same way. I personally didn't pay attention to how the angles work exactly (besides being in radians) when I translated this to C# and haven't had the occasion to test it when I was still working on it, however you may find the answer if you look in Kalidokit.

@FarzanAlipour
Copy link
Author

Ok thanks @sr229 @Speykious
I will opened the same issue on Kalidokit, and will update here if i found a solution.

@Speykious
Copy link
Contributor

Ok thanks @sr229 @Speykious I will opened the same issue on Kalidokit, and will update here if i found a solution.

Just make sure to test whether your Mixamo rigs work with Kalidokit before opening an issue about it there.

@sangww
Copy link

sangww commented Nov 22, 2022

Hi all thanks for confirming this! It is great to understand the scope of this development, and apology if I came across demanding. I just hoped to point out an issue I also came across when it comes to Moetion->Unity->Mixamo adaptation.

@FarzanAlipour Here, I think I found a way to work. Further test needed, but was able to apply to one important joint for me: upper arm.

I have looked into in detail what the local coordinate system of the upper shoulder of the mixamo rig is (e.g. mixamorig:RightShoulder) and found that the coordinate system is rotated away from the x, y, z definition from MediaPipe or Moetion. There I applied transformation by switching out x, y, z accordingly, based on on what global axis rotation is applied to the local rotation. For instance, that swapping is done through a code that looks like below:

  Quaternion x = Quaternion.AngleAxis(ea.z * Mathf.Rad2Deg, Vector3.right);
  Quaternion y = Quaternion.AngleAxis(ea.x * Mathf.Rad2Deg, Vector3.up);
  Quaternion z = Quaternion.AngleAxis(ea.y * Mathf.Rad2Deg, Vector3.forward);

  return z * y * x;

This is for the upper right arm, but others will follow the same structure. I am further testing today, but no deadline tbh. Hope this helps you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants