Segment definitions in osim file
- JunJay Tan
- Posts: 1
- Joined: Mon Nov 12, 2007 1:12 pm
Segment definitions in osim file
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.
- Ayman Habib
- Posts: 2248
- Joined: Fri Apr 01, 2005 12:24 pm
RE: Segment definitions in osim file
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
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