C3D Project

I am using AMS version 5.1 with the AMMRV1.4 and trying to use the C3D project to analyze a C3D file of a bilateral squat motion. I have lower extremity markers and then the 2 shoulder markers and C7 defining the torso but no markers on the head. I have run through all of the tasks up until the run first timestep where I get an error. My files are attached. I think I need a driver for the neck to remain stiff but am not sure what coding is for that driver or which file it should be placed within.

Thanks!

Also, I forgot to say that we are running a Qualisys system with AMTI force plates.

Hi,

Please refer to the answer from Amir on your previous question.
http://forum.anyscript.org/showthread.php?t=2940

It will be helpful to solve your problem.

Best regards,
Moonki

I have added the following to the JointsAndDriversLocal.any file:

//This is an etsimation of the upper body motion it will enforce that the head is kept above the pelvis medial/laterally
AnyKinEqSimpleDriver LateralBendDriver ={
AnyKinLinear lin ={
AnySeg &ref1= …HumanModel.BodyModel.Trunk.SegmentsLumbar.PelvisSeg;
AnySeg &ref2= …HumanModel.BodyModel.Trunk.SegmentsThorax.SkullSeg;
};
DriverPos={0};
DriverVel={0};
MeasureOrganizer={1};
};

AnyKinEqSimpleDriver NeckDrv={
AnyKinMeasureOrg &ref1= ...HumanModel.BodyModel.Interface.Trunk.NeckJoint; 
DriverPos={0};
DriverVel={0};
Reaction.Type={Off};

};

I am still getting the following error:
0) InitialConditions (Operation: Main.Studies.KinematicStudyForParameterIdentification.InitialConditions):
0) …Design variables have been updated.

  1. …Load-time positions have been re-established.
    Position analysis failed : 271 independent constraints and 272 unknowns
    • attempts to continue (attempt no. 1)
      Position analysis failed : 271 independent constraints and 272 unknowns
    • attempts to continue (attempt no. 2)
      Position analysis failed : 271 independent constraints and 272 unknowns
    • attempts to continue (attempt no. 3)
      Position analysis failed : 271 independent constraints and 272 unknowns
    • attempts to continue (attempt no. 4)
      Position analysis failed : 271 independent constraints and 272 unknowns
    • attempts to continue (attempt no. 5)
      Position analysis failed : 271 independent constraints and 272 unknowns
    • attempts to continue (attempt no. 6)
      Position analysis failed : 271 independent constraints and 272 unknowns
    • attempts to continue (attempt no. 7)
      Position analysis failed : 271 independent constraints and 272 unknowns
    • attempts to continue (attempt no. 8)
      Position analysis failed : 271 independent constraints and 272 unknowns
    • attempts to continue (attempt no. 9)
      Position analysis failed : 271 independent constraints and 272 unknowns
    • attempts to continue (attempt no. 10)
      Constraint no. #3 in ‘Main.Studies.HumanModel.BodyModel.Right.Leg.Jnt.PatellaFemur.Constraints’ above error tolerance 0.001000, error = 0.021430.
      Constraint no. #4 in ‘Main.Studies.HumanModel.BodyModel.Right.Leg.Jnt.PatellaFemur.Constraints’ above error tolerance 0.001000, error = 0.033833.
      Constraint no. #0 in ‘Main.Studies.HumanModel.BodyModel.Right.Leg.Jnt.PatellaMovement’ above error tolerance 0.001000, error = 0.002249.
      Constraint no. #3 in ‘Main.Studies.HumanModel.BodyModel.Left.Leg.Jnt.PatellaFemur.Constraints’ above error tolerance 0.001000, error = 0.021615.
      Constraint no. #4 in ‘Main.Studies.HumanModel.BodyModel.Left.Leg.Jnt.PatellaFemur.Constraints’ above error tolerance 0.001000, error = 0.034126.
      Constraint no. #0 in ‘Main.Studies.HumanModel.BodyModel.Left.Leg.Jnt.PatellaMovement’ above error tolerance 0.001000, error = 0.002303.
      ERROR(OBJ.MCH.KIN3) : C:/U…s/B…d/D…p/A…4/A…n/M…s/C…t/MotionAndParamOptimization.Main.any : KinematicStudyForParameterIdentification.InitialConditions : Kinematic analysis failed in time step 0

Can you please tell me what else I should try?

Thanks!

Hey Brooke,

unfortunately there is something causing trouble in this model. I’m trying to find out what is the reason for that. We assume that it is not necessarily a constraint error and the error message guides us in the wrong direction, but I will continue on that.

I attached a model with your C3D based on the GaitLowerExtremity example with an additional trunk driver (developed by Tim Weber from the University of Regensburg). The optimization starts there without kinematic errors.

I will try to get the C3Dproject started and keep you posted…

Sorry for the inconvenience, I hope you can work with the GaitLowerExtremity for now!


Hello,
I have just started using your program properly in the past week, and I am slowly getting the hang of it. However, upon using the c3dproject files instead of the gaitlowerextremityproject ones I have run into numerous errors in getting an optimised result. I’ve been trying quite a few things, from attempting a better initial position, starting at different times, removing markers from the analysis, reducing initial kinematic tolerance- none of it has helped! I’m just hoping that it’s not too tricky of a fix, because the C3d Project files seem like a big improvement on the GaitLowerExtremity ones (I also had issues getting an optimised result in that too. Is it perhaps because of the motion being studied? It is a golf swing, which could be hard for the program to analyse.

Sorry for the long message, but I’m out of ideas! Any help would be appreciated.

Thanks,
Leigh

Hey Leigh,

I just ran your model and found some wrong settings. It might be simple to get the C3D project running.
First, have a look at your LASI and RASI markers. I think they are switched.
Second, try not to optomize all the bone segments. Switch all of them off, see if it runs, then turn them on one-by-one. I guess pelvis optimisation might cause trouble in your case. Additionally, some users have trouble with the thigh optimization.

I switched LASI and RASI and changed it to no pelvis width optimization and it made 151 steps kinematically immediately…

Details:
Change 1 in the markers.any
CreateMarkerTDWidget LASI ( //this was RASI before
MarkerName=PrefixDef(LASI), //this was RASI before
MarkerPlacement=Trunk.SegmentsLumbar.PelvisSeg,
OptX=“Off”,OptY=“Off”,OptZ=“Off”,
WeightX=1.0,WeightY=1.0,WeightZ=1.0,
Model1=MotionAndParameterOptimizationModel, Model2= InverseDynamicModel
) = { sRelOpt = {0.11, -0.03, 0.145}};

CreateMarkerTDWidget RASI ( //this was LASI before
MarkerName=PrefixDef(RASI) , //this was LASI before
MarkerPlacement=Trunk.SegmentsLumbar.PelvisSeg,
OptX=“Off”,OptY=“Off”,OptZ=“Off”,
WeightX=1.0,WeightY=1.0,WeightZ=1.0,
Model1=MotionAndParameterOptimizationModel, Model2= InverseDynamicModel
) = { sRelOpt = {0.11, -0.05+0.02, -0.145};};

Change 2 in ModelSetup.any
OptimizeAnthropometricsOnOff OptimizeOnOff (
PelvisWidthOnOff =“Off”,
ThighLengthOnOff=“Off”,
ShankLengthOnOff=“Off”,
FootLengthOnOff=“Off”,
HeadHeightOnOff=“Off”,
TrunkHeightOnOff=“Off”,
UpperArmLengthOnOff=“Off”,
LowerArmLengthOnOff=“Off”,
HandLengthOnOff=“Off”,
Model1=MotionAndParameterOptimizationModel, Model2= InverseDynamicModel, Model3=IntialPositionStudy ) ={};


Hello Again,

Thank you very much for your help- I applied the changes and am starting to get some results back now.

I just have another question regarding the C3dProject program; Is it possible to make it a full body simulation, or is it the project not designed to be adjusted? I am having issues after adding the arms into the study- it comes back saying trunk is an unresolved object, even though I do not remove the trunk. This could be a very simple error, but I have sent the zip file again anyways.

Thanks a lot for your help while I am learning about AnyBody- It is very much appreciated!

Thanks,
Leigh

Hello Leigh,

sorry for the delayed response.

Currently, the C3D Project is only setup for lower extremities. It is of course to adapt it to the FullBody, but this will be a longer procedure.

Therefore, if yo want to analyze the upper extremity you can switch once again to the FullBodyGait or you will need to do several changes to the C3D Project.

If you say now that you want to do the C3D Project, then I will assist you in this procedure, but this will be in several steps. And might take some time!

first step will be to get rid of the “trunk” error messages, but then you will need to include drivers for the upper extremities! They are already defined in the FullBodyGait model, so we might be able to copy them from there…

If you still want to do the C3D Project, the start will be to find that file:
“…/…/…/Body/AAUHuman/BodyModels/include/MannequinDriversWidget.any”
Make a copy in case something goes wrong! Now, go into this file and change the paths that start with
…HumanModel.Right.
…HumanModel.Left.
…HumanModel.Trunk.
into:
…HumanModel.BodyModel.Right.
…HumanModel.BodyModel.Left.
…HumanModel.BodyModel.Trunk.

that should allow you to load the model, however it will complain about to few constraints …

this will lead to getting the drivers for the upper body…


Hello again Amir,

I would like if possible to convert the C3DProject into a full body analysis.

I have put in the modifications that you suggested, (into a seperate copied database) which got rid of the trunk errors, and have spent the last week or so trying to work out how to insert the upper body drivers into the script, but I have not been able to get it to work.

It took so long for me to reply because I do not want to hassle you with every single little problem that I come across, but I might need your help to guide me through the process on this because some of this is quite far beyond me at the moment.

Thank you,
Leigh

Hey Leigh,

I’m traveling this week, but I will help you of course. If you struggle to continue, load the model up here and a short explanation of what you did, and what error you get…


Amir, I would still like to use the C3d project files that I sent you a while ago. Did you ever determine the problem? I’m running gaitlowerextremity from AMMRv1.2 but would like to be using the most current version.

Brooke,

sorry, I’m getting a bit confused in this post. I just realized that you are not within the same group as Leigh.
I could not find out which error causes this trouble. I assume the Initial Positioning is not exact enough. In this model it is crucial to have a good initial position. So you have to try to find a better position. You out-commented the linear widget. I think you have to adapt the Y and Z axis to the new global coordinate system.

We will soon release a new version of the C3D project, see attached screenshots, that make it very simple to use and in a preliminary test I could run the model with your C3D (see screenshots). If you can wait a couple weeks, then you will be able to use this new model.