Skip to content

Instantly share code, notes, and snippets.

@adamkewley
Created January 3, 2023 10:23
Show Gist options
  • Save adamkewley/34737d93edd7c596b98b7138ebb57720 to your computer and use it in GitHub Desktop.
Save adamkewley/34737d93edd7c596b98b7138ebb57720 to your computer and use it in GitHub Desktop.
osim file that segfaults OpenSim 4.4
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSimDocument Version="40000">
<Model name="model">
<!--The model's ground reference frame.-->
<Ground name="ground">
<!--The geometry used to display the axes of this Frame.-->
<FrameGeometry name="frame_geometry">
<!--Path to a Component that satisfies the Socket 'frame' of type Frame.-->
<socket_frame>..</socket_frame>
<!--Scale factors in X, Y, Z directions respectively.-->
<scale_factors>0.20000000000000001 0.20000000000000001 0.20000000000000001</scale_factors>
</FrameGeometry>
</Ground>
<!--List of bodies that make up this model.-->
<BodySet name="bodyset">
<objects>
<Body name="new_body">
<!--The geometry used to display the axes of this Frame.-->
<FrameGeometry name="frame_geometry">
<!--Path to a Component that satisfies the Socket 'frame' of type Frame.-->
<socket_frame>..</socket_frame>
<!--Scale factors in X, Y, Z directions respectively.-->
<scale_factors>0.20000000000000001 0.20000000000000001 0.20000000000000001</scale_factors>
</FrameGeometry>
<!--The mass of the body (kg)-->
<mass>1</mass>
<!--The location (Vec3) of the mass center in the body frame.-->
<mass_center>0 0 0</mass_center>
<!--The elements of the inertia tensor (Vec6) as [Ixx Iyy Izz Ixy Ixz Iyz] measured about the mass_center and not the body origin.-->
<inertia>1 1 1 0 0 0</inertia>
</Body>
</objects>
<groups />
</BodySet>
<!--List of joints that connect the bodies.-->
<JointSet name="jointset">
<objects>
<FreeJoint name="freejoint">
<!--Path to a Component that satisfies the Socket 'parent_frame' of type PhysicalFrame (description: The parent frame for the joint.).-->
<socket_parent_frame>/ground</socket_parent_frame>
<!--Path to a Component that satisfies the Socket 'child_frame' of type PhysicalFrame (description: The child frame for the joint.).-->
<socket_child_frame>/bodyset/new_body</socket_child_frame>
<!--List containing the generalized coordinates (q's) that parameterize this joint.-->
<coordinates>
<Coordinate name="rx">
<!--All properties of this object have their default values.-->
</Coordinate>
<Coordinate name="ry">
<!--All properties of this object have their default values.-->
</Coordinate>
<Coordinate name="rz">
<!--All properties of this object have their default values.-->
</Coordinate>
<Coordinate name="tx">
<!--All properties of this object have their default values.-->
</Coordinate>
<Coordinate name="ty">
<!--All properties of this object have their default values.-->
</Coordinate>
<Coordinate name="tz">
<!--All properties of this object have their default values.-->
</Coordinate>
</coordinates>
</FreeJoint>
</objects>
<groups />
</JointSet>
<!--Forces in the model (includes Actuators).-->
<ForceSet name="forceset">
<objects>
<SpringGeneralizedForce />
</objects>
<groups />
</ForceSet>
</Model>
</OpenSimDocument>
@adamkewley
Copy link
Author

Source of the fault is L71: SpringGeneralizedForce contains an optional coordinate property that the source code does not handle correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment