Skip to content

Instantly share code, notes, and snippets.

@adamkewley
Created January 3, 2023 09:04
Show Gist options
  • Select an option

  • Save adamkewley/60620383ea94c9ad93f3c430b8964558 to your computer and use it in GitHub Desktop.

Select an option

Save adamkewley/60620383ea94c9ad93f3c430b8964558 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_offset</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>new_body_offset</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>
<!--Physical offset frames owned by the Joint that are typically used to satisfy the owning Joint's parent and child frame connections (sockets). PhysicalOffsetFrames are often used to describe the fixed transformation from a Body's origin to another location of interest on the Body (e.g., the joint center). When the joint is deleted, so are the PhysicalOffsetFrame components in this list.-->
<frames>
<PhysicalOffsetFrame name="ground_offset">
<!--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>
<!--Path to a Component that satisfies the Socket 'parent' of type C (description: The parent frame to this frame.).-->
<socket_parent>/ground</socket_parent>
</PhysicalOffsetFrame>
<PhysicalOffsetFrame name="new_body_offset">
<!--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>
<!--Path to a Component that satisfies the Socket 'parent' of type C (description: The parent frame to this frame.).-->
<socket_parent>/bodyset/new_body</socket_parent>
</PhysicalOffsetFrame>
</frames>
</FreeJoint>
</objects>
<groups />
</JointSet>
<ConstraintSet name="constraintset">
<objects>
<CoordinateCouplerConstraint>
<dependent_coordinate_name>ty</dependent_coordinate_name>
<independent_coordinate_names>tx</independent_coordinate_names>
</CoordinateCouplerConstraint>
</objects>
<groups>
</groups>
</ConstraintSet>
</Model>
</OpenSimDocument>
@adamkewley
Copy link
Author

The source of the fault is because the CoordinateCouplerConstraint on line 95 doesn't define a coupled_coordinates_function

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