Plug-in-gait_Simple - problem loading the model with own C3D

Hi everyone,

I decided to update to the last AMMR v2.1.0 for performing gait motion analysis with my own C3D files in the best conditions.

I can’t find anymore the AnyGait model is used to work on ?
I assume I should from now on use the Plug-in-gait_Simple model under MocapExamples folder, correct ?

If so, after replacing the TrialFileName and loading the model, I obtain the following error message:
[SIZE=1]ERROR(SCR.EXP1)[/SIZE] : [SIZE=1]C:/U…s/p…i/D…s/A…x/A…o/A…n/M…s/P…e/S…p/ForcePlates.any(16)[/SIZE] : Defined at : [SIZE=1]C:/U…s/p…i/D…s/A…x/A…o/T…s/A…p/F…s/ForcePlateAutoDetection.any(35)[/SIZE] : Operator ‘=’ : Illegal operation for given argument types : ‘AnyEnum’ ‘=’ ‘AnyInt[1]’. Allowed values : Off, On

I keep looking but I can’t find the solution …
Is it coming from my C3D file having only one force plate ?
With the foot pressing on ithis force plate at the second step and not the first one ?

Thank you in advance for your precious help,

Hi

The AnyGait has been removed from AMMR, and replaced by a new set of mocap driven models offering much better flexibility and new features.

The error you get seems to be related to the forceplate definition.

1: Please try to exclude the forceplate from the model and see if it then loads.
2: if it loads the problem is the forceplate
4: the model will by default try to create 3 plates if you have only one delete two of them this is in the file Forceplates.any
3: in the C3D group section determine which type of plate you have
4: set the type to be the correct one

Hope it helps

Best regards
Søren

Hi toerholm,

I already tried to comment the 3 force plates from ForcePlates.any, and the model is sucessfully loading (but oubviously without any forceplate).

When commenting Plate2 anb Plate3 in ForcePlates.any (as I have only one force plate in my C3D file), this is where I get the previous error message:
ERROR(SCR.EXP1) : [SIZE=1]C:/U…s/p…i/D…s/A…x/A…o/A…n/M…s/P…e/S…p/ForcePlates.any(16)[/SIZE] : Defined at : [SIZE=1]C:/U…s/p…i/D…s/A…x/A…o/T…s/A…p/F…s/ForcePlateAutoDetection.any(35)[/SIZE] : Operator ‘=’ : Illegal operation for given argument types : ‘AnyEnum’ ‘=’ ‘AnyInt[1]’. Allowed values : Off, On

I also thought that could have been a problem related to the type of the force plate, and hence changed FORCEPLATE_TYPE = 4 to FORCEPLATE_TYPE = 2, as I noticed in Main.ModelSetup.C3DFileData.Groups.FORCE_PLATFORM.TYPE.Data [SIZE=2]that the value is {{2}}.[/SIZE]

In any case, thanks for your answer, it confirms that at least I have been looking in the correct direction.

Hi

I think it is some minor thing… some syntax error

Could you possible share the way you define the forceplate.

I have looked in line 35 in my AMMR of the forceplateAutodetection class and it does not reveal any thing related to the error you get.

What do you have in line 35 of the forceplateautodection.any file?

Best regards
Søren

I defined the only force plate I have in my C3D in ForcePlates.any as follows:

Main.EnvironmentModel.ForcePlates =
{
[i]
ForcePlateAutoDetectionPlate1(
PLATE_NO=1,
HeightTolerance=0.07,
VelThreshold=2.2,
FORCEPLATE_TYPE=2,
ALLOW_MULTI_LIMB_CONTACT=OFF
)={};

[/i][i]// ForcePlateAutoDetection Plate2(
// PLATE_NO=2,
// HeightTolerance = 0.07,
// VelThreshold = 2.2,
// FORCEPLATE_TYPE = 4,
// ALLOW_MULTI_LIMB_CONTACT = OFF
// ) = { };

[/i]// ForcePlateAutoDetection Plate3 (
// PLATE_NO=3,
// HeightTolerance = 0.07,
// VelThreshold = 2.2,
// FORCEPLATE_TYPE = 4,
// ALLOW_MULTI_LIMB_CONTACT = OFF
// ) = { };
};

In my ForcePlateAutoDetection.any file, here is what I have (I added the number of the line into bracket for reading purposes, but they are not present in the any file):

[ligne 33] AnyMessagePlateTypeCheck={
[COLOR=#696969][ligne 34] AnyInt[/COLOR]test=neqfun(.ForcePlateType,FORCEPLATE_TYPE);
[ligne 35] TriggerPreProcess=test;
[ligne 36] Type=MSG_ErrorFatal;
[ligne 37] Message=strformat("AnyMOCAP:Wrongforceplatetype:
"+

[ligne 38] “C3Dfilereportsforceplateasbeeingtype”+
[ligne 39] strval(C3D_OBJECT.Groups.FORCE_PLATFORM.TYPE.Data[PLATE_NO-1])+[ligne 40] “nottype:”+strval(FORCEPLATE_TYPE));
[ligne 41] };[SIZE=2] [/SIZE]

Hi

Please try to remove one line so that it says:

ForcePlateAutoDetectionPlate1(
PLATE_NO=1,
HeightTolerance=0.07,
VelThreshold=2.2,
FORCEPLATE_TYPE=2
)={};

then let me know if this helps

Best regards
Søren

Unfortunately, the error is kept unchanged, and I have no idea where to give a look at.

Thank you for your patience …

Hi

We think we have found the issue.

Please make this change in the forceplateautodection.any file



[ligne 33] AnyMessagePlateTypeCheck={
[ligne 34] AnyInttest=max(neqfun(.ForcePlateType,FORCEPLATE_TYPE));
[ligne 35] TriggerPreProcess=test;
[ligne 36] Type=MSG_ErrorFatal;
[ligne 37] Message=strformat("AnyMOCAP:Wrongforceplatetype:
 "+
[ligne 38] "C3Dfilereportsforceplateasbeeingtype"+
[ligne 39] strval(C3D_OBJECT.Groups.FORCE_PLATFORM.TYPE.Data[PLATE_NO-1])+[ligne 40] "nottype:"+strval(FORCEPLATE_TYPE));
[ligne 41] };


note that there is a “max” around the type check in line 34.

The explanation:

In your data the forceplate type says “{{2}}” usually in all other files we have seen it says e.g. “{2}” or {3,3,3}" so it means that for some reason your data has an additional set of brackets, which causes the type check to fail, but by using the max around it removes the bracket and it should work.

Please let us know if it solves the problem

Best regards
Søren

Thank you for the explanation, in a way it solved the problem.
Nevertheless, now it seems I have an error in the ForcePlateAutoDetection.any:

[SIZE=1]ERROR(SCR.EXP0)[/SIZE] : [SIZE=1]C:/U…s/p…i/D…s/A…x/A…o/A…n/M…s/P…e/S…p/ForcePlates.any(16)[/SIZE] : Defined at : [SIZE=1]C:/U…s/p…i/D…s/A…x/A…o/T…s/A…p/F…s/ForcePlateAutoDetection.any(112)[/SIZE] : ‘sRel’ : Error in expression. Please refer to the following error messages for details …
[SIZE=1]ERROR(SCR.EXP3)[/SIZE] : [SIZE=1]C:/U…s/p…i/D…s/A…x/A…o/A…n/M…s/P…e/S…p/ForcePlates.any(16)[/SIZE] : Defined at : [SIZE=1]C:/U…s/p…i/D…s/A…x/A…o/T…s/A…p/F…s/ForcePlateAutoDetection.any(112)[/SIZE] : ‘sRel’ : Index [0] out of range for ‘AnyFloat’

[SIZE=2]In any case, I should have a look at the export of the C3D file, to understand why I have a double set of brackets.[/SIZE]

Hi

I think the next error could be somewhat of the same nature…

It might indicate that the property of your corner data is also wrong dimensions


AnyFloat Data = C3D_OBJECT.Groups.FORCE_PLATFORM.CORNERS.Data;

Please try to look at the corner data dimensions in your file and in other c3d files.

If i am right it might fix it temporarily by writing e.g. like below in line 98 of the forceautodectionfile, but note that this modification will make the forceplate class fail for all other c3d files than yours…


AnyFloat Data = C3D_OBJECT.Groups.FORCE_PLATFORM.CORNERS.Data[0];

Best regards
Søren

Adding [0] as you suggested in line 98 of ForcePlateAutoDetection.any didn’t change the message.

If it may be useful for understanding, when I have a look at my C3D file (Main.ModelSetup.C3DFileData.Groups.FORCE_PLATFORM.CORNERS.Data), this is what I get as values: {{1017.0, 464.0, 0.0}, {1017.0, 0.0, 0.0}, {509.0, 0.0, 0.0}, {509.0, 464.0, 0.0}}.

[SIZE=2]Directly inserting those coordinates in
[SIZE=1]sRel=C3D_OBJECT.PointsScaleFactor*{
[/SIZE][i].Data[.plate_idx][0],
[i].Data[.plate_idx][1],
[i].Data[.plate_idx][2]
[SIZE=1]};[/SIZE][/SIZE]
[SIZE=2]for each corner may be a way not to obtain this error message, but this would not be the proper way to do …

[/SIZE]

Hi

It is an interesting c3d file you have :wink:

it seems that the problem is now the opposite than before

Usually the corner data looks like eg. {{{1017.0, 464.0, 0.0}, {1017.0, 0.0, 0.0}, {509.0, 0.0, 0.0}, {509.0, 464.0, 0.0}}}

so having one more bracket…

To fix it please try this instead:

AnyFloat Data = {C3D_OBJECT.Groups.FORCE_PLATFORM.CORNERS.Data};

it will add a bracket instead of removing one…

We like would a copy of the C3D if it is possible? (remove all personal data ), this would allow us to make the forceplate class more forgiving to such imperfections.

Which software has been used to create the C3D file?

Best regards
Søren

Hi toerholm,

Exactly, that was the solution.
Many thanks, I would never have found by myself …

[SIZE=2]Just one more thing, as I have no head markers I deactivated [SIZE=1]RFHD, LFHD, RBHD and LBHD, and now I get this error message: Kinematic analysis failed in time step 0[SIZE=2].
[/SIZE][/SIZE][/SIZE]In my opinion I should had a driver to fix the head of the human model, but I can’t find it among any files, should I look somewhere else ?

I will ask my colleague which software was used to create the C3D and ask him to remove personal data to share it.

Hi

Yes you are most likely missing a driver for the head.

Quick way is to apply the default driver by writing

#define BM_MANNEQUIN_DRIVER_NECK BM_MANNEQUIN_DRIVER_DEFAULT ON

see also :

https://anyscript.org/ammr-doc/bm_config/bm_statements.html#bm-mannequin-driver-neck

A good place to add this line is the extradrivers.any file.

Best regards
Søren

I did not notice the extradrivers.any file present in the folder … my bad, thanks.

Now that the calculation with the single forceplate is performed, I would like to run another C3D file, but with two forceplates now.
Hence, I reactivated the ForcePlateAutoDetection for Plate2 in ForcePlates.any.

Because my data corner now looks like {{{508.0, 464.0, 0.0}, {508.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 464.0, 0.0}}, {{1017.0, 464.0, 0.0}, {1017.0, 0.0, 0.0}, {509.0, 0.0, 0.0}, {509.0, 464.0, 0.0}}} when having a look at the C3D, I removed the “{ }” to have in ForcePlateAtoDetection.any the following line: #var AnyFloat Data = C3D_OBJECT.Groups.FORCE_PLATFORM.CORNERS.Data;

I though that would have been correct, but here my error message:
[SIZE=1]RROR(SCR.EXP3)[/SIZE] : [SIZE=1]C:/U…s/p…i/D…s/A…x/A…o/A…n/M…s/P…e/S…p/ForcePlates.any(24)[/SIZE] : Defined at : [SIZE=1]C:/U…s/p…i/D…s/A…x/A…o/T…s/A…p/F…s/ForcePlateAutoDetection.any(26)[/SIZE] : ‘ForcePlateType’ : Index [1] out of range for ‘AnyInt[1][2]’

I am really sorry, but those statements are not clear for me …

Hi

I think the problem is now related to the forceplate type definition having wrong dimensions.

Remember we changed this line

[ligne 34] AnyInttest=max(neqfun(.ForcePlateType,FORCEPLATE_TYPE));

so that it had the max, this was done because you had data like this
{{2}}" and the max would make this “{2}”

I made this small test, please try to loads as model and explore the values in the tree

Main ={
//this is the first problem we resolved
AnyFloat test1={{2}};
AnyFloat test2=max(test1);

AnyFloat test3={{2},{2}};
AnyFloat test4=max(test3);

//i think this is the problem now it returns {2} not {2,2}
AnyFloat test5={{2,2}};
AnyFloat test6=max(test5);


//solution
AnyFloat test7={{2,2}};
AnyFloat test8=test5[0];


};

I think the solution now is

[ligne 34] AnyInttest=neqfun(.ForcePlateType,FORCEPLATE_TYPE)[0];

Best regards
Søren

Hi toerholm,

Thanks for the small test, now I understand better the manipulations we made previously (max, {}, etc).

With AnyInttest=neqfun(.ForcePlateType,FORCEPLATE_TYPE)[0]; , I still get the same error message:
[SIZE=1]ERROR(SCR.EXP3)[/SIZE] : [SIZE=1]C:/U…s/p…i/D…s/A…x/A…o/A…n/M…s/P…e/S…p/ForcePlates.any(24)[/SIZE] : Defined at : [SIZE=1]C:/U…s/p…i/D…s/A…x/A…o/T…s/A…p/F…s/ForcePlateAutoDetection.any(26)[/SIZE] : ‘ForcePlateType’ : Index [1] out of range for ‘AnyInt[1][2]’
[SIZE=2]With line 26 being in my case [SIZE=2][SIZE=1]AnyInt[/SIZE][/SIZE]ForcePlateType=[SIZE=1]C3D_OBJECT.Groups.FORCE_PLATFORM.TYPE.Data[PLATE_NO-1];
[/SIZE]
[/SIZE]

Ok, please let me know the type data for the forceplate so e.g.

Main.ModelSetup.C3DFileData.Groups.FORCE_PLATFORM.TYPE.Data = {4, 4, 4};

In the change i suggested i thought it would be in your case

Main.ModelSetup.C3DFileData.Groups.FORCE_PLATFORM.TYPE.Data = {{2,2}}; 

but it may not be the case

Best regards
Søren

Exactly, when I have a look at the model tree, value for Main.ModelSetup.C3DFileData.Groups.FORCE_PLATFORM.TYPE.Data is {{2, 2}}.

Ok i think you need to make two changes;

#line 23
 AnyInt ForcePlateType = C3D_OBJECT.Groups.FORCE_PLATFORM.TYPE.Data[PLATE_NO-1] [0]; 
  

This should make ForceplateType go from {{2,2}} to {2,2} which is correct

Whit this change the other fix is not needed so line 26 should be

#line 26
     AnyInt test = neqfun(.ForcePlateType, FORCEPLATE_TYPE);

Hope it works :wink:

Best regards
Søren