Adding Prescribed Force to my model
Posted: Mon Sep 23, 2019 10:24 pm
Hi all,
I have a fullbody model in OpenSIM and have a .mot file of the model raising its arm.
I wanted to implement the motion with force attached to the model's hand in the -y direction so that it can be seen as the model is lifting a heavy object. I figured out that PrescribedForce can be a solution to this and added the following code under ForceSet in my .osim file.
The code seems to be right, but there's no difference in the results. I've checked the ForceReporter in the Analyze Tool and tried plotting the joint moment of the motion with/without the Prescribed Force, but the results are same. Can someone help me in successfully applying Prescribed Force? Thank you in advance.
I have a fullbody model in OpenSIM and have a .mot file of the model raising its arm.
I wanted to implement the motion with force attached to the model's hand in the -y direction so that it can be seen as the model is lifting a heavy object. I figured out that PrescribedForce can be a solution to this and added the following code under ForceSet in my .osim file.
Code: Select all
<!--Forces in the model (includes Actuators).-->
<ForceSet name="forceset">
<PrescribedForce name="prescribedF">
<!--Flag indicating whether the force is disabled or not. Disabled means that the force is not active in subsequent dynamics realizations.-->
<isDisabled>false</isDisabled>
<!--Name of the body the force is applied to.-->
<body>hand_r</body>
<!--Flag indicating whether the point (specified in pointFunctions) is in global frame.-->
<pointIsGlobal>false</pointIsGlobal>
<!--Flag indicating whether the quantities (specified in force/torqueFunctions) is in global frame.-->
<forceIsGlobal>true</forceIsGlobal>
<!--Three functions describing the force to be applied.-->
<FunctionSet name="forceFunctions">
<forceFunctions>
<function>
<Constant name="forceX">
<value>0</value>
</Constant>
</function>
<function>
<Constant name="forceY">
<value>-100</value>
</Constant>
</function>
<function>
<Constant name="forceZ">
<value>0</value>
</Constant>
</function>
</forceFunctions>
</FunctionSet>
<!--Three functions describing the location at which the force is applied.-->
<FunctionSet name="pointFunctions">
<pointFunctions>
<function>
<Constant name="pointX">
<value>0</value>
</Constant>
</function>
<function>
<Constant name="pointY">
<value>0</value>
</Constant>
</function>
<function>
<Constant name="pointZ">
<value>0</value>
</Constant>
</function>
</pointFunctions>
</FunctionSet>
</PrescribedForce>