AnyGait application with FullBody

Hi,

I had a closer look at hip joints reaction forces for my gait cycle with first right foot strike and then left foot strike.

The shape and values of the curve seems logical for the right hip joint (right foot on plate 1).
However when I consider the left hip joint, curve is constantly increasing until abnormal high values (left foot on plate 2, which I think axes are in the wrong direction: X is OK, Yplate1 = Zplate2, Zplate1 = -Yplate2).

Is there a way to address this problem ?

Hi ,

Sorry for the slow feedback.

As i understand it, you have an issue with the corner data of the forceplate, and you would like not to alter the .c3d file but the model instead.

I would do the following:

[ol]
[li] Make a copy of the forceplate class you are having an issue with
[/li][li] include the new class in the top of the main file next to line currently including the forceplate classes.
[/li][li] You need to rename the class in the top so that the name is different than the original
[/li][li] when you apply the class you need to swap the plate to the new one for the plate having the problem
[/li][li] now load the model … nothing is changed yet… error will be same but you have possibility to modify the class
[/li][li] Manipulate the forceplate class corner section in the top of the class to comply with your data. It can be a little tricky to modify anyscript classes because the usual way to get you to the location of the error will take you only to the location where you have used the class and not to the location inside the class having the problem. So keep this in mind and make gradual changes in the class, so you always will know what could have caused a load error.
[/li][/ol]

Best regards
Søren

No problem at all, this is always a pleasure to receive your answers.

All right, I succeeded in operations 1 to 5, but I am now struggling with number 6.
I don’t really understand when you say “Manipulate the forceplate class corner section”, I mean, I don’t know what to insert because the only information I have is:

[SIZE=2][SIZE=1][COLOR=black]ForcePlateAutoDetection Plate2Trial(
PLATE_NO=2,
HeightTolerance = 0.07,
VelThreshold = 2.2,
FORCEPLATE_TYPE = 4
)
={ };[/SIZE][/COLOR][/SIZE]

[SIZE=2][COLOR=black]I am a bit confused …[/COLOR][/SIZE]

Hi

For the plate which you would like to correct you need to write something like this


ForcePlateAutoDetectionMYOWNVer Plate2Trial(
PLATE_NO=2,
HeightTolerance = 0.07,
VelThreshold = 2.2,
FORCEPLATE_TYPE = 4
)
={ };

This name “ForcePlateAutoDetectionMYOWNVer” also needs to be changed in step 3.

Now again the model should load but still nothing is changed.

Then you need to make the changes inside the new class in the section which creates the corner nodes this is what determines the orientation of the plate… You will need to look at the difference between the data which are ok for some plates and the data which are not.

Best regards
Søren

one more comment:

Maybee it will enough to alter around the “i” in the forceplate


  AnyRefNode c01={
      AnyInt i=0;
      AnyInt plnr=No;
      sRel=0.001*{Folder.Groups.FORCE_PLATFORM.CORNERS.Data[plnr][i][0],Folder.Groups.FORCE_PLATFORM.CORNERS.Data[No][i][1],Folder.Groups.FORCE_PLATFORM.CORNERS.Data[No][i][2]};
      AnyDrawNode drw={ScaleXYZ=0.01*{1,1,1};RGB={1,0,0};};
      AnyDrawVector  DrawName = {
        Vec = {0.0,0,0};  //use zero length
        Line.Thickness = 0.025; //arbitary value
        Text = "1"; //make reference to name
        Line.RGB={1,0,0};//make reference to color
      };
    };
    


so maybee corner c01 is not i=1 but i=3…in your case…

Best regards
Søren

I am a bit lost, sorry … but thank you for your kind patience.

Please let me summarise, in ForcePlates.any, this is what I have for the moment:

[i]Main.EnvironmentModel.ForcePlates =
{

ForcePlateAutoDetection Plate1(
PLATE_NO=1,
HeightTolerance = 0.07,
VelThreshold = 2.2,
FORCEPLATE_TYPE = 4
)
={ };

//ForcePlateAutoDetection Plate2(
//PLATE_NO=2,
//HeightTolerance = 0.07,
//VelThreshold = 2.2,
//FORCEPLATE_TYPE = 4
//)
//={ };

};[/i]

In the environment model, this is what I currently have:

AnyFolder[i] EnvironmentModel = {

AnyFixedRefFrame[/i] GlobalRef ={
Origin={0,0,0};
AnyDrawRefFrame
drw={ScaleXYZ=0.4*{1,1,1};};
};
AnyFolder ForcePlates = {

ForcePlateAutoDetection Plate2Trial(
PLATE_NO=2,
HeightTolerance = 0.07,
VelThreshold = 2.2,
FORCEPLATE_TYPE = 4
)
[COLOR=purple]={ };
[/COLOR]

#include
“<MOCAP_FORCE_PLATE_FILE>”
};
};

If changing the [SIZE=1]ForcePlateAutoDetection Plate2Trial [SIZE=2]to [SIZE=1]ForcePlateAutoDetectionMYOWNVer Plate2Trial , model is not loadings anymore: [SIZE=1]’(’ unexpected.[/SIZE][/SIZE][/SIZE][/SIZE]

By the way, where should I add the previous code you gave me ?
[SIZE=2]Here: ={ }; am I correct ?[/SIZE]

Hi

I am sorry it looks a bit confusing it would be easier to correct the error in the c3d data :wink:

Below i have listed the description from earlier and i have tried to add some more comments…

When reading your comments i feel that you have not fully understood the steps i proposed so i have taken the description from earlier and added some more information
[ul]
[li]Make a copy of the forceplate class you are having an issue with, copy the AAUHuman/TolBox/ForceplateType2Autodection.any file to AAUHuman/TolBox/ForceplateType2AutodectionModified.any
[/li][li]include the new class in the top of the main file next to line currently including the forceplate classes so include AAUHuman/TolBox/ForceplateType2AutodectionModified.any
[/li][li]You need to rename the class in the top so that the name is different than the original
[/li]This you need to do inside the file
AAUHuman/TolBox/ForceplateType2AutodectionModified.any
So first line to e.g.

#class_template ForcePlateType2AutoDetectionMyVersion (PlateName, Folder,AnySeg &Limb1,AnySeg &Limb2, No,VerticalDirection,HeightTolerance,VelThreshold, Fx, Fy, Fz, Mx,My,Mz,FootPresent){

[li]when you apply the class you need to swap the plate to the new one for the plate having the problem
[/li]So in Forceplate.any file write e.g.

ForcePlateAutoDetectionMyVersion Plate2(
PLATE_NO=2,
HeightTolerance = 0.07,
VelThreshold = 2.2,
FORCEPLATE_TYPE = 4
)
={ };

[li]now load the model … nothing is changed yet… error will be same but you now have possibility to modify the class
[/li][li]in the file AAUHuman/TolBox/ForceplateType2AutodectionModified.any , Manipulate the forceplate class corner section in the top of the class to comply with your data. It can be a little tricky to modify anyscript classes because the usual way to get you to the location of the error will take you only to the location where you have used the class and not to the location inside the class having the problem. So keep this in mind and make gradual changes in the class, so you always will know what could have caused a load error.
[/li]Maybe it will be enough to change the i below , so maybee corner c01 is not i=1 but i=3…in your case…;

AnyRefNode c01={
      AnyInt i=0;
      AnyInt plnr=No;
      sRel=0.001*{Folder.Groups.FORCE_PLATFORM.CORNERS.Data[plnr][i][0],Folder.Groups.FORCE_PLATFORM.CORNERS.Data[No][i][1],Folder.Groups.FORCE_PLATFORM.CORNERS.Data[No][i][2]};
      AnyDrawNode drw={ScaleXYZ=0.01*{1,1,1};RGB={1,0,0};};
      AnyDrawVector  DrawName = {
        Vec = {0.0,0,0};  //use zero length
        Line.Thickness = 0.025; //arbitary value
        Text = "1"; //make reference to name
        Line.RGB={1,0,0};//make reference to color
      };
    };

[/ul]

Hi,

Many thanks, that is pretty clear and now I understand the procedure.
I am still getting errors when loading the model but this is because of paths issues, I am working on it, I should manage.

You said it would be easier to correct the C3D ?
Honestly I do not know how to modify such a file, only reading it.
In any case, I remain open to all suggestion if that could be more accessible.

Hi,

To correct the data i would go the motion lab is possible and re-open the raw data files and do a new export of the c3d file having the proper settings so that the corner nodes of the plates are corrected.

The corner nodes locations will determine the orientation of the plate, this is why the list of changes i suggested is altering the sequence of the corner nodes being used to control the corner of the force plates.

Best regards
Søren

Great, I will have a look in the motion lab, maybe there is something we can do.

However, I am still curious about this procedure on Anybody, and would like you to have a look at the following lines if possible.
In my ForcePlateTypeAutoDetectionTRIAL.any, I have this class template:
[SIZE=2][SIZE=1]#class_template[/SIZE][/SIZE] ForcePlateType4AutoDetectionTRIAL (PlateName, Folder, AnyRefFrame &Limb1, AnyRefFrame &Limb2, No, VerticalDirection, HeightTolerance, VelThreshold, Fx, Fy, Fz, Mx, My, Mz, FootPresent){

Hence, in ForcePlates.any for the Plate2 this is what I wrote:
ForcePlateType4AutoDetectionTRIAL Plate2(
No=2,
VerticalDirection=“Z”,
HeightTolerance = 0.07,
VelThreshold = 2.2,
Limb1 = Main.HumanModel.BodyModel.Right.Leg.Seg.Foot,
Limb2 = Main.HumanModel.BodyModel.Left.Leg.Seg.Foot,
PlateName=Plate2TRIAL,
Folder=Main.ModelSetup.C3DFileData,
Fx=Folder.Analog.DataFiltered.Fx2,
Fy=Folder.Analog.DataFiltered.Fy2,
Fz=Folder.Analog.DataFiltered.Fz2,
Mx=Folder.Analog.DataFiltered.Mx2,
My = Folder.Analog.DataFiltered.My2,
Mz = Folder.Analog.DataFiltered.Mz2,
[SIZE=1]FootPresent = HumanModelPresent
)
[/SIZE]I am having troubles with FootPresent, because HumanModelPresent is an “Unexpected character”, but honestly I don’t know what should I insert in this location.

Hi

Did you by accident outcommented this line in the environmemt.any file?

#define HumanModelPresent 1

That could explain it…

Few other ideas:

Did you modify the ForcePlateTypeAutoDetectionTRIAL.any except the renaming? it could be a syntax error in the class which will point you to the location of where the classs is used and not inside it.
also did you include the new file in top of main?

Best regards
Søren

Tahnks again for your quick reply.

In EnvironmentModel.any, “#defineHumanModelPresent1” was not present so I wrote it.
But then there is a different error, with ‘Folder’ : Unresolved object[SIZE=2].
[/SIZE]
If you don’t mind I would like to joint my model to this message.

Hi

I am sorry all the modifications i have suggest fits into the standard mocap model from AMMR not the new AnyMocap which i can see you have used as the basis, i am sorry for this understanding this is my fault.

The new AnyMocap model is more difficult to adjust in this respect since it automatically assign the type of plate e.g. type=4 from the C3D file, it is not something you can decide as a user. This fact makes it diffucult to make two different version of the same forceplate class.

So as i see it, you need either need to correct the data, or swicth to the older version of the mocap model.

Best regards
Søren

Hi

We have managed to modify the class for the AnyMocap model so that the corner nodes can be changed from the “outside” meaning that the are optional variables to set.

So this means you need to do this:

[ol]
[li]In the main file remove the include statement for the forceplate class you made
[/li][li] Replace the forceplateautodetection file you have with the one attached.
[/li][li] In the forceplate.any file make changes like this
[/li]

 ForcePlateAutoDetection Plate1(
    PLATE_NO=1,
    HeightTolerance = 0.07,
    VelThreshold = 2.2,
    FORCEPLATE_TYPE = 4
    )
  ={ };
 
    ForcePlateAutoDetection Plate2(
    PLATE_NO=2,
    HeightTolerance = 0.07,
    VelThreshold = 2.2,
    FORCEPLATE_TYPE = 4
    )
  ={    Corners.Data = {{{508.0, 464.0, 0.0}, {508.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 464.0, 0.0}}, {{509.0, 0.0, 0.0}, {509.0, 464.0, 0.0}, {1017.0, 464.0, 0.0}, {1017.0, 0.0, 0.0}}};};

[li] Note that you can now change the corner nodes as needed… the values you see in the script i have found using the model tree and dumped out of the object Main.ModelSetup.C3DFileData.Groups.FORCE_PLATFORM.CORNERS [/ol]
[/li]
So now you can changes these nodes and it will change way the plate is oriented.

Sorry for the confusions on the way.

Best regards
Søren

Hi,

Many thanks, this is exactly what I wanted to do, great, I finally managed thanks to you, thanks again for your precious help toerholm !

I wanted to rotate this second plate because of concerns, let me explain.
With exactly the same C3D file, running AnyGait (lower limbs) and AnyMoCap (full body) didn’t provide the same results for hip joints reaction forces.
I perfectly understand I will not obtain exactly the same values, but I was speaking about the shapes of the curve, for the FullBody: right hip reaction force (first plate) is rather similar, but for left hip reaction force (second plate, with different orientation from Anybody examples, rotated 180° horizontally) the decrease between the two peaks is not present (see file attached).

Is there a difference in awareness of the orientations of the plates between both models ?
What could possibly explain this variations ?

Hi

There is only one correct placement/orientation of the plate, please review the measured GRF direction it will display if the plate has correct orientation or not.

For gait the GRF needs to points inwards towards the center of the chest, if you rotate the plate 180 deg you will see this GRF pointing outwards this can not be correct.

The two models are using sligthly different forceplate classes, but the difference should only relate to a reorganization of the class to make it easier to use, it should not change results.

If you are looking to find the difference between the two models i would run the model with no muscles on and compare the torque in the jointmuscles. This will make it easier to understand the cause of the difference.

Todo that you will need to the BodyModelConfig.any file and switch off muscles. Then you run the inverse dynamics and look at the jointmuscle out from each joint, there will be a positive and neg muscle generating torque.

You will need to same type of analysis in AnyGait and then compare the torques.

One more thing:

Please start by comparing the kinematics between the two models, this might be what is triggering the difference, if you are not using same marker locations it will lead to differences in kinematics which may alter muscle and joint forces.

Best regards
Søren