starting with a specific model for kinematical analysis

Dear all,

I’m a complete beginner in modelling with the anybody system. I’m exploring the system and have already completed the tutorials. I builded a model for an arm and thorax based on the building blocks tutorial. Now I want to include markers in order to be able to use kinematical data (arm movements).
I’m experiencing some problems and I have to questions:

  1. How can I define markers when the human model I use is in the general model repositry? (I took a look at the specific models with enclosed markers, but these seem to complex to understand and adapt at this moment)

  2. I created c3d files based on kinematical measurements we already did before. In these files there are more markers than I need to drive the model. Is there a way to exclude these markers and still use the already existing files? Or should the c3d files only exist of the specific marker set which is necessary for the specific application in the model?

I hope someone can answer these questions or provide me with some suggestions to proceed!

Many thanks in advance!

Hi Frederik,

A marker on the body is basically an AnyRefNode with its sRel to control its position on the segment. You can define the node and a driver between it and the floating marker.

However i think it is much better to use the template of the existing repository model, GaitFullBody would be the one in your case i think. In the ModelSetup.any file you just have to change the name of your c3d file and the list of the marker names. It does not matter if you have more markers than necesary, just don’t include them in the list of names if you don’t want them.
A little below is a folder for each body marker you want to include. You can simply update their name and location on the bone (with the sRel menber). You can also create new ones on the same template.

Then you are ready to run the optimization and inverse dynamic.

Best regards, Sylvain.

Sylvain,

thank you very much for you explanation! I’m already working on that! I do have an additional question to your explanation: all markers are defined with relative coordinates which refer to the coordinate system of the specific segment. Is there a way to visualize this coordinate system in order to know which coordinates I should adapt?
Thanks in advance!

Kind regards,

Frederik

Hi Frederik,

You just have to include an AnyDrawRefFrame in the corresponding segment folder and it will display its coordinate system.

Best regards, Sylvain.

Sylvain,

I was able to adapt the model in terms of new markers and new marker positions. But when I try to load the model I get an error in the mannequin file. I presume this error is related to the model scaling based on the pelvis markers. I do not use these markers: I only have markers on the left arm. How should I adapt the mannequin file in order to solve this problem? The important markers I use, are placed on the angulus acromialis (scapula), the anterior acromion, the medial and lateral epicondylus of the humerus and the distal radius and ulna. I would like the model to scale based on the epicondyli for the width of the arm (perhaps also the distal radius and ulna) and for the length, I want to use the scapula markers compared to the epicondyli.

Is that possible and how should I adapt the model to realize this?

Many thanks in advance!

Kind regards,

Frederik

Hi Frederik,

What is the error you get exactly? The mannequin file is used for the initial positions but not for scaling, so it should not be a scaling problem i think.

Anyway, if you only have markers for the left arm then in the ModelSetup file you should switch Off the scaling of the pelvis, legs and trunk. The arm length will scale as you want with the scapula and epicondyli marker, but not the arm width. Depending on the scaling law you choose the width is dependent on either the length or the mass. What you can do to have a good fit is optimize the position of the epicondyli markers lateraly.

Best regards, Sylvain.

Sylvain,

I switched of the the scaling of the pelvis, trunk etc. as you suggested. But I still get the same error:
ERROR(SCR.PRS9) : C:/D…s/p…9/M…n/A…s/A…1/A…n/M…s/G…2/Mannequin.any : ‘PosInterpol’ : Unresolved object

This concerns the position interpolation of the previous defined markers in the model (RASI, LASI, RPSI and LPSI). Should I just switch them off too, or should I change these marker names into names I use?
I allready tried to outcomment this PosInterpol, but then I get another error on the pelvisPosX:
ERROR(SCR.PRS9) : C:/D…s/p…9/M…n/A…s/A…1/Body/A…n/T…k/InitialPositionsPelvis.any : ‘PelvisPosX’ : Unresolved object

This folder consists of:

SegmentsLumbar.PelvisSeg.r0 =
{JointPos.PelvisPosX,JointPos.PelvisPosY,JointPos.PelvisPosZ};

SegmentsLumbar.PelvisSeg.Axes0=
RotMat((pi/180)JointPos.PelvisRotZ ,z)
RotMat((pi/180)JointPos.PelvisRotY ,y)
RotMat((pi/180)*JointPos.PelvisRotX ,x);

How can I solve or avoid this problem?
Thanks in advance!

Frederik

Hi Frederik,

The names of the markers in the model must be the same as the names in the c3d file. This is why you get the unresolved object error.

Best regards, Sylvain.

Hi Sylvain,

I did get that already, but I only use markers on the arm and I haven’t defined any markers on the pelvis. Should I adapt the mannequin file (In the posture folder) as following:

1.Within the AnyParaFun functions I change the markers into arm markers that I use.
2. I define the PelvisPos (X,Y,Z) as zero (The position of the pelvis in my measurements in constant: only the arm moves)

Thanks!

Frederik

Hi Frederic,
setting the Pelvis to 0,0,0 should work. You don’t have to set the AnyParamFun. In the inital model this setup is used to place the pelvis and therefore the model in the proper inital position, but in your case this could be the origin.
Best regards,
Sebastian

Sebastian,

thanks for your reply. Now I do experience an next problem: I did change the position of the pelvis but no I get another error:

ERROR(OBJ.FILE1) : C:/D…s/p…9/M…n/A…s/A…1/A…n/M…s/G…2/JointsAndDriversOptimized.any : JntDriverTrunk.FileName : Problem with file : C:\Documents and Settings\p0007009\Mijn documenten\Anyscripts\AMMRV1.1\Application\MyModels\GaitFullBodyEXOSIM2\TestAny1-output-euler-trunk.txt : The data file does not exist.

When I look into the folder joints and drivers (where this txt-file problem occurs), I see this:

AnyKinEqInterPolDriver JntDriverTrunk = {
FileErrorContinueOnOff = On;
Type = Bspline;
BsplineOrder = 4;
FileName = Main.ModelSetup.C3DFileData.NameOfFile+"-output-euler-trunk.txt";
AnyKinMeasureOrg &PelvisPosX = …HumanModel.Interface.Trunk.PelvisPosX;
AnyKinMeasureOrg &PelvisPosY = …HumanModel.Interface.Trunk.PelvisPosY;
AnyKinMeasureOrg &PelvisPosZ = …HumanModel.Interface.Trunk.PelvisPosZ;
AnyKinMeasureOrg &PelvisRotX = …HumanModel.Interface.Trunk.PelvisRotX;
AnyKinMeasureOrg &PelvisRotY = …HumanModel.Interface.Trunk.PelvisRotY;
AnyKinMeasureOrg &PelvisRotZ = …HumanModel.Interface.Trunk.PelvisRotZ;
AnyKinMeasureOrg &PelvisThoraxExtension = …HumanModel.Interface.Trunk.PelvisThoraxExtension;
AnyKinMeasureOrg &PelvisThoraxLateralBending = …HumanModel.Interface.Trunk.PelvisThoraxLateralBending;
AnyKinMeasureOrg &PelvisThoraxRotation = …HumanModel.Interface.Trunk.PelvisThoraxRotation;
Reaction.Type={On,On,On,On,On,On,Off,Off,Off};
};

It is the txt-file the error refers to. Is that a file I should include, and what should be in it then? Or should I just comment this out of the file? Of course, there are similar drivers for the legs and arms as well…
I don’t have any clue and I hope you have a suggestion to solve this!
Thanks in advance!

Frederik

Sebastian,

in addition to my previous post: I commented the total AnyKinEqInterPolDriver JntDriverTrunk out of the model, and I get a similar error, but now for the left arm.
So, my question is what is this txt-file exactly, what should it contain and what is its function in the model. Is it an output file which the model generates or something else?
I hope you can provide me with an answer to these questions!
Thanks in advance!

Frederik

Hi Frederik,

The text file is generated automatically after the optimization converged. So if you runned correctly the RunMotionAndParameterOptimizationSequence all text files should be present in the folder of your application. Please check that you did not delete them, else you will have to run the optimization sequence again.

Best regards, Sylvain.

Sylvain,

thank you for the quick response: i did indeed forgot to switch the optimization function on. That is done, but now I get another error (for a change):

ERROR(SCR.PRS9) : C:/D…s/p…9/M…n/A…s/A…1/A…n/M…s/G…2/ModelSetup.any : Defined At : C:/D…s/p…9/M…n/A…s/A…1/A…n/M…s/G…2/CreateMarkerClass.any : ‘PosInterpol’ : Unresolved object

The marker which is referred to in this error :
CreateMarker M1 (
MarkerName=RADI,
MarkerPlacement =Left.ShoulderArm.Seg.Radius,
OptX=“Off”,OptY=“Off”,OptZ=“Off”,

Model1=MotionAndParameterOptimizationModel, Model2= InverseDynamicModel
) = {
sRelOpt ={-0.231, 0.032, 0.004}; //coordinates of the marker unscaled
}; //This marker is complete

and the second line in the file to which is reffered in the error is:

AnyParamFun &ref2 = Main.ModelSetup.C3DFileData.Points.Markers.MarkerName.PosInterpol;

I hope you know to figure out what is going wrong and you can give me a suggestion to fix this!

Many thanks!

Frederik

Hi Frederik,

Most probably the marker name in the model does not correspond to name in the C3d file. You have to give it the exact same name.

Best regards, Sylvain.

Hi Sylvain,

The problem I mentioned in my last post, still remains. I checked the C3D file and there was a mistake in the marker names. I fixed that, but the problem still exists.
Do you have another suggestion to fix this problem? I tried already several things, but none of them works.

Frederik

Hi Frederik,

If you still et an error message like in the previous post, then the naming of the markers are still not correct.

There are some characters in the makernames that AnyBody will not allow, if a marker is named for example “:RKNE” it will be automatically changed to “_RKNE”.

Please try to do a basic model where you do the following:

1 Open up a new empty main file
2 Include the AnyInputC3D object from the ModelSetup.any file in the main file.
3 Load the model
4 Inspect the loaded c3d file structure
5 Inspect the names of the loaded markers

If these names are different in any way from what you have used in the modelsetup.any file then this is why the model will not load.

Notice also that sometimes a marker can have prefix so it could be named “Trial01_RKNE” this prefix can be set by the prefix variables in the modelsetup file.

Best regards
Søren

Soren,

The loading of the c3d-file in a new main file was succesfully, but I don’t find the marker names in that model. Where can I find the names. All markers are expressed as M01, M02 etc.
Or do the markers have no name then?

Frederik

Hi Frederik,

Please have a look at the Points.Markers folder in the C3d object, if the names in this folder is M01… then this how your markers has been named …

In this the case you either have to create a new c3d file with the names replaced or you need to rework the ModelSetup.any file a bit to work on your naming.

Please also note the setting " MarkerUseAllPointsOnOff" in the C3dfile object you could try to set this to be “on” it will then treat all points as markers… Sometimes marker data ends up in the processdata folder because there is a wrong setting in the c3d file, you can read more about this in the manual.

Best regards
Søren

Best regards
Søren

Soren,

Thank you very much. This problem is solved, but now I get the next one:

Model Warning: Study ‘Main.Studies.KinematicStudyForParamterIdentification’ contains too few kinematic constraints to be kinematically determinate.
Model Warning: Study ‘Main.Studies.MotionOptimization’ contains too few kinematic constraints to be kinematically determinate.

I do understand what the problem is: the number of equations is lower than the number off unknown variables. But how do I fix this. Should I include more equations? Which equations?
I have included 9 markers into the model for the movement of the arm.
Is it interesting for you to send you the model?
Or can you give me an suggest an solution without?

Many thanks!

Frederik