ExternalForce.any shows “Not Loaded” and external forces do not appear in FullBody_GRFPrediction MoCap model

Hello,

I am using the AnyMoCap FullBody_GRFPrediction model and I want to add external forces applied to both hands. I created an ExternalForce.any file inside the Setup folder and defined two AnyForce3D objects referencing the glove segments.

I added the path in the main file as follows:

anyscript
#path MOCAP_EXTERNAL_FORCE "Setup/ExternalForce.any"

My main file ends like this:

anyscript
// Include the AnyMoCap Framework
#include "<ANYMOCAP_MODEL>"

Inside ExternalForce.any I have:

anyscript
AnyFolder ExternalForces = {

AnyForce3D RightHandWeight = {
F = 9.81*{0.0, 0.0, -10};
AnyRefFrame &RightHand = Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Glove;
};

AnyForce3D LeftHandWeight = {
F = 9.81*{0.0, 0.0, -10};
AnyRefFrame &LeftHand = Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.Glove;
};

};

Problem:

The overall model loads normally and runs both RunParameterIdentification and RunAnalysis without errors.
However, the ExternalForce.any file itself does not load. In the Model it shows:

ExternalForce.any  —  Not Loaded

Even using Reload does not remove that message.

Also, the external forces do not appear in the model (no visible vectors, no additions to the equations of motion).

What I expect

ExternalForce.any should load normally with the rest of the model.
The two external forces should be applied to the glove segments of both hands.

What I have tried

  • Verified the file path and location (Setup/ExternalForce.any)
  • Checked the object path for the glove segment
  • Reloaded the entire model
  • Confirmed that the rest of the model loads and runs correctly

Thank you!

Hi Niloofar

Welcome to the AnyScript Forum!

From what you have described, you have not included your ExternalForce.any file in the model. The statement

#path MOCAP_EXTERNAL_FORCE "Setup/ExternalForce.any"

only tells the model that the identifier MOCAP_EXTERNAL_FORCE points to the path you have specified. It doesn't include the file automatically.

Ideally, you should include your force file through the LabSpecificData.any file or TrialSpecificData.any, depending on if the force is common for all trials or specific to individual trials. Another important point is to include the force in your study. If you create a folder for the force in your model, this folder must be included in the inverse dynamics study for you to see any effect of the force.

Here is an example of how you can include the force file correctly. Please add the following lines in your LabSpecificData.any:

Main = {
  Main.Studies.InverseDynamicStudy.ModelEnvironmentConnection = {
    // ExternalForce.any must be in the same folder as LabSpecificData.any
    #include "ExternalForce.any" 
  };
};

Best regards,
Dave

Hi Dave,

Thank you very much for your detailed explanation and guidance.

I followed your suggestions by including the ExternalForce.any file through LabSpecificData.any and making sure it was properly added to the inverse dynamics study. After doing this, the external forces were correctly applied and the model now works as expected.

I really appreciate your help and clear instructions.

Best regards,
Niloofar

Hi Niloofar,

That's great! Thank you for letting us know.

Best regards,
Dave