Contact Forces and Contact Geometry

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Ayman Habib
Posts: 2252
Joined: Fri Apr 01, 2005 12:24 pm

Re: Contact Forces and Contact Geometry

Post by Ayman Habib » Sat Jul 27, 2013 4:58 pm

Hi Omar,

If you need multiple contacts (which seems to be the case here) you'll need to define multiple forces (each one containing only two pieces of geometry) and then the ForceReporter will report results for each individual force.

Hope this helps,
-Ayman

User avatar
Omar Sheikh
Posts: 13
Joined: Tue Apr 02, 2013 10:12 am

Re: Contact Forces and Contact Geometry

Post by Omar Sheikh » Tue Jul 30, 2013 10:18 am

I tried including additional contact parameters for the combinations of two objects that I wanted but
I ended up getting repeat forces. My goal is to measure the respective contacts between cont2distph, cont3distph, cont4distph, and cont5distph and the ball. Below is how I attempted to define the relevant contact forces but I ended up getting repeat forces when I ran the ForceReporter.

Code: Select all

<ElasticFoundationForce>
					<!--Flag indicating whether the force is disabled or not. Disabled means that the force is not active in subsequent dynamics realizations.-->
					<isDisabled>false</isDisabled>
					<!--Material properties.-->
					<ElasticFoundationForce::ContactParametersSet name="contact_parameters">
						<objects>
							<ElasticFoundationForce::ContactParameters>
								<!--Names of geometry objects affected by these parameters.-->
								<geometry>cont2distph cont3distph cont4distph cont5distph ball</geometry>
								<stiffness>1500000</stiffness>
								<dissipation>0.1</dissipation>
								<static_friction>25</static_friction>
								<dynamic_friction>25</dynamic_friction>
								<viscous_friction>10</viscous_friction>
							</ElasticFoundationForce::ContactParameters>
							<ElasticFoundationForce::ContactParameters>
								<!--Names of geometry objects affected by these parameters.-->
								<geometry>cont2distph ball</geometry>
								<stiffness>1500000</stiffness>
								<dissipation>0.1</dissipation>
								<static_friction>25</static_friction>
								<dynamic_friction>25</dynamic_friction>
								<viscous_friction>10</viscous_friction>
							</ElasticFoundationForce::ContactParameters>
								<ElasticFoundationForce::ContactParameters>
								<!--Names of geometry objects affected by these parameters.-->
								<geometry>cont3distph ball</geometry>
								<stiffness>1500000</stiffness>
								<dissipation>0.1</dissipation>
								<static_friction>25</static_friction>
								<dynamic_friction>25</dynamic_friction>
								<viscous_friction>10</viscous_friction>
							</ElasticFoundationForce::ContactParameters>
							<ElasticFoundationForce::ContactParameters>
								<!--Names of geometry objects affected by these parameters.-->
								<geometry>cont4distph ball</geometry>
								<stiffness>1500000</stiffness>
								<dissipation>0.1</dissipation>
								<static_friction>25</static_friction>
								<dynamic_friction>25</dynamic_friction>
								<viscous_friction>10</viscous_friction>
							</ElasticFoundationForce::ContactParameters>
							<ElasticFoundationForce::ContactParameters>
								<!--Names of geometry objects affected by these parameters.-->
								<geometry>cont5distph ball</geometry>
								<stiffness>1500000</stiffness>
								<dissipation>0.1</dissipation>
								<static_friction>25</static_friction>
								<dynamic_friction>25</dynamic_friction>
								<viscous_friction>10</viscous_friction>
							</ElasticFoundationForce::ContactParameters>
						</objects>
						<groups />
					</ElasticFoundationForce::ContactParametersSet>
					<!--Slip velocity (creep) at which peak static friction occurs.-->
					<transition_velocity>10</transition_velocity>
				</ElasticFoundationForce>

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

Re: Contact Forces and Contact Geometry

Post by Ayman Habib » Tue Jul 30, 2013 2:09 pm

Hi Omar,

Sorry if my suggestion wasn't clear but my proposal was to use multiple <ElasticFoundationForce> rather than adding different ContactParameter(s) to a single ElasticFoundationForce. Since each force is self contained, you'll get the results for each force separately by the ForceReporter while the forward simulation will take all of them into account.

Hope this helps,
-Ayman

User avatar
Omar Sheikh
Posts: 13
Joined: Tue Apr 02, 2013 10:12 am

Re: Contact Forces and Contact Geometry

Post by Omar Sheikh » Tue Jul 30, 2013 3:19 pm

aymanh wrote:Hi Omar,

Sorry if my suggestion wasn't clear but my proposal was to use multiple <ElasticFoundationForce> rather than adding different ContactParameter(s) to a single ElasticFoundationForce. Since each force is self contained, you'll get the results for each force separately by the ForceReporter while the forward simulation will take all of them into account.

Hope this helps,
-Ayman
That makes quite a bit more sense!

Thanks,
Omar Sheikh

User avatar
Omar Sheikh
Posts: 13
Joined: Tue Apr 02, 2013 10:12 am

Re: Contact Forces and Contact Geometry

Post by Omar Sheikh » Tue Aug 06, 2013 10:22 am

Code: Select all

<ElasticFoundationForce>
					<!--Flag indicating whether the force is disabled or not. Disabled means that the force is not active in subsequent dynamics realizations.-->
					<isDisabled>false</isDisabled>
					<!--Material properties.-->
					<ElasticFoundationForce::ContactParametersSet name="contact_parameters">
						<objects>
							<ElasticFoundationForce::ContactParameters>
								<!--Names of geometry objects affected by these parameters.-->
								<geometry>cont2distph ball</geometry>
								<stiffness>1500000</stiffness>
								<dissipation>0.1</dissipation>
								<static_friction>25</static_friction>
								<dynamic_friction>25</dynamic_friction>
								<viscous_friction>10</viscous_friction>
							</ElasticFoundationForce::ContactParameters>
						</objects>
						<groups />
					</ElasticFoundationForce::ContactParametersSet>
					<!--Slip velocity (creep) at which peak static friction occurs.-->
					<transition_velocity>10</transition_velocity>
				</ElasticFoundationForce>
				<ElasticFoundationForce>
					<!--Flag indicating whether the force is disabled or not. Disabled means that the force is not active in subsequent dynamics realizations.-->
					<isDisabled>false</isDisabled>
					<!--Material properties.-->
					<ElasticFoundationForce::ContactParametersSet name="contact_parameters">
						<objects>
							<ElasticFoundationForce::ContactParameters>
								<!--Names of geometry objects affected by these parameters.-->
								<geometry>cont3distph ball</geometry>
								<stiffness>1500000</stiffness>
								<dissipation>0.1</dissipation>
								<static_friction>25</static_friction>
								<dynamic_friction>25</dynamic_friction>
								<viscous_friction>10</viscous_friction>
							</ElasticFoundationForce::ContactParameters>
						</objects>
						<groups />
					</ElasticFoundationForce::ContactParametersSet>
					<!--Slip velocity (creep) at which peak static friction occurs.-->
					<transition_velocity>10</transition_velocity>
				</ElasticFoundationForce>
				<ElasticFoundationForce>
					<!--Flag indicating whether the force is disabled or not. Disabled means that the force is not active in subsequent dynamics realizations.-->
					<isDisabled>false</isDisabled>
					<!--Material properties.-->
					<ElasticFoundationForce::ContactParametersSet name="contact_parameters">
						<objects>
							<ElasticFoundationForce::ContactParameters>
								<!--Names of geometry objects affected by these parameters.-->
								<geometry>cont4distph ball</geometry>
								<stiffness>1500000</stiffness>
								<dissipation>0.1</dissipation>
								<static_friction>25</static_friction>
								<dynamic_friction>25</dynamic_friction>
								<viscous_friction>10</viscous_friction>
							</ElasticFoundationForce::ContactParameters>
						</objects>
						<groups />
					</ElasticFoundationForce::ContactParametersSet>
					<!--Slip velocity (creep) at which peak static friction occurs.-->
					<transition_velocity>10</transition_velocity>
				</ElasticFoundationForce>
				<ElasticFoundationForce>
					<!--Flag indicating whether the force is disabled or not. Disabled means that the force is not active in subsequent dynamics realizations.-->
					<isDisabled>false</isDisabled>
					<!--Material properties.-->
					<ElasticFoundationForce::ContactParametersSet name="contact_parameters">
						<objects>
							<ElasticFoundationForce::ContactParameters>
								<!--Names of geometry objects affected by these parameters.-->
								<geometry>cont5distph ball</geometry>
								<stiffness>1500000</stiffness>
								<dissipation>0.1</dissipation>
								<static_friction>25</static_friction>
								<dynamic_friction>25</dynamic_friction>
								<viscous_friction>10</viscous_friction>
							</ElasticFoundationForce::ContactParameters>
						</objects>
						<groups />
					</ElasticFoundationForce::ContactParametersSet>
					<!--Slip velocity (creep) at which peak static friction occurs.-->
					<transition_velocity>10</transition_velocity>
				</ElasticFoundationForce>
I have split the ElasticFoundationForce into four EFFs. I'm trying to understand how OpenSim interprets this code. Does each contact between the ball and a contdistph give me the contact force between the two objects? The ForceReporter, however, reports the force of the second metacarpal (on the ball). (The secondmc is the body of attachment for the ball.) Does the defined contact always include the force of the body of attachment on the object?

User avatar
Ajay Seth
Posts: 136
Joined: Thu Mar 15, 2007 10:39 am

Re: Contact Forces and Contact Geometry

Post by Ajay Seth » Tue Aug 06, 2013 4:07 pm

The ForceReporter reports the force and moment applied to the bodies involved in the Force element and is reported in the body's reference frame and not in the contact geometry frame. In the case of contact, it reports the resultant forces acting on bodies that are in contact. If there are multiple contact geometries associated with a body, and they are in contact, then it is the net force and moment- for example the ball in your case will have the net force of all the contact elements on the fingers that are in contact with the ball. The contact elements on individual fingers or metacarpal bones are also reported in their respective bodies. If you have only one contact geometry element per metacarpal then it is the force and moment of that contact geometry on that body. If you want the force on the ball imparted by a single metacarpal element, you can put in a separate Force element for each couple as Ayman suggested OR you can solve for the equivalent point on the metacarpal's contact geometry's surface (based on the body force reported) that yields the same net moment to get the point of force application and reverse the force direction to get the applied force on the ball at the same point.

POST REPLY