Error when enrolled the FDK code into MoCAP-lowerbody model

Hey all,

While performing the example of FDK method into the Mocap model, I get the the following errors.

Implants.any(44): ‘Right’:Unresolved object

Do you konw any ideas abot this problem?

Thanks for your time
Xiaode

Hi Xiaode welcome to the group!

Can you explain a little bit more about what you are trying to do? Which example are you following? Which joint are you replacing with FDK, Hip or Knee?

Best Regards,
Christine

Hi Christine, thanks for your reply.

I want to put the example TKA-KneeBendDemo into the Mocap_Lowerbody model.

When I replace the standard knee joint with FDK knee joint, I got the following error:

Implants.any(44): ‘Right’:Unresolved object.

The repository I used was AMMR v1.6.2.

PS: I did two steps for the replacing prcess: first, I copied the .stl file (lied in Input file) and .any file (lied in Model file) in the TKA-KneeBendDemo to the corresponding file in Mocap_Lowerbody model. Then, I added the same TKA FDK anyscript code to the Mocap_Lowerbody model main.any file.
Is this correct for replacing the standard knee joint with FDK knee joint?

Thanks for your time.

Best Regards,
Xiaode

Hi Xiaode,

Can you attach you please attach your Mocap_Lowerbody model main.any file please so I can better see what is going wrong?

Best Regards,
Christine

Hi Christine,

Thanks for your kindness.

I have attached the file as your wish.

Looking forward to your reply~

Thank you very much.
Best Regatds,
Xiaode
Error when combined FDK and Mocap example.zip (899.9 KB)

What version of AMS are you using?

Thanks for your reply.

I use the 6.0.5 version. The example is from the AMMR 1.6.2.

Best Regards,
Xiaode

Hi Xiaode,

Incorporating the FDK knee into the Mocap model would be quite the endeavour, even for an experienced user, and especially starting from an old AMMR. I recommend that you first update to the newest version of AMS and the AMMR so you can begin by using the following parameter:

#define BM_JOINT_TYPE_KNEE_RIGHT _JOINT_TYPE_USERDEFINED_

https://anyscript.org/ammr-doc/bm_config/bm_statements.html#bm-joint-type-knee-right

If this is something you cannot do, you should start by the following:

1.) Delete the following lines of code you added in:

// This file from the KneeBendDemo.Main file:

// Include an operation sequence to run all required steps of your application (see Operations tab)
#include "<ANYBODY_PATH_TOOLBOX>\Operations\RunAppSequence.any"   

// Include default human model 
#include "<ANYBODY_PATH_BODY>/HumanModel.any"
AnyFolder ModelEnvironmentConnection = {
   AnyFolder &HumanModel=.HumanModel;
   #include "Model/JointsAndDrivers.any"
};

// This file from the the KneeBendDemo.Main file::
AnyFolder ModelEnvironmentConnection = {
AnyFolder &HumanModel=.HumanModel;
#include "Model/JointsAndDrivers.any"
};

2.) Make sure to use #if statement for the following in Model folder:

 // This file includes the geometry of the implants and defines
// the attachment points of the ligaments.    
#if USE_FDK 
  #include "Model/Implants.any"
#endif

Then again within the Studies folder change, and change paths for FDK settings:

#if USE_FDK 
  // This file implements the new joint definition for the contact knee.
  #include "Model/ContactForces.any"
  #include "Model/KneeExchange.any"
  [...]
  #endif

For all the FDK solver settings you defined change all your paths from ‘InverseDynamics.’ to :

#if USE_FDK  & InverseDynamicModel == 1
Main.Studies.InverseDynamicStudy.InverseDynamics.ForceDepKinOnOff=On;   
[...]
#endif

3.) This step might take some time…Start trying to load your model, you will need to reroute many lines of code. Usually the error message reads something like:

ERROR(SCR.PRS9) : C:/U…s/cmd/D…s/o…g/A…2/A…n/E…s/M…l/M…l/KneeExchange.any(32) : ‘Insertion_patella_tendon’ : Unresolved object

and it points to this:

AnyRefNode &Insertion_patella_tendon = 
Main.HumanModel.BodyModel.Right.Leg.Seg.Shank.Insertion_patella_tendon;

you will need to correct the path since your Human model lives within ‘Studies’:

AnyRefNode &Insertion_patella_tendon = 
Main.Studies.HumanModel.BodyModel.Right.Leg.Seg.Shank.Insertion_patella_tendon;

Keep doing this for all broken paths. Don’t forget to do this within these files as well:
#include “TibiaFemoralContactForces.any”
#include “PatellaImplantContactForces.any”
#include “Model/Implants.any” and so on…

some other error will occur due to incorrect paths are:
ERROR(SCR.PRS9) : C:/U…s/cmd/D…s/o…g/A…2/A…n/E…s/M…l/M…l/Kinematics.any(28) : ‘EnvironmentModel’ : Unresolved object

ERROR(SCR.PRS9) : C:/U…s/cmd/D…s/o…g/A…2/A…n/E…s/M…l/M…l/Mannequin.any(6) : ‘ModelSetup’ : Unresolved object

This is because the ModelSetup and Enviroment folders now live within Main.Model, so change these accordingly…

Finally you will need the following DrawSettings file, there will still be an error saying .ImplantsOpacity.Bone doesn’t exist, you can change it to ImplantOpacitiy. *name of the component of interest
DrawSettings.any (4.6 KB)

This should help you get started.

Best Regards,
Christine

Hi Christine,

Thanks very much for your careful reply.

I will try again following your advice.

Thanks again for your time.

Best Regards,
Xiaode