Adding muscles to existing model

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Kyle Wood
Posts: 2
Joined: Wed Mar 11, 2020 3:09 pm

Adding muscles to existing model

Post by Kyle Wood » Sat Sep 17, 2022 12:11 pm

I copy and pasted muscles from an upper extremity model to the existing Wu Shoulder Model. The first few muscles in the list don't give any errors and are visualized in the GUI. The error I get below in the GUI is with the Supinator or SUP muscle in the file. I have not been able to figure out how to fix this issue on my own. I also included the code from the XML file below. I appreciate any help, thanks!

Failed to connect Socket 'parent_frame' of type PhysicalFrame (details: Connectee for Socket 'parent_frame' of type PhysicalFrame in PathWrapPoint at /forceset/SUP/geometrypath/pathwrap/pwpt1 is unspecified. If this model was built programmatically, perhaps finalizeConnections() was not called before printing.
Thrown at Component.h:3345 in finalizeConnection().).
In Object 'pwpt1' of type PathWrapPoint.
Thrown at Component.cpp:313 in finalizeConnections().

Code: Select all

<Millard2012EquilibriumMuscle name="SUP">
					<!--Flag indicating whether the force is applied or not. If true the forceis applied to the MultibodySystem otherwise the force is not applied.NOTE: Prior to OpenSim 4.0, this behavior was controlled by the 'isDisabled' property, where 'true' meant that force was not being applied. Thus, if 'isDisabled' is true, then 'appliesForce` is false.-->
					<appliesForce>true</appliesForce>
					<!--The set of points defining the path of the actuator.-->
					<GeometryPath name="geometrypath">
						<!--The set of points defining the path-->
						<PathPointSet>
							<objects>
								<PathPoint name="SUP-P1">
									<!--Path to a Component that satisfies the Socket 'parent_frame' of type PhysicalFrame (description: The frame in which this path point is defined.).-->
									<socket_parent_frame>/bodyset/radius</socket_parent_frame>
									<!--The fixed location of the path point expressed in its parent frame.-->
									<location>0.0099600000000000001 -0.06096 0.00075000000000000002</location>
								</PathPoint>
								<PathPoint name="SUP-P2">
									<!--Path to a Component that satisfies the Socket 'parent_frame' of type PhysicalFrame (description: The frame in which this path point is defined.).-->
									<socket_parent_frame>/bodyset/radius</socket_parent_frame>
									<!--The fixed location of the path point expressed in its parent frame.-->
									<location>0.01201 -0.051700000000000003 -0.00107</location>
								</PathPoint>
								<PathPoint name="SUP-P3">
									<!--Path to a Component that satisfies the Socket 'parent_frame' of type PhysicalFrame (description: The frame in which this path point is defined.).-->
									<socket_parent_frame>/bodyset/ulna</socket_parent_frame>
									<!--The fixed location of the path point expressed in its parent frame.-->
									<location>-0.013599999999999999 -0.033840000000000002 0.020129999999999999</location>
								</PathPoint>
							</objects>
							<groups />
						</PathPointSet>
						<!--The wrap objects that are associated with this path-->
						<PathWrapSet>
							<objects>
								<PathWrap name="pathwrap">
									<!--A WrapObject that this PathWrap interacts with.-->
									<wrap_object>SUP</wrap_object>
									<!--The wrapping method used to solve the path around the wrap object.-->
									<method>hybrid</method>
									<!--The range of indices to use to compute the path over the wrap object.-->
									<range>-1 -1</range>
								</PathWrap>
							</objects>
							<groups />
						</PathWrapSet>
						<!--Default appearance attributes for this GeometryPath-->
						<Appearance>
							<!--Flag indicating whether the associated Geometry is visible or hidden.-->
							<visible>false</visible>
							<!--The color, (red, green, blue), [0, 1], used to display the geometry. -->
							<color>0.80000000000000004 0.10000000000000001 0.10000000000000001</color>
						</Appearance>
					</GeometryPath>
					<!--Maximum isometric force that the fibers can generate-->
					<max_isometric_force>379.60000000000002</max_isometric_force>
					<!--Optimal length of the muscle fibers-->
					<optimal_fiber_length>0.033000000000000002</optimal_fiber_length>
					<!--Resting length of the tendon-->
					<tendon_slack_length>0.028000000000000001</tendon_slack_length>
					<!--Angle between tendon and fibers at optimal fiber length expressed in radians-->
					<pennation_angle_at_optimal>0</pennation_angle_at_optimal>
					<!--Maximum contraction velocity of the fibers, in optimal fiberlengths/second-->
					<max_contraction_velocity>10</max_contraction_velocity>
					<!--Compute muscle dynamics ignoring tendon compliance. Tendon is assumed to be rigid.-->
					<ignore_tendon_compliance>false</ignore_tendon_compliance>
					<!--Compute muscle dynamics ignoring activation dynamics. Activation is equivalent to excitation.-->
					<ignore_activation_dynamics>false</ignore_activation_dynamics>
					<!--Assumed initial activation level if none is assigned.-->
					<default_activation>0</default_activation>
					<!--Activation lower bound.-->
					<minimum_activation>0</minimum_activation>
					<!--Active-force-length curve.-->
					<ActiveForceLengthCurve name="SUP_ActiveForceLengthCurve">
						<!--Normalized fiber length where the steep ascending limb starts-->
						<min_norm_active_fiber_length>0.43269999999999997</min_norm_active_fiber_length>
						<!--Normalized fiber length where the steep ascending limb transitions to the shallow ascending limb-->
						<transition_norm_fiber_length>0.72799999999999998</transition_norm_fiber_length>
						<!--Normalized fiber length where the descending limb ends-->
						<max_norm_active_fiber_length>1.595</max_norm_active_fiber_length>
						<!--Slope of the shallow ascending limb-->
						<shallow_ascending_slope>0.46129999999999999</shallow_ascending_slope>
						<!--Minimum value of the active-force-length curve-->
						<minimum_value>0</minimum_value>
					</ActiveForceLengthCurve>
					<!--Force-velocity curve.-->
					<ForceVelocityCurve name="SUP_ForceVelocityCurve">
						<!--Curve slope at the maximum normalized concentric (shortening) velocity (normalized velocity of -1)-->
						<concentric_slope_at_vmax>0</concentric_slope_at_vmax>
						<!--Curve slope just before reaching concentric_slope_at_vmax-->
						<concentric_slope_near_vmax>0.25</concentric_slope_near_vmax>
						<!--Curve slope at isometric (normalized velocity of 0)-->
						<isometric_slope>5</isometric_slope>
						<!--Curve slope at the maximum normalized eccentric (lengthening) velocity (normalized velocity of 1)-->
						<eccentric_slope_at_vmax>0</eccentric_slope_at_vmax>
						<!--Curve slope just before reaching eccentric_slope_at_vmax-->
						<eccentric_slope_near_vmax>0.14999999999999999</eccentric_slope_near_vmax>
						<!--Curve value at the maximum normalized eccentric contraction velocity-->
						<max_eccentric_velocity_force_multiplier>1.3999999999999999</max_eccentric_velocity_force_multiplier>
					</ForceVelocityCurve>
					<!--Passive-force-length curve.-->
					<FiberForceLengthCurve name="SUP_FiberForceLengthCurve">
						<!--Fiber strain at zero force-->
						<strain_at_zero_force>0</strain_at_zero_force>
						<!--Fiber strain at a tension of 1 normalized force-->
						<strain_at_one_norm_force>0.64049999999999996</strain_at_one_norm_force>
						<!--Fiber stiffness at the end of the low-force region-->
						<stiffness_at_low_force>0.0751</stiffness_at_low_force>
						<!--Fiber stiffness at a tension of 1 normalized force-->
						<stiffness_at_one_norm_force>6.3163</stiffness_at_one_norm_force>
						<!--Fiber curve bend, from linear (0) to maximum bend (1)-->
						<curviness>0.66579999999999995</curviness>
					</FiberForceLengthCurve>
					<!--Tendon-force-length curve.-->
					<TendonForceLengthCurve name="SUP_TendonForceLengthCurve">
						<!--Tendon strain at a tension of 1 normalized force-->
						<strain_at_one_norm_force>0.033000000000000002</strain_at_one_norm_force>
						<!--Tendon stiffness at a tension of 1 normalized force-->
						<stiffness_at_one_norm_force>37.393000000000001</stiffness_at_one_norm_force>
						<!--Normalized force developed at the end of the toe region-->
						<norm_force_at_toe_end>0.22550000000000001</norm_force_at_toe_end>
						<!--Tendon curve bend, from linear (0) to maximum bend (1)-->
						<curviness>0.45040000000000002</curviness>
					</TendonForceLengthCurve>
				</Millard2012EquilibriumMuscle>
				

Tags:

User avatar
Ayman Habib
Posts: 2238
Joined: Fri Apr 01, 2005 12:24 pm

Re: Adding muscles to existing model

Post by Ayman Habib » Mon Sep 19, 2022 9:35 am

Hi Kyle,

Looking at the xml snippet you posted, it appears that the name SUP is used for both the muscle and the wrapobject, that could be a problem. Generally it's also important to keep in mind that model files are version specific so you need to make sure the version of the source and destination xml files are the same (OpenSimDocument Version="" at the top of the osim file). If the issue is specific to wrapping and you're not clear on how to specify it in XML, you may add the wrap object to the muscle in the GUI, save the XML file then inspect the file to see how the connection is serialized/deserialized in XML.

Hope this helps,
-Ayman

User avatar
Kyle Wood
Posts: 2
Joined: Wed Mar 11, 2020 3:09 pm

Re: Adding muscles to existing model

Post by Kyle Wood » Mon Sep 19, 2022 1:19 pm

Thank you for the help! I attempted your suggestion by editing the wrapping in the GUI. After going through the XML again, I realized that the SUP Wrap Object didn't have a corresponding WrapCylinder within the Body tags under the Radius WrapObjectSet. I found many other muscles that were copied over have the same issue and will attempt to fix it in the same way.

Snippet of what fixed it:

Code: Select all

<WrapObjectSet name="wrapobjectset">
						<objects>			
							<WrapCylinder name="SUP">
								<!--Whether or not the WrapObject is considered active in computing paths-->
								<active>true</active>
								<!--Body-fixed Euler angle sequence for the orientation of the WrapObject-->
								<xyz_body_rotation>1.4477500000000001 0.30403599999999997 -2.44102</xyz_body_rotation>
								<!--Translation of the WrapObject.-->
								<translation>0.0044999999999999997 -0.043700000000000003 0.0058999999999999999</translation>
								<!--The name of quadrant over which the wrap object is active. For example, '+x' or '-y' to set the sidedness of the wrapping.-->
								<quadrant>-x</quadrant>
								<!--Default appearance for this Geometry-->
								<Appearance>
									<!--Flag indicating whether the associated Geometry is visible or hidden.-->
									<visible>false</visible>
									<!--The opacity used to display the geometry between 0:transparent, 1:opaque.-->
									<opacity>0.5</opacity>
									<!--The color, (red, green, blue), [0, 1], used to display the geometry. -->
									<color>0 1 1</color>
									<!--Visuals applied to surfaces associated with this Appearance.-->
									<SurfaceProperties>
										<!--The representation (1:Points, 2:Wire, 3:Shaded) used to display the object.-->
										<representation>3</representation>
									</SurfaceProperties>
								</Appearance>
								<!--The radius of the cylinder.-->
								<radius>0.0080000000000000002</radius>
								<!--The length of the cylinder.-->
								<length>0.040000000000000001</length>
							</WrapCylinder>

POST REPLY