Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The topics covered in this section include:

...

Code Block
languagexml
titleSockets and Component Paths
<socket_parent_frame>/ground</socket_parent_frame>
<socket_child_frame>/bodyset/r_humerus</socket_child_frame>
 

Any XML element whose tag begins with socket_ is used to indicate the path to a component (ComponentPath) in the model that should be used to satisfy the socket. Models in OpenSim version 4.0 and greater are hierarchical: components can contain other components. For example, the BodySet component named 'bodyset' contains the Body component 'r_humerus'. We use forward slashes, similar to a file system path or web URL, to indicate the path to a component in the model's hierarchy. In the example above, we use absolute paths (starting with a slash), but relative paths (e.g., ../../some/other/component) also work.

...

Thus, to start our model, we need to define a set of rigid bodies that represent our system. In the <BodySet> section, we define this group of bodies, with the name, mass properties, and visible objects associated with each body. The figure below shows an example of the r_humerus body in the Arm26 model. Note the key tags, such as <mass>, <mass_center>, and <inertia> (and similarly named tags for inertia in other directions).

...

Code Block
languagexml
titleExample XML Code from Model Arm26 to Represent a Body
<Body name="r_humerus">
	<attached_geometry>...</attached_geometry>
	<WrapObjectSet>...</WrapObjectSet>
	<mass>1.8645719999999999</mass>
	<mass_center>0 -0.18049599999999999 0</mass_center>
	<inertia>0.01481 0.0045510000000000004 0.013193 0 0 0</inertia>
</Body>

Every model comes with a Ground body, which exists as a property of a Model, not in the BodySet.

Geometry

In version 4.0, OpenSim supports more types/shapes than in previous versions. You don't have to specify a mesh file to use most analytical shapes (Brick, Sphere, Cylinder, Cone, Ellipsoid). In addition you can specify Mesh to indicate geometry read from a mesh file. You can use .vtp, .stl, or .obj files to visualize geometry. All these types are kinds of Geometry. Check the units of your model and the units of the exported geometry (e.g., from Solidworks) if you are experiencing size/display issues. 

...