Scaling and IK of OpenSIM

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
In Bae Chung
Posts: 19
Joined: Mon Jan 14, 2019 11:46 pm

Scaling and IK of OpenSIM

Post by In Bae Chung » Mon Apr 01, 2019 3:58 am

Hi, everyone. Please understand that I'm still a beginner in OpenSIM.
I already have my own dataset in TRC file. I wanted to scale das3(Dynamic Arm Simulator) model so that I can input the TRC file and implement the Inverse Kinematics function. I located the analytical markers in the same position as the experimental markers and used the scale tool, but what I got is a model with a distorted arm which doesn't make sense. I tried the Inverse Kinematics function anyways to see what happens, and the distorted model does move but in the same weird position.

What I first thought was maybe my TRC file has a different XYZ coordinate system, so I previewed my experimental data and tried rotating it in x, y, and z axis. However, when I tried to scale my model again with the rotated experimental data, the scaling process is never complete and is paused at "Step 3: Placing markers on model."

Can anyone help me out with this problem? I'd be so happy to see my model work successfully :(
Attachments
1.PNG
1.PNG (196.16 KiB) Viewed 719 times

Tags:

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

Re: Scaling and IK of OpenSIM

Post by Dimitar Stanev » Tue Apr 02, 2019 11:37 pm

Hi,

It is possible that the model is fixed with respect to the ground frame. If the experimental markers have an offset with respect to the model, then IK cannot position the model correctly since it is welded to the ground. In this case, you can add a free joint (6DOF) between the ground and the base body (e.g., thorax).

User avatar
In Bae Chung
Posts: 19
Joined: Mon Jan 14, 2019 11:46 pm

Re: Scaling and IK of OpenSIM

Post by In Bae Chung » Thu Apr 04, 2019 1:35 am

Thank you for your comment, Dimitar.

I tried changing the parent frame of the markers to the corresponding body set from the properties tab. Then I fixed the markers to the model. ( Not sure if this is the right thing to do.)
However, I still don't know how to check if my 'model' is fixed with respect to the ground frame. Also, how do I add a free joint into the model in OpenSIM GUI? I tried to follow your instructions but couldn't find a way to do it.
Attachments
properties.PNG
properties.PNG (6.98 KiB) Viewed 660 times

User avatar
Ayman Habib
Posts: 2248
Joined: Fri Apr 01, 2005 12:24 pm

Re: Scaling and IK of OpenSIM

Post by Ayman Habib » Thu Apr 04, 2019 12:39 pm

Hello,

The user interface/GUI doesn't allow for addition/deletion of Joints as of now. You'll have to do it through either the XML file or some scripting environment (Python, GUI or Matlab). The OpenSim 4.0 distribution has example scripts to add joint/body/geometry to an existing model.

Hope this helps,
-Ayman

User avatar
In Bae Chung
Posts: 19
Joined: Mon Jan 14, 2019 11:46 pm

Re: Scaling and IK of OpenSIM

Post by In Bae Chung » Thu Apr 04, 2019 9:40 pm

Hello,
I found the reason why the model's arm was in a distorted position! It was because the experimental data was rotated 180 degrees in the y-axis from the model. I followed the instructions from viewtopicPhpbb.php?f=91&t=6692&p=0&start=0&view=
Rotated the experimental data so that it conforms to the OpenSIM model, and then saved it.

However, when I tried scaling the model to the new rotated experimental data, the process is never complete and is paused at "Step 3: Placing markers on model." Below is what is written in the Messages. Is it because OpenSIM couldn't find the vtp files stated in the message? I'm confused because scaling process was complete even though the results weren't good when I used the unrotated experimental data.

Loaded marker file E:\MotionCapture\transformed_upperbody_static.trc (9 markers, 80 frames)
Loaded marker file E:\MotionCapture\transformed_upperbody_static.trc (9 markers, 80 frames)
Couldn't find file 'rclavicle.vtp'.
Couldn't find file 'rscapula.vtp'.
Couldn't find file 'rhumerus.vtp'.
Couldn't find file 'rulna.vtp'.
Couldn't find file 'rradius.vtp'.

Step 2: Scaling generic model
Couldn't find file 'rclavicle.vtp'.
Couldn't find file 'rscapula.vtp'.
Couldn't find file 'rhumerus.vtp'.
Couldn't find file 'rulna.vtp'.
Couldn't find file 'rradius.vtp'.
Couldn't find file 'rclavicle.vtp'.
Couldn't find file 'rscapula.vtp'.
Couldn't find file 'rhumerus.vtp'.
Couldn't find file 'rulna.vtp'.
Couldn't find file 'rradius.vtp'.
Couldn't find file 'rclavicle.vtp'.
Couldn't find file 'rscapula.vtp'.
Couldn't find file 'rhumerus.vtp'.
Couldn't find file 'rulna.vtp'.
Couldn't find file 'rradius.vtp'.
Couldn't find file 'rclavicle.vtp'.
Couldn't find file 'rscapula.vtp'.
Couldn't find file 'rhumerus.vtp'.
Couldn't find file 'rulna.vtp'.
Couldn't find file 'rradius.vtp'.

Step 3: Placing markers on model

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

Re: Scaling and IK of OpenSIM

Post by Dimitar Stanev » Sun Apr 07, 2019 2:14 am

Hi,

You can save the scaled mode in the same folder as is the original model and reopen it in the GUI. The reason for this, is that the model uses custom geometries that do not ship with OpenSim.

Did you solve the first problem? From the description it seems that you haven't unlocked the model with respect to the ground frame.

POST REPLY