Contact Forces and Contact Geometry

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Omar Sheikh
Posts: 13
Joined: Tue Apr 02, 2013 10:12 am

Contact Forces and Contact Geometry

Post by Omar Sheikh » Wed Jul 10, 2013 9:43 am

I am working with an upper limb model and I have a list of Contact geometry, with the one of important to me being the ball. Under Contact Forces I can see that there is a contact force listed, but I"m not sure how to record data on the contact force. When I run data analysis the contact force seems to not be recorded.

I appreciate your help. Thanks!

User avatar
Jiang Ping
Posts: 132
Joined: Sun Aug 26, 2012 4:09 am

Re: Contact Forces and Contact Geometry

Post by Jiang Ping » Wed Jul 10, 2013 4:06 pm

Hi,

You are using OpenSim API or Analysis tool in GUI?

best regards,

Jiang

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

Re: Contact Forces and Contact Geometry

Post by Omar Sheikh » Thu Jul 11, 2013 9:26 am

jp123909 wrote:Hi,
https://simtk.org/forums/posting.php?mo ... =91&p=9982
You are using OpenSim API or Analysis tool in GUI?

best regards,

Jiang
I believe that I'm using the Analysis tool. I'm using OpenSim itself (but I'm not sure if that answers your question). It's just that I cannot report a force on the contact object when I try to run an analysis.

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

Re: Contact Forces and Contact Geometry

Post by Ayman Habib » Thu Jul 11, 2013 2:04 pm

Hi Omar,

If you're running the AnalyzeTool from the GUI then you can add a ForceReporter and it will record for each force in the model, the net forces produced by the force. Please consult the doc. page below on how to add ForceReporter from the set of available analyses.
http://simtk-confluence.stanford.edu:80 ... lysis+Tool

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 » Fri Jul 12, 2013 9:25 am

I understand how to run a Force Reporter but the ForceReporter doesn't seem to report the Contact force. That's what I'm having difficulty with

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

Re: Contact Forces and Contact Geometry

Post by Ayman Habib » Fri Jul 12, 2013 9:51 am

Hi Omar,

The followup question is whether you observe contact being enforced when you run a simulation or not. If the former then it's a reporting issue, if the latter then you need to revisit how contact is defined. Please check the Tug-of-war model included with the distribution as it includes a contact-force. Generally you need to define both ContactGeometr(ies) and ContactForce(s) for the contact to take effect.

Best regards,
-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 » Fri Jul 12, 2013 10:32 am

Thank you for your help. I'm seeing that I have indeed not defined a contact force. I am looking at the Tug-of-War model right now in an XML editor but I"m struggling to understand how exactly contact forces are defined.

In the model I am working on a hand is grasping a ball (which is contact geometry, rather than a contact mesh) and I want to know the force of the hand on the ball when grasping. How would I defined that contact force?

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 16, 2013 10:46 am

I'm still not quite sure how to code for a contact force that results from the fingers making contact with the ball. Furthermore, would this force just be in the ForceSet?

User avatar
Jennifer Hicks
Posts: 30
Joined: Wed Sep 07, 2005 4:40 pm

Re: Contact Forces and Contact Geometry

Post by Jennifer Hicks » Mon Jul 22, 2013 11:15 am

Omar -

There are a few models included in the OpenSim distribution that have contact geometry defined. You can take a look at the "BouncingBlock" model and the "ToyDropLandingModel" to see how contact is defined. Please let us know after looking at these models if you have remaining questions.

Best wishes,
Jen

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

Re: Contact Forces and Contact Geometry

Post by Omar Sheikh » Mon Jul 22, 2013 11:51 am

I realized after looking at the User's guide that the contact force was indeed defined in my code.

Below is the code for the contact force.

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>
						</objects>
						<groups />
					</ElasticFoundationForce::ContactParametersSet>
					<!--Slip velocity (creep) at which peak static friction occurs.-->
					<transition_velocity>10</transition_velocity>
				</ElasticFoundationForce>
Below is how the contact geometry is defined.

Code: Select all

		<ContactGeometrySet>
			<objects>
				<ContactMesh name="cont2distph">
					<!--Body name to connect the contact geometry to-->
					<body_name>2distph</body_name>
					<!--Location of geometry center in the body frame-->
					<location>-0.005 0 -0.002</location>
					<!--Orientation of geometry in the body frame-->
					<orientation>-1.7 1.5 0</orientation>
					<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded-->
					<display_preference>4</display_preference>
					<!--Display Color-->
					<color>0 1 1</color>
					<filename>fingerPadScaled0310e-4.obj</filename>
				</ContactMesh>
				<ContactMesh name="cont3distph">
					<!--Body name to connect the contact geometry to-->
					<body_name>3distph</body_name>
					<!--Location of geometry center in the body frame-->
					<location>-0.006 0 -0.002</location>
					<!--Orientation of geometry in the body frame-->
					<orientation>-1.7 1.5 0.1</orientation>
					<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded-->
					<display_preference>4</display_preference>
					<!--Display Color-->
					<color>0 1 1</color>
					<filename>fingerPadScaled0310e-4.obj</filename>
				</ContactMesh>
				<ContactMesh name="cont4distph">
					<!--Body name to connect the contact geometry to-->
					<body_name>4distph</body_name>
					<!--Location of geometry center in the body frame-->
					<location>-0.005 0 -0.003</location>
					<!--Orientation of geometry in the body frame-->
					<orientation>-2.9 1.9 1.2</orientation>
					<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded-->
					<display_preference>4</display_preference>
					<!--Display Color-->
					<color>0 1 1</color>
					<filename>fingerPadScaled0310e-4.obj</filename>
				</ContactMesh>
				<ContactMesh name="cont5distph">
					<!--Body name to connect the contact geometry to-->
					<body_name>5distph</body_name>
					<!--Location of geometry center in the body frame-->
					<location>-0.005 -0.001 -0.004</location>
					<!--Orientation of geometry in the body frame-->
					<orientation>-3.2 2.1 1.55</orientation>
					<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded-->
					<display_preference>4</display_preference>
					<!--Display Color-->
					<color>0 1 1</color>
					<filename>fingerpadL.obj</filename>
				</ContactMesh>
				<ContactSphere name="ball">
					<!--Body name to connect the contact geometry to-->
					<body_name>secondmc</body_name>
					<!--Location of geometry center in the body frame-->
					<location>0.004 -0.05 -0.06</location>
					<!--Orientation of geometry in the body frame-->
					<orientation>0 0 0</orientation>
					<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded-->
					<display_preference>4</display_preference>
					<!--Display Color-->
					<color>0.200000002980232 0.200000002980232 1</color>
					<radius>0.0375</radius>
				</ContactSphere>
			</objects>
			<groups />
		</ContactGeometrySet>
I figured out how to measure contact forces but I'm not sure what forces are being measured. For example, I believe the ForceReporter lists the force exerted by the second metacarpal on the ball.

My goal is to measure the forces exerted by each individual distal phalanges on the ball but I'm not sure how to tell OpenSim to do that. The four distal phalanges corresponding to each finger each have a fingerpad. I want to be able to include the fingerpad in the contact with the ball.

POST REPLY