Hi,
I had done something similar in C++ and OpenSceneGraph. Please see the attached, maybe it can help you.
What do getPositionInGround and getRotationInGround return?
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: What do getPositionInGround and getRotationInGround return?
- Attachments
-
- OsimModel.h
- (1.59 KiB) Downloaded 35 times
-
- OsimModel.cpp
- (8.54 KiB) Downloaded 74 times
- Connor Pyles
- Posts: 20
- Joined: Wed Jul 19, 2017 1:46 pm
Re: What do getPositionInGround and getRotationInGround return?
Thanks, I'll take a look. Unfortunately I'm not very well-versed in C++ which is why I'm working in MATLAB to begin with. At some point I'll bite the bullet and convert the code to C++...
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: What do getPositionInGround and getRotationInGround return?
No need to as long as the different modules are exposed. The API calls are the same in Matlab.
- Victor Ng-Thow-Hing
- Posts: 2
- Joined: Mon Nov 07, 2022 1:52 pm
Re: What do getPositionInGround and getRotationInGround return?
Hi Connor,
I'm doing something very similar - I was able to convert an osim model file into a usd file which I could bring in properly into Unity, as well as Blender and Maya.
The issue I'm running into is trying to convert my .mot motion files into animations that are also playable under Unity. I tried using getPositionInGround and getRotationInGround on the bodies after loading my .mot file into a Storage class, converting that to a StateTrajectory and querying the State and updating at each tilmestep by realizing Positions. I'm able to see changing quaternions, but when I try to display them in Unity, they appear to be a random mess. My working theory is that the .mot files store angles in degrees, and I do get a warning and exception thrown when I try to convert them to a StateTrajectory. I set the property inDegrees to false to prevent the exception but I suspect that no attempts of conversion are being made. Any thoughts on this?
Victor
I'm doing something very similar - I was able to convert an osim model file into a usd file which I could bring in properly into Unity, as well as Blender and Maya.
The issue I'm running into is trying to convert my .mot motion files into animations that are also playable under Unity. I tried using getPositionInGround and getRotationInGround on the bodies after loading my .mot file into a Storage class, converting that to a StateTrajectory and querying the State and updating at each tilmestep by realizing Positions. I'm able to see changing quaternions, but when I try to display them in Unity, they appear to be a random mess. My working theory is that the .mot files store angles in degrees, and I do get a warning and exception thrown when I try to convert them to a StateTrajectory. I set the property inDegrees to false to prevent the exception but I suspect that no attempts of conversion are being made. Any thoughts on this?
Victor