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!
Socket Error while Implementing Bushing Forces
- David Alexander Basabe
- Posts: 6
- Joined: Wed May 03, 2023 7:42 am
- Nicos Haralabidis
- Posts: 188
- Joined: Tue Aug 16, 2016 1:46 am
Re: Socket Error while Implementing Bushing Forces
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
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
- David Alexander Basabe
- Posts: 6
- Joined: Wed May 03, 2023 7:42 am
Re: Socket Error while Implementing Bushing Forces
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.
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.
- David Alexander Basabe
- Posts: 6
- Joined: Wed May 03, 2023 7:42 am
Re: Socket Error while Implementing Bushing Forces
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().
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().
- Nicos Haralabidis
- Posts: 188
- Joined: Tue Aug 16, 2016 1:46 am
Re: Socket Error while Implementing Bushing Forces
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
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
- David Alexander Basabe
- Posts: 6
- Joined: Wed May 03, 2023 7:42 am
Re: Socket Error while Implementing Bushing Forces
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!
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!
- David Alexander Basabe
- Posts: 6
- Joined: Wed May 03, 2023 7:42 am
Re: Socket Error while Implementing Bushing Forces
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!
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!
- Thomas Uchida
- Posts: 1787
- Joined: Wed May 16, 2012 11:40 am
Re: Socket Error while Implementing Bushing Forces
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.