Page 1 of 1

Segment definitions in osim file

Posted: Mon Jun 09, 2008 12:50 pm
by tanjj
Would anyone happen to know where segment lengths and origins are defined in the osim model files? I'm trying to modify segment center of mass locations, but to do this I need to know the length of each segment as well as where their origins are located.

RE: Segment definitions in osim file

Posted: Mon Jun 09, 2008 1:25 pm
by aymanh
Hi JunJay,

OpenSim model file does not contain lengths, as these are not used by OpenSim. The attachment of different segments to their parents in the linkage are stored in the OpenSim file with every joint that attaches the segment to its parent (e.g. below). If you assume attachment at segment origins you can use this info to compute lengths.

<SimbodyJoint>

<SimbodyJoint name="ground_pelvis">

<bodies> ground pelvis </bodies>

<DofSet name="">

..

..

</DofSet>

<location_in_parent> 0.00000000000000000000 0.00000000000000000000 0.00000000000000000000 </location_in_parent>

<location_in_child> 0.00000000000000000000 0.00000000000000000000 0.00000000000000000000 </location_in_child>

</SimbodyJoint>

If the xml tags <location_in_parent>, <location_in_child> are missing they default to value of 0., 0., 0. If you save a model file from the GUI it should contain these tags so that you can modify them.

COM is described in local frame and is enclosed between the xml tags of the body as:

<mass_center> comx comy comz </mass_center>


Good luck,
-Ayman