Adding Contact Geometries to the Gait2392 Model

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
D T
Posts: 24
Joined: Thu Nov 21, 2019 3:40 pm

Adding Contact Geometries to the Gait2392 Model

Post by D T » Wed May 27, 2020 11:52 am

Hi all,

I was just wondering if I could get some information on adding contact geometries to the Gait2392 model. I tried adding the following geometry set, but ran in to a few issues.

Code: Select all

<ContactGeometrySet>
			<objects>
				<ContactHalfSpace name="platform">
					<!--Body name to connect the contact geometry to-->
					<body_name>ground</body_name>
					<!--Location of geometry center in the body frame-->
					<location>0 0 0</location>
					<!--Orientation of geometry in the body frame-->
					<orientation>0 0 -1.5707963267949</orientation>
				</ContactHalfSpace>
				<ContactSphere name="r_heel">
					<!--Body name to connect the contact geometry to-->
					<body_name>calcn_r</body_name>
					<!--Location of geometry center in the body frame-->
					<location>0.01 0.02 -0.005</location>
					<!--Orientation of geometry in the body frame-->
					<orientation>0 0 0</orientation>
					<radius>0.04</radius>
				</ContactSphere>
				<ContactSphere name="r_toe">
					<!--Body name to connect the contact geometry to-->
					<body_name>toes_r</body_name>
					<!--Location of geometry center in the body frame-->
					<location>0.04 0.02 0.014</location>
					<!--Orientation of geometry in the body frame-->
					<orientation>0 0 0</orientation>
					<radius>0.04</radius>
				</ContactSphere>
				<ContactSphere name="l_heel">
					<!--Body name to connect the contact geometry to-->
					<body_name>calcn_l</body_name>
					<!--Location of geometry center in the body frame-->
					<location>0.01 0.02 0.005</location>
					<!--Orientation of geometry in the body frame-->
					<orientation>0 0 0</orientation>
					<radius>0.04</radius>
				</ContactSphere>
				<ContactSphere name="l_toe">
					<!--Body name to connect the contact geometry to-->
					<body_name>toes_l</body_name>
					<!--Location of geometry center in the body frame-->
					<location>0.04 0.02 -0.014</location>
					<!--Orientation of geometry in the body frame-->
					<orientation>0 0 0</orientation>
					<radius>0.04</radius>
				</ContactSphere>
			</objects>
			<groups />
		</ContactGeometrySet>
Ground is defined just as it is in the default model - the treadmill geometry ground plane defined at the beginning of the osim file. It is my understanding that ground needs to be defined as a body to be referenced in the above code, but I am unsure of how to alter the model so that the references do not give me errors such as:
"Failed to connect Socket 'frame' of type PhysicalFrame (details: Connectee for Socket 'frame' of type PhysicalFrame in ContactSphere at /contactgeometryset/r_heel is unspecified. ......:

Any guidance or help is appreciated.
Thanks,
Dylan

Tags:

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

Re: Adding Contact Geometries to the Gait2392 Model

Post by Ayman Habib » Wed May 27, 2020 12:07 pm

Hello,

The model file format has changed from version 3.3 to 4.0, accordingly you should not cut and paste XML snippet from one file format to the other. The format is specified by a Document Version at the top.
The recommended pathway is to use the GUI XML-Browser to see the new format, copy the XML snippet to the file (which has to be saved in the latest format as well) and populate it. Alternatively you can copy a snippet from another model file on the same format that has ContactGeometry and populate.

If you're more comfortable with the older version 3.3 XML format, you can do the editing/copying/populating in version 3.3, then open the model in 4.0 to get the conversion for free, however when you save it the model file will be upgraded to the latest format and you can't go back.

Hope this helps,
-Ayman

User avatar
D T
Posts: 24
Joined: Thu Nov 21, 2019 3:40 pm

Re: Adding Contact Geometries to the Gait2392 Model

Post by D T » Wed May 27, 2020 4:03 pm

aymanh wrote:
Wed May 27, 2020 12:07 pm
Hello,

The model file format has changed from version 3.3 to 4.0, accordingly you should not cut and paste XML snippet from one file format to the other. The format is specified by a Document Version at the top.
The recommended pathway is to use the GUI XML-Browser to see the new format, copy the XML snippet to the file (which has to be saved in the latest format as well) and populate it. Alternatively you can copy a snippet from another model file on the same format that has ContactGeometry and populate.

If you're more comfortable with the older version 3.3 XML format, you can do the editing/copying/populating in version 3.3, then open the model in 4.0 to get the conversion for free, however when you save it the model file will be upgraded to the latest format and you can't go back.

Hope this helps,
-Ayman
Ah, thank you - I was not aware I was using code from the previous format. I'll make sure to find an example with the proper XML and alter it accordingly.

POST REPLY