What do getPositionInGround and getRotationInGround return?

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: What do getPositionInGround and getRotationInGround return?

Post by Dimitar Stanev » Wed Aug 30, 2017 10:24 am

Hi,

I had done something similar in C++ and OpenSceneGraph. Please see the attached, maybe it can help you.
Attachments
OsimModel.h
(1.59 KiB) Downloaded 35 times
OsimModel.cpp
(8.54 KiB) Downloaded 74 times

User avatar
Connor Pyles
Posts: 20
Joined: Wed Jul 19, 2017 1:46 pm

Re: What do getPositionInGround and getRotationInGround return?

Post by Connor Pyles » Wed Aug 30, 2017 10:53 am

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++...

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: What do getPositionInGround and getRotationInGround return?

Post by Dimitar Stanev » Wed Aug 30, 2017 11:51 pm

No need to as long as the different modules are exposed. The API calls are the same in Matlab.

User avatar
Victor Ng-Thow-Hing
Posts: 2
Joined: Mon Nov 07, 2022 1:52 pm

Re: What do getPositionInGround and getRotationInGround return?

Post by Victor Ng-Thow-Hing » Tue Feb 14, 2023 9:51 pm

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

POST REPLY