Page 1 of 2

Modification of OpenSim model file .osim

Posted: Tue Apr 29, 2014 7:14 pm
by sunlixin
Hello, everyone!
I want to use ID tool with my mocap data, which is a bunch of quaternions of each joints in the upper limb.
After checking the .mot file, I need to change the quaternions into euler angles. As I read the .osim file of the upperlimb model, DynamicArms2013, I find that there's only one DOF in the elbow, which is not reasonable. Then I check the model of Holzbaur etl. 2005, find there's also one DOF. I also find there are three kinds of muscles, but the descriptions of their properties are the same except names. I don't know why.
So I decide to add one DOF, but I don't know how to set axis exactly. How on earth is the .osim compiled? Where is the data from?
Furthermore, after transformation of a quaternion, I get three angels, in this situation, how to set the angels to each DOF, anybody has an idea?
Thanks!

Re: Modification of OpenSim model file .osim

Posted: Mon May 05, 2014 4:36 pm
by jimmy
HI Lixin,

The upper limb models are all children of the Holzbaur model. This was designed for shoulder research, so the elbow was simplified as a single Dof joint. The Hamner model has pronation/supination at the elbow. It would be advised to check that model out for your needs.

Im not sure which muscles you are referring to exactly, but often a muscle that spans a large insertion area is broken up into multiple line muscles in attempt to describe the overall action. glut_max 1, 2, and 3 is a good example in the lower body.

Im not sure what you mean by compiled in this context? Or 'where the data is from'?

Conversion of quaternions is not something I have done. You will have to have code on your end that converts your data into (at least) a flexion/extension angle and a pronation/supination angle. You will have to test if your method is correct and robust.

Cheers,
-james

Re: Modification of OpenSim model file .osim

Posted: Mon May 05, 2014 5:22 pm
by sherm
Not sure if this is helpful, but OpenSim does contain extensive Quaternion methods through the SimTK::Quaternion class (from the Simbody layer). This can be used in conjunction with the rotation matrix class SimTK::Rotation to convert quaternions into any rotation angle sequence. These are only accessible if you are working with the OpenSim API in C++. If so, you can find much more information about these classes in Doxygen.

Sherm

Re: Modification of OpenSim model file .osim

Posted: Mon May 05, 2014 5:30 pm
by jimmy
Whoa, is there anything Simbody can't do??

Re: Modification of OpenSim model file .osim

Posted: Mon May 05, 2014 7:10 pm
by sunlixin
Hello James!
I misunderstood the meaning of "report this post" and report your reply with my reply. I'm really sorry if you receive some notification.
Anyway, thanks a lot for your sweet replies!
When I'm studying the rotations of upper limbs this morning, I find there is a body called "radius" below "ulna", which I didn't notice. The "radius" has a joint "radioulnar", whose parent body is "ulna". In the coordinate set of "radioulnar", there is o DOF called "pro_sup", which I think is the DOF that controls the pronation/supination of the elbow.
So there are actually 2 DOFs in the elbow, but they are reflected in different joints.
My "compiled" means where is the data of musculoskeleton properties from, such as body mass, rotation axis, transform function and so on. Why can I trust the computed results of OpenSim?
The three kinds of muscles I said are "Schutte1993Muscle", "Thelen2003Muscle" and "Delp1990Muscle". The model of Holzbaur et al uses "Schutte1993Muscle" and Hammer's uses "Thelen2003Muscle". But descriptions of the three muslces are the same in the model file of Holzbaur et al.
I have some problems dealing with my quaternions in deed because of the different coordinates between OpenSim and our Mocap system. I'm trying exploring their relationship recently.

Cheese,
Lixin Sun

Re: Modification of OpenSim model file .osim

Posted: Mon May 05, 2014 7:21 pm
by sunlixin
Hello Sherm!
Thank you for your advice! You've provide me with a new clue.
Do you mean that if I want to use the extensive Quaternion methods, I have to write my own OpenSim software or a plugin?

Best wishes!
Lixin Sun

Re: Modification of OpenSim model file .osim

Posted: Mon May 05, 2014 7:27 pm
by sherm
Hi, Lixin. Yes, but I would not advise that unless you are already working in C++. Otherwise you should find a method that works in whatever language you are already comfortable with.

Regards,
Sherm

Re: Modification of OpenSim model file .osim

Posted: Mon May 05, 2014 7:54 pm
by sunlixin
Hello Sherm!
I majored in software engineering, so programming language is not the most stressful thing. But I want to make OpenSim use our data first with OpenSim, which is my current mission that my mentor asks me to do. Anyway, I'll go deeper along this clue later. Thanks again!

Best wishes!
Lixin Sun

Re: Modification of OpenSim model file .osim

Posted: Mon May 05, 2014 9:00 pm
by sherm
Great, I'm glad to hear you can work in C++. Please post if you have further questions when you get to that phase.

Sherm

Re: Modification of OpenSim model file .osim

Posted: Mon May 05, 2014 11:09 pm
by sunlixin
Okay! I'll tell you if I start the work and may bother you someday.

Best wishes!
Lixin