Socket Error while Implementing Bushing Forces

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
David Alexander Basabe
Posts: 6
Joined: Wed May 03, 2023 7:42 am

Socket Error while Implementing Bushing Forces

Post by David Alexander Basabe » Wed Jul 19, 2023 6:26 am

Hello there,

I am trying to implement Bushing Forces to model the connection between a lower body exoskeleton and the lower limbs. However, when doing so through MATLAB scripting, the following error appears:

'java.lang.RuntimeException: Failed to connect Socket 'parent' of type PhysicalFrame (details: Component
'curvedLever_offset_offset' could not find 'curvedLever_offset' of type PhysicalFrame. Make sure a component
exists at this path and that it is of the correct type.'

What can be done to solve this issue?

Thank you!

Tags:

User avatar
Nicos Haralabidis
Posts: 188
Joined: Tue Aug 16, 2016 1:46 am

Re: Socket Error while Implementing Bushing Forces

Post by Nicos Haralabidis » Wed Jul 19, 2023 2:46 pm

Hey David,

Just some ideas. Should the physical offset frame in your case be: curvedLever_offset_offset or curvedLever_offset? It seems like you may have defined both based in your code snippet?
Does curvedLever_offset already exist in the model? for example, is it defined as a socket_parent_frame/socket_child_frame within a joint definition?

Best,

Nicos

User avatar
David Alexander Basabe
Posts: 6
Joined: Wed May 03, 2023 7:42 am

Re: Socket Error while Implementing Bushing Forces

Post by David Alexander Basabe » Thu Jul 20, 2023 3:39 am

Hey Nicos,

Thank you for your response! That with the double offset was a small experiment. The offset frame should be curvedLever_offset. The curved lever body has two connections to another body, so one I am trying to model as a joint and the other one with the help of bushing forces. In this case I'd say that the offset already exists.

User avatar
David Alexander Basabe
Posts: 6
Joined: Wed May 03, 2023 7:42 am

Re: Socket Error while Implementing Bushing Forces

Post by David Alexander Basabe » Thu Jul 20, 2023 3:42 am

This is the current error:

Java exception occurred:
java.lang.RuntimeException: Failed to connect Socket 'parent' of type PhysicalFrame (details: Component
'curvedLever_offset' could not find 'curvedLever' of type PhysicalFrame. Make sure a component exists at this
path and that it is of the correct type.
Thrown at Component.h:772 in getComponent().).
In Object 'curvedLever_offset' of type PhysicalOffsetFrame.
Thrown at Component.cpp:313 in finalizeConnections().

User avatar
Nicos Haralabidis
Posts: 188
Joined: Tue Aug 16, 2016 1:46 am

Re: Socket Error while Implementing Bushing Forces

Post by Nicos Haralabidis » Thu Jul 20, 2023 7:25 am

Hello David,

Are you adding the offset frame to the model after invoking model.initSystem()? If so, I think you need to call model.addComponent(theComponentYouAdded), model.finalizeConnections(), then recall model.initSystem(). You should then be able to add the bushing force. You will have to do these steps again (model.addComponent(theComponentYouAdded), model.finalizeConnections(), then recall model.initSystem()) to get access to a model with necessary bushing force - I believe.

Hope that helps!

Nicos

User avatar
David Alexander Basabe
Posts: 6
Joined: Wed May 03, 2023 7:42 am

Re: Socket Error while Implementing Bushing Forces

Post by David Alexander Basabe » Thu Jul 20, 2023 11:46 pm

Hello Nicos,

thank you very much! I'll give that a go right away! Just to be sure - the component I am adding through addComponent refers to the body right? And these steps have to happen before adding each bushing force? So I must repeat these for each bushing force that I want to add with each body added as a component beforehand? Thank you again!

User avatar
David Alexander Basabe
Posts: 6
Joined: Wed May 03, 2023 7:42 am

Re: Socket Error while Implementing Bushing Forces

Post by David Alexander Basabe » Fri Jul 21, 2023 3:16 am

Hello Nicos,

I have tried the steps you recommended, and now I get the following error:

Java exception occurred:
java.lang.RuntimeException: Failed to connect Socket 'parent' of type PhysicalFrame (details: Component
'tibia_l_offset' could not find 'tibia_l' of type PhysicalFrame. Make sure a component exists at this path
and that it is of the correct type.
Thrown at Component.h:772 in getComponent().).
In Object 'tibia_l_offset' of type PhysicalOffsetFrame.
Thrown at Component.cpp:313 in finalizeConnections().

The new model that I am trying to create is based on an older one which already contains all bodies, joints, etc. of a musculoskeletal model. If I try to add the tibia_l component, I get an error as the component already exists in the model. But somehow it cannot find the frame, which is confusing me a lot. Do you have any ideas on what to do here? Thank you!

User avatar
Thomas Uchida
Posts: 1777
Joined: Wed May 16, 2012 11:40 am

Re: Socket Error while Implementing Bushing Forces

Post by Thomas Uchida » Fri Jul 21, 2023 11:04 am

There are a few examples of adding bushings to models in testForces.cpp. See, for example, testBushingForce(): https://github.com/opensim-org/opensim- ... s.cpp#L601. The code is in C++ but the Matlab interface should follow the same steps.

POST REPLY