C3D File

Hi, I am having difficulty loading C3D files. Marker names in my C3D files were different from those in ModelSetup.any. Some of the markers were not in ModelSetup.any. I received the following error message:
“‘PosInterpol’ : Unresolved object.”
I changed the names of the markers and folders in ModelSetup.any as well as removed them.

Next, I had another error:

‘CAL_MATRIX’ : Unresolved object

Does this mean that my C3D file does not include a calibration matrix of a force place?

I also had a different error when I used a different C3D file. I received the following error:

RROR(OBJ.FILE1) :ModelSetup.any : ModelSetup.C3DFileData.FileName : Problem with file :Target Match01.c3d : The group names in the c3d file are not unique

Is there anything wrong in the name of C3D file?

Please, let me know how to fix them.

Thank you very much.

Hi,

You have to change the names of the markers in the ModelSetup.any file to match the ones in your C3D file, as well as create new markers or delete them if needed. It seems you did that correctly aleady.

The calibration matrix comes from the force plate. First you have to check in your C3D file what is the type of the force plate (type 1, 2 ,3 or 4). Not all the types use a calibration matrix. When you know the type of the plate select the corresponding class in the script (at the top of the main file and in the Environment file.

The last error means that several markers in the C3D file have the same name. Keep in mind to avoid this when recording a trial.

Best regards, Sylvain.

Hi, thank you very much for help.

I went to C3D.ORG site and checked the force plate type of our system. Our Vicon system is Nexus, and I believe that our force plate type is type 2. I made the following changes:

In GaitFullBody.main.any

#include “…/…/…/Body/AAUHuman/ToolBox/Mocap/ForcePlateType2AutoDetection.any”
#include “…/…/…/Body/AAUHuman/ToolBox/Mocap/ForcePlateType2.any”

In Environment.any,

ForcePlateType2 Plate1 (######)
ForcePlateType2 Plate2 (######)
ForcePlateType2 Plate3 (######)

In EnvironmentAutoDection.any,

ForcePlateType2AutoDetection Plate1 (######)
ForcePlateType2AutoDetection Plate2 (######)
ForcePlateType2AutoDetection Plate3 (######)

I received the below error:
EnvironmentAutoDetection.any : ‘FootPresent’ : Unknown Class Template argumen

What was I missing? How should I fix it? Please, let me know.

Also, I have another question regarding the error “The group names in the c3d file are not unique”. I checked the names, and it seemed that the names are unique. I looked at the other thread explaining this issue.It said, “the problem in this particular C3d file seems to be that you have two folders named Processing.” If this is my problem, how do I need to fix it? Please, let me know.

Thank you very much.

Hi,

The ForcePlateType2AutoDetection class does not use the ‘FootPresent’ argument like the type 4 does. So just remove it from the argument list in EnvironmentAutoDection.any.
Also you say that you made the changes in both Environment.any and EnvironmentAutoDection.any. I just want to make sure that you use only one of the two files. If you use both you will have the plates in double.

For the non-unique names you may be right, it could also be the folders. Try to check it in your C3D file. But i am not sure of how to fix it… in which thread did you see it? Was there any suggestion already?

Best regards, Sylvain.

Hi, thank you very much for your help.

I had been using only EnvironmentAutoDetection.any and removed ‘FootPresent’ argument. It probably became same as Environment.any. But, I still got the following error in EnvironmentAutoDetection.any or Environment.any:

EnvironmentAutoDetection.any : ‘Cal’ : Unresolved object

Does this error mean that my force plate type is still incorrect? Do you have any idea how to fix it? Please, let me know.

Regarding the non-unique names, the thread I looked at was 6/17/2010 “importing c3d files” in Anybody Managed Model Repository. I couldn’t find any solutions.

Thank you very much.

Hi,

You have to find in the model tree the menber Main.ModelSetup.C3DFileData.Groups.FORCE_PLATFORM.TYPE.Data and check here what is exactly the type. It is not necessarily related to the manufacturer.

Then if this type is supposed to have a call matrix (see that in C3D.org) look for it there Main.ModelSetup.C3DFileData.Groups.FORCE_PLATFORM.CAL_MATRIX.Data to check if it is indeed present.

Also did you search in the C3D file exactly which are the names that are not unique? It can also be something else that the Procesisng folder. You need to be sure of what it is first.

Best regards, Sylvain.

Hi, thanks for your advice. However, I opened the model tree and found it was empty. I am not sure how to check the force plate type in the model tree without loading C3D files and models.

In addition, I have not yet found a method to remove one of the two folders which have the same name.

So, I was wondering if you could check our C3D files and other anybody files which I modified. I have attached two C3D files, processed and unprocessed files. I believe that those have same data and marker names except processed or unprocessed. The processed file gives me the error.

Also, I have attached GaitFullBody.main.any, EnvironmentAutoDetection.any, ModelSetup.any, and TrialSpecificData.any.

Please, check those files and give me some advice.
Thank you very much.

Hi,

Please see this example:

M

ain = {
  // The actual body model goes in this folder
  AnyFolder MyModel = {
    AnyInputC3D test=   {
      FileName = "unprocessed.c3d";
      MarkerUseAllPointsOnOff = On;
    };
  }; // MyModel
};  // Main

it will load your C3D file with no complaints.

The processed data file will not work because it has to folders on the same level named Processed.

Ones you have the file loaded you start exploring the content of the C3D file folders and link.

The c3d files shows that you have one type2 plate
for more details see http://www.c3d.org/html/type2.htm

This can be found by looking at this object in the model above
Main.MyModel.test.Groups.FORCE_PLATFORM.TYPE.Data

This type of plate do not need a calibration matrix, so please make sure the environment file makes use of a type2 plate.

Best regards

Søren

Hi, thank you very much for your reply. In Environment, I removed calibration matrices and force plate 2 and 3, and then changed Fx1, Fy1, Fz1, Mx1, My1, and Mz1 into Fx6, Fy6, Fz6, Mx6, My6, and Mz6. I could load the model using the unprocessed C3D file. But, our coordinate system does not correspond to Anybody’s one. I attached the image. Please, take a look at it.

Regarding the C3D file which contains the two folders, I can’t figure out how to remove one folder. Do you know how to remove one folder in C3D file? Please, let me know.

Thank you very much.

Hi Norio,

It looks like the initial orientation of pelvis needs to be altered… the coordinate system should be ok if the c3d file is correct.

Please have a look in the TrialSpecificData file and modify the pelvisRot variables this will change the initial orientation of the pelvis, and may solve the problem.

Please remember to adjust the gravity vector in the main file to comply with the model.

Best regards
Søren

Hi, thank you very much for your reply. I could adjust the initial orientation of the pelvis.

However, MotionAndParameterOptimzation can’t get completed. Since we don’t have markers for RFIN and LFIN, I was suggested that I should add right and left wrist drivers.

I added the following drivers in ExtraDrivers.any:

//Right Wrist driver
AnyKinEqInterPolDriver WristDriverRight ={
AnyKinMeasureOrg &ref1 =…HumanModel.Interface.Right.WristFlexion;
AnyKinMeasureOrg &ref2 =…HumanModel.Interface.Right.WristAbduction;
Data = pi/180*{
.JntPos.Right.WristFlexion,
.JntPos.Right.WristAbduction
};
Reaction.Type={Off,Off};

//Left Wrist driver
AnyKinEqInterPolDriver WristDriverRight ={
AnyKinMeasureOrg &ref1 =…HumanModel.Interface.Left.WristFlexion;
AnyKinMeasureOrg &ref2 =…HumanModel.Interface.Left.WristAbduction;
Data = pi/180*{
.JntPos.Left.WristFlexion,
.JntPos.Left.WristAbduction
};
Reaction.Type={Off,Off};

However, loading the model was not successful, and I received the following error:

ERROR(SCR.PRS9) : ExtraDrivers.any : ‘WristFlexion’ : Unresolved object

Could you give me any directions to fix it?
Please, let me know.

Thank you very much.

Hi,

It means that the relative path to the Interface.Right.WristFlexion folder is not correct. That is normal if you copied the drivers directly from the FreePosture application for example, because the folder structure is a little different between the two applications.

Try to load the model without the dirvers and check the correct path on the model three.

Best regards, Sylvain.

Hi, thanks for your reply. I could solve the problem.

I have another problem. I do not have markers for RMT5 and LMT5, and then I was told that I should add drivers at ankle joints. I added the following drivers:

//Right Ankle driver
AnyKinEqSimpleDriver AnkleDriverRight={
AnyKinMeasureOrg &ref1=…HumanModel.BodyModel.Interface.Right.AnklePlantarFlexion;
AnyKinMeasureOrg &ref2=…HumanModel.BodyModel.Interface.Right.AnkleEversion;

        DriverPos = 0*{
             .JntPos.Right.AnklePlantarFlexion,
             .JntPos.Right.SubTalarEversion};        
        DriverVel = 0*{
             .JntVel.Right.AnklePlantarFlexion,
             .JntVel.Right.SubTalarEversion};              
        Reaction.Type={Off,Off};
      };

      //Left Ankle driver
      AnyKinEqSimpleDriver AnkleDriverLeft={
        AnyKinMeasureOrg &ref1=...HumanModel.BodyModel.Interface.Left.AnklePlantarFlexion;
        AnyKinMeasureOrg &ref2=...HumanModel.BodyModel.Interface.Left.AnkleEversion;
        
        DriverPos = 0*{
             .JntPos.Left.AnklePlantarFlexion,
             .JntPos.Left.SubTalarEversion};        
        DriverVel = 0*{
             .JntVel.Left.AnklePlantarFlexion,
             .JntVel.Left.SubTalarEversion};              
        Reaction.Type={Off,Off};
      };          

The model can be loaded without any errors but an optimization fails.

WARNING(OBJ.MCH.KIN9):Elipse:Problems at calculation of closest point : Newton algorithm for finding closest point not converged, result could be inaccurate!

ERROR(OBJ.MCH.KIN3):KinematicStudyForParameterIdentification.InitialConditions : Kinematic analysis failed in time step 0

Could you give me any pointer?

Thank you very much.

Hi,

I think this error is related to the ellipsoid representing the rib cage and the scapula gliding on it. If the shoulder is driven by markers it is possible that they put the clavicula and scapula in such position that the contact to the elipsoid is not solvable anymore.
Make sure the motion in this area is not too extreme, try to adjust the scaling of the model and some marker positions if necesary.

Best regards, Sylvain.

Hi, thank you very much for your help. I am stilling having difficulty in completing MotionAndParameterOptimzation. Since I do not have RMT5 and LMT5 markers, I would like to lock degrees of freedom for inversion and eversion at ankle joints.

So, I am thinking that I should make SubTalarEversion equal 0 in Mannequin.any and TrialSpecificData.any. Am I doing it correctly? If it’s not correct, please, let me know how I should make changes.

Thank you very much,again.

Hi,

That should be ok. You also need the drivers using the mannequin’s value, but i can see from the previous post that you alredy added them.

Just a coment: in this previous post you added drivers for both eversion/inversion and flexion/extension. If you only want eversion/inversion to be locked then make sure to drive only this particular DoF.

Best regards, Sylvain.

Hi Sylvain,

Thank you very much for your reply. To only lock inversion/eversion, I made the following changes:

//Right Ankle driver
AnyKinEqSimpleDriver AnkleDriverRight={
AnyKinMeasureOrg &ref1=…HumanModel.BodyModel.Interface.Right.AnklePlantarFlexion;
AnyKinMeasureOrg &ref2=…HumanModel.BodyModel.Interface.Right.AnkleEversion;

        DriverPos = pi/180*{
             .JntPos.Right.AnklePlantarFlexion,
             0*.JntPos.Right.SubTalarEversion};        
        DriverVel = pi/180*{
             .JntVel.Right.AnklePlantarFlexion,
             0*.JntVel.Right.SubTalarEversion};              
        Reaction.Type={Off,Off};
      };

However, RunMotionAndParameterOptimizationSequence suddenly failed, and I had a lot of errors about constraints.

Failed to resolve kinematic constraints. Newton relaxation too small. (final kin. error = 2.368339E-001)
Constraint no. 0 above error tolerance 0.001000, error = 0.011728.
Constraint no. 1 above error tolerance 0.001000, error = 0.014557.
Constraint no. 2 above error tolerance 0.001000, error = 0.001151.

Constraint no. #1 in ‘Main.Studies.KinematicStudyForParameterIdentification.HumanModel.BodyModel.Trunk.JointsLumbar.C0C1Jnt.Constraints’ above error tolerance 0.001000, error = 0.001538.
Constraint no. #0 in ‘Main.Studies.KinematicStudyForParameterIdentification.HumanModel.BodyModel.Right.Leg.Jnt.Ankle.Constraints’ above error tolerance 0.001000, error = 0.012532.
Constraint no. #1 in ‘Main.Studies.KinematicStudyForParameterIdentification.HumanModel.BodyModel.Right.Leg.Jnt.Ankle.Constraints’ above error tolerance 0.001000, error = 0.019715.
Constraint no. #2 in ‘Main.Studies.KinematicStudyForParameterIdentification.HumanModel.BodyModel.Right.Leg.Jnt.Ankle.Constraints’ above error tolerance 0.001000, error = 0.002689.
Constraint no. #0 in ‘Main.Studies.KinematicStudyForParameterIdentification.HumanModel.BodyModel.Right.Leg.Jnt.Knee.Constraints’ above error tolerance 0.001000, error = 0.004896.

ERROR(OBJ.MCH.KIN3) : GaitLowerExtremity.main.any : KinematicStudyForParameterIdentification.InitialConditions : Kinematic analysis failed in time step 0

Macro command > operation Main.Studies.MotionOptimization.Kinematics

Error : Main.Studies.MotionOptimization.Kinematics : object is not AnyOperation.

But, if I don’t add the ankle drivers, this optimization can succeed, although it usually takes around 90 - 120 mins to complete the optimization. I thought this was due to that we did not use LMT5 and RMT5 markers. Then, we added LMT5 and RMT5 markers and collected a new data. But, it still took 90 mins to complete the optimization.

So, I am thinking if our data collection protocol might not be suitable for Anybody. For the data collection, we ask a subject to wear a ski type boot only for the right foot. The boot was attached to the wood plate. The wood plate is also placed above and attached to the force plate. We normally put three markers on the boot for toe, heel, lateral malleolus. The sizes of our boots are bigger than those of regular shoes. So, I was wondering if the sizes of the boots may influence the optimization, specifically when the model is being scaled to our C3D data. Please, let me know what you think of our method.

Thank you very much.

Hi,

the code you used is still driving both flexion and eversion. For eversion only use the following code:

//Right Ankle driver
AnyKinEqSimpleDriver AnkleDriverRight={
AnyKinMeasureOrg &ref2=…HumanModel.BodyModel.Interface.Right.Ankl eEversion;

DriverPos = pi/180*{
.JntPos.Right.SubTalarEversion};
DriverVel = pi/180*{
.JntVel.Right.SubTalarEversion};
Reaction.Type={Off};
};

Regarding your marker protocol, it can be used with Anybody but you need to model it correctly. If i undertand correctly the ski boot is making the foot stiff (no motion is possible in the ankle, is it right?). So maybe it is all right to lock both flexion and eversion after all. That is one thing you have to think about.

The second is the position of the markers. As you say if they are placed on the ski boot they are probably a little far from the foot bones. So you have to modify the position of the foot markers in the ModelSetup file. The current position in the repository applications correspond to markers placed on the skin.

Best regards, Sylvain.

Hi Sylvain,

Thank you very much for your help. I fixed the codes but the optimization failed just right after it started.

Error : Main.Studies.MotionOptimization.Kinematics : object is not AnyOperation.

I am feeling that our data itself is not appropriate for Anybody. Our data is a very quasi-isometric motion. Ankle, knee, and hip joints don’t move too much. Based on the tutorial of Lesson 5: Using real data, it may be impossible to determine locations of joints or lengths of segments, if the joints don’t move.

Please, let me know what you think of our data.

Thank you very much.

Hi,

I don’t know exactly why you get this error. Maybe you changed something in the script related to the operation? I would need to see the code to tell you more.

For the data you are right that if there is very little motion it will be a problem for the optimization. Probably you need to choose carefully what parameters to optimize depending on much motion there is.

I hope that helps you. I can’t tell you more without the model. Please send it if you need more help.

Best regards, Sylvain.