Hi there,
I am trying to add an external body to a model, and want to constrain it to the skeleton using a weld joint, then to other external bodies using a pin joint. However, I can't seem to be able to apply both, as the first declared joint for a given body supersedes the other. Is there a way I can set both a weld and pin joint for a body?
Thanks.
Using both pin joint and weld joint
- Ayman Habib
- Posts: 2252
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Using both pin joint and weld joint
Hi Lowell,
The multibody system has to be a tree as such every joint has exactly one parent. You can however use a WeldConstraint instead of a WeldJoint to do the same thing. You may be over-constraining your system though so keep this in mind.
Best regards,
-Ayman
The multibody system has to be a tree as such every joint has exactly one parent. You can however use a WeldConstraint instead of a WeldJoint to do the same thing. You may be over-constraining your system though so keep this in mind.
Best regards,
-Ayman
- Lowell Rose
- Posts: 9
- Joined: Mon Oct 01, 2018 1:48 pm
Re: Using both pin joint and weld joint
Thanks Ayman,
That makes sense, I have been trying to implement the WeldConstraint, however it is having a problem finding the socketframe of the bodies to attach to. In my osim model, there don't appear to be any socketframes explicitly defined, so could you let me know how to use elements from the BodySet in the weld constraint?
Thanks again.
That makes sense, I have been trying to implement the WeldConstraint, however it is having a problem finding the socketframe of the bodies to attach to. In my osim model, there don't appear to be any socketframes explicitly defined, so could you let me know how to use elements from the BodySet in the weld constraint?
Thanks again.
- Ayman Habib
- Posts: 2252
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Using both pin joint and weld joint
Hello,
If you save your model in version 4.0+ and open the model .osim file in a text editor then you'll see the frames or slots for them. Use Help->XML Browser in the application and choose WeldConstraint from the dropdown and you'll see the XML representation of a WeldConstraint including <socket_frame1> and <socket_frame2> allowing you to specify which two frames to be welded. A frame could be Ground, a Body or a frame defined as an offset from another frame.
Hope this helps,
-Ayman
If you save your model in version 4.0+ and open the model .osim file in a text editor then you'll see the frames or slots for them. Use Help->XML Browser in the application and choose WeldConstraint from the dropdown and you'll see the XML representation of a WeldConstraint including <socket_frame1> and <socket_frame2> allowing you to specify which two frames to be welded. A frame could be Ground, a Body or a frame defined as an offset from another frame.
Hope this helps,
-Ayman
- Lowell Rose
- Posts: 9
- Joined: Mon Oct 01, 2018 1:48 pm
Re: Using both pin joint and weld joint
Hi Ayman,
Thanks, I was able to see how a weld constraint should be configured with the XML editor, however I still can't seem to to properly describe a body within the <socketframe_1> or <socketframe_2> tags. Following the example from https://simtk-confluence.stanford.edu:8 ... Sim+Models, doesn't appear to work. Could this be because the model I'm using doesn't contain the <FrameGeometry> components? It is similar to the version of the Gait2393 model without scaling. Am I still able to use the Weld constraint in this case?
Thanks,
Lowell
Thanks, I was able to see how a weld constraint should be configured with the XML editor, however I still can't seem to to properly describe a body within the <socketframe_1> or <socketframe_2> tags. Following the example from https://simtk-confluence.stanford.edu:8 ... Sim+Models, doesn't appear to work. Could this be because the model I'm using doesn't contain the <FrameGeometry> components? It is similar to the version of the Gait2393 model without scaling. Am I still able to use the Weld constraint in this case?
Thanks,
Lowell
- Ayman Habib
- Posts: 2252
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Using both pin joint and weld joint
Hi Lowell,
Here's an example from another example model file saved in 4.0+ file fromat:
Please let us know if that works for you, the specification between the tags above is for a body (pelvis) but any Path to a Frame can be used.
Hope this helps,
-Ayman
Here's an example from another example model file saved in 4.0+ file fromat:
Code: Select all
<socket_frame1>/bodyset/pelvis</socket_frame1>
Hope this helps,
-Ayman
- Lowell Rose
- Posts: 9
- Joined: Mon Oct 01, 2018 1:48 pm
Re: Using both pin joint and weld joint
Hi Ayman,
Thanks for the example, I tried it on the unscaled gait2354_simbody.osim model from OpenSim 4.1, and still got the same error:
RuntimeError: std::exception in 'SimTK::State & OpenSim::Model::initSystem()': Failed to connect Socket 'frame1' of type PhysicalFrame (details: Component 'frame1' could not find '..' of type PhysicalFrame. Make sure a component exists at this path and that it is of the correct type.
This was with trying to use:
I also tried it with the pelvis and got the same error.
Thanks for the example, I tried it on the unscaled gait2354_simbody.osim model from OpenSim 4.1, and still got the same error:
RuntimeError: std::exception in 'SimTK::State & OpenSim::Model::initSystem()': Failed to connect Socket 'frame1' of type PhysicalFrame (details: Component 'frame1' could not find '..' of type PhysicalFrame. Make sure a component exists at this path and that it is of the correct type.
This was with trying to use:
Code: Select all
<socket_frame1> /bodyset/calcn_r </socket_frame1>
I also tried it with the pelvis and got the same error.