Can't import .osim model saved from python - "connectee_name"

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Anthony Gatti
Posts: 4
Joined: Tue Jun 07, 2016 2:50 pm

Can't import .osim model saved from python - "connectee_name"

Post by Anthony Gatti » Tue Oct 16, 2018 1:01 pm

Hi,

I am trying to batch analyze data using scale, IK, and ID. I am working in python to do this.

To test things out, I am trying to save interim results and open them in the GUI. However, I am unable to open the .osim files that were saved from the gui. I get the error:

Code: Select all

Failed to connect Socket 'child_frame' of type PhysicalFrame (details:
Model'LaiArnold2017_refined'::findComponent() cannot find a nameless subcomponent.).
  In Object 'ground_pelvis' of type CustomJoint.
  Thrown at Component.cpp:287 in finalizeConnections().
It seems that the problem in the .osim file has to do with identifying parent and child frames in a joint. In particular, when writing the tag for the sockets, they do not contain the suffix "_connectee_name".

For example, if I export a .osim file from the GUI and we look at the pelvis definition, I get:

Code: Select all

<JointSet>
			<objects>
				<CustomJoint name="ground_pelvis">
					<!--Path to a Component that satisfies the Socket 'parent_frame' of type PhysicalFrame (description: The parent frame for the joint.).-->
					<socket_parent_frame_connectee_name>../ground</socket_parent_frame_connectee_name>
					<!--Path to a Component that satisfies the Socket 'child_frame' of type PhysicalFrame (description: The child frame for the joint.).-->
					<socket_child_frame_connectee_name>../pelvis</socket_child_frame_connectee_name>
					<!--List containing the generalized coordinates (q's) that parameterize this joint.-->
On the 5th line, we have '<socket_parent_frame_connectee_name>' . However, for the file exported from python, using model.printToXML('fileName.osim') I get:

Code: Select all

		<JointSet name="jointset">
			<objects>
				<CustomJoint name="ground_pelvis">
					<!--Path to a Component that satisfies the Socket 'parent_frame' of type PhysicalFrame (description: The parent frame for the joint.).-->
					<socket_parent_frame>../../ground</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>../../bodyset/pelvis</socket_child_frame>
					<!--List containing the generalized coordinates (q's) that parameterize this joint.-->
Again, on the 5th line, you can see that it says `<socket_parent_frame>`, and doesnt have the suffix. I played around a bit to see which of the differences between the files seemed to be causing the error, and it is the lack of _connectee_name. If I add that to the parent and child tags it will now give an import error on the next joint in the file.

Is this a known issue? Is there something I might be doing wrong?

Thanks,

Anthony.

Tags:

User avatar
Anthony Gatti
Posts: 4
Joined: Tue Jun 07, 2016 2:50 pm

Re: Can't import .osim model saved from python - "connectee_name"

Post by Anthony Gatti » Wed Oct 17, 2018 8:01 pm

The problem to this was explained on github, here: https://github.com/opensim-org/opensim- ... -430419758

I had two different versions of opensim. And was trying to open a file built with a newer version (python) with an older build (GUI).

POST REPLY