Forums Anyscript.org  

Go Back   Forums Anyscript.org > Professional Forum > AnyGait

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-12-2017, 01:02 PM
robin_layton robin_layton is offline
Junior Member
 
Join Date: Nov 2016
Posts: 8
Default Problem with using own gait data in MoCap_LowerBody.main

Hi,

I am new to AnyBody and have had a few issues when using my own c3d file in the MoCap_LowerBody.main file. The c3d file has 28 anatomical markers plus tracking markers at the thigh and shank. The lab has two force platforms with Z=vertical plane.

The model seems to load fine, however when running the motion and parameter optimization an error occurs:

Code:
#### Macro command : RunMotionAndParameterOptimizationSequence(3:5)> classoperation Main.Studies.ParameterIdentification "Save design" --file="../Input/LowerBody-AnybodyTest-OptimizedParameters.txt"
Main.Studies.ParameterIdentification :  Saving design...

#### Macro command : RunMotionAndParameterOptimizationSequence(4:5)> operation Main.Studies.MotionOptimization.Kinematics

#### Macro command : RunMotionAndParameterOptimizationSequence(5:5)> run
5.0) Kinematics (Operation: Main.Studies.MotionOptimization.Kinematics): 
5.0.0) PreOperation (Operation: Main.Studies.MotionOptimization.Kinematics.PreOperation): 
5.0.0.0) InitialConditions (Operation: Main.Studies.MotionOptimization.InitialConditions): 
5.0.0.0) ...Design variables have been updated.
5.0.0.1) ...Load-time positions have been re-established.
WARNING! NAN reached!
Unexpected error in computational kernel
ERROR(OBJ.MCH.KIN3) :   S:/M..p/R..]/P..6/A..y/R..y/A..o/A..n/M..n/M..l/Kinematics.any(74)  :   MotionOptimization.InitialConditions  :  Kinematic analysis failed in time step 0
I have attached the main model. I suspect that the error may relate to my adapted marker labels and possibly the 'sRelOpt'?

Any advice would be greatly appreciated.

Thanks,
Robin
Attached Files
File Type: any Markers - my protocol.any (23.4 KB, 7 views)
File Type: any MoCap_LowerBody.main.any (2.3 KB, 4 views)
Reply With Quote
  #2  
Old 01-16-2017, 11:08 AM
toerholm's Avatar
toerholm toerholm is offline
AnyBody Support
 
Join Date: Feb 2009
Posts: 924
Default

Hi Robin,

This error may indicate two things, either you have not enough markers on so a certain dof in the model is not driven either by a marrkers or something else. Secondly it may happen you you have to perefectly identical kinematic constraints in the model.


I took a quick look in the marker file and noticed that some markers intended for the left leg was actually being attached to the right leg.

See eg:

Code:
CreateMarkerDriver L1stMetProx (
MarkerName= L1stMetProx,  
MarkerPlacement=Right.Leg.Seg.Foot,

Please go though all markers and ensure there are no such errors, this error could lead to the problem you have encountered.

Best regards
Søren
__________________
TIP: How to save and load results.
http://wiki.anyscript.org/index.php/All_about_AnyBody_Modeling_System#Save_Load_and_Re play_Results

Subscribe to the forums, click the 'Forum Tools' link above the list of threads then select 'Subscribe to Forum'. You will then have the option to choose the subscription mode for this forum and get an email automatically.
Reply With Quote
  #3  
Old 01-18-2017, 03:01 PM
robin_layton robin_layton is offline
Junior Member
 
Join Date: Nov 2016
Posts: 8
Default

Søren,

Thank you for the reply, I believe I have removed any errors from the marker protocol and the kinematics are now running fine. However, I am now having an issue with running the inverse dynamics. I have pasted the error below.

Code:
0) InverseDynamics (Operation: Main.Studies.MotionOptimization.InverseDynamics): 
0.0) PreOperation (Operation: Main.Studies.MotionOptimization.InverseDynamics.PreOperation): 
0.0.0) InitialConditions (Operation: Main.Studies.MotionOptimization.InitialConditions): 
0.0.0) ...Design variables have been updated.
0.0.1) ...Load-time positions have been re-established.
0.0.2) ...Kinematic analysis completed. The kinematic constraints have been resolved.
0.0.3) ...Initial conditions are fully updated.
0) Inverse dynamic analysis...
ERROR(OBJ.MCH.MUS4) :   S:/M..p/R..]/P..6/A..y/R..y/A..o/A..n/M..n/M..l/Kinematics.any(74)  :   MotionOptimization.InverseDynamics  :  Muscle recruitment solver :  solver aborted due to singular KKT matrix
Could you please suggest which part of the model I should look at to try to fix this. Thanks again for your input.

Robin
Reply With Quote
  #4  
Old 01-19-2017, 09:40 AM
toerholm's Avatar
toerholm toerholm is offline
AnyBody Support
 
Join Date: Feb 2009
Posts: 924
Default

Hi Robin,

This error indicates that there might be a problem with the way the forces are applied to the model.

The error basically means that there was no way the solver was able to balance the system.

Please review the forceplates applied in the model? are there any?

Best regards
Søren
__________________
TIP: How to save and load results.
http://wiki.anyscript.org/index.php/All_about_AnyBody_Modeling_System#Save_Load_and_Re play_Results

Subscribe to the forums, click the 'Forum Tools' link above the list of threads then select 'Subscribe to Forum'. You will then have the option to choose the subscription mode for this forum and get an email automatically.
Reply With Quote
  #5  
Old 01-19-2017, 02:05 PM
robin_layton robin_layton is offline
Junior Member
 
Join Date: Nov 2016
Posts: 8
Default

Søren,

Thank you for the suggestion, there are two force plates (Type 4 and type 2). I cannot see any errors in model/environment. I have attached the force plate code below in case there is something I may have missed.

Code:
   ForcePlateType4AutoDetection Plate1 (
    PlateName = Plate1,
    Folder =Main.ModelSetup.C3DFileData,
    Limb1=  .BodyModelRef.Right.Leg.Seg.Foot,
    Limb2=  .BodyModelRef.Left.Leg.Seg.Foot,
    No=0,
    VerticalDirection ="Z",
    HeightTolerance=0.07,
    VelThreshold=2.2,
    Fx=Main.ModelSetup.C3DFileData.Analog.DataFiltered.FX1,
    Fy=Main.ModelSetup.C3DFileData.Analog.DataFiltered.FY1,
    Fz=Main.ModelSetup.C3DFileData.Analog.DataFiltered.FZ1,
    Mx=Main.ModelSetup.C3DFileData.Analog.DataFiltered.MX1,
    My=Main.ModelSetup.C3DFileData.Analog.DataFiltered.MY1,
    Mz=Main.ModelSetup.C3DFileData.Analog.DataFiltered.MZ1,
    FootPresent=HumanModelPresent)
    ={
      Cal=Main.ModelSetup.C3DFileData.Groups.FORCE_PLATFORM.CAL_MATRIX.Data[0];
      Switch_DrawForceVectorFromCOP = On;
    };

    
    
    
    ForcePlateType2AutoDetection Plate2 (
    PlateName = Plate2,
    Folder =Main.ModelSetup.C3DFileData,
    Limb1=  .BodyModelRef.Right.Leg.Seg.Foot,
    Limb2=  .BodyModelRef.Left.Leg.Seg.Foot,
    No=1,
    VerticalDirection ="Z",
    HeightTolerance=0.07,
    VelThreshold=2.2,
    Fx=Main.ModelSetup.C3DFileData.Analog.DataFiltered.FX2,
    Fy=Main.ModelSetup.C3DFileData.Analog.DataFiltered.FY2,
    Fz=Main.ModelSetup.C3DFileData.Analog.DataFiltered.FZ2,
    Mx=Main.ModelSetup.C3DFileData.Analog.DataFiltered.MX2,
    My=Main.ModelSetup.C3DFileData.Analog.DataFiltered.MY2,
    Mz=Main.ModelSetup.C3DFileData.Analog.DataFiltered.MZ2,
    FootPresent=HumanModelPresent)
    ={
   //  Cal=Main.ModelSetup.C3DFileData.Groups.FORCE_PLATFORM.CAL_MATRIX.Data[1];
//      Switch_DrawForceVectorFromCOP = On;
    };

Kind regards,
Robin
Reply With Quote
  #6  
Old 01-24-2017, 11:18 AM
kasperpihl kasperpihl is offline
Junior Member
 
Join Date: Oct 2015
Posts: 27
Default

Hello Robin,

Just a small note! Are you certain that the "VerticalDirection" variable is matching the direction of your gravity in TrialSpecificData?

Best regards,
Kasper Pihl Rasmussen
Reply With Quote
  #7  
Old 01-24-2017, 02:12 PM
robin_layton robin_layton is offline
Junior Member
 
Join Date: Nov 2016
Posts: 8
Default

Hi Kasper,

Thank you for your suggestion but unfortunately this does not appear to be issue as gravity is set to -9.81 in the Z direction.

Kind regards,
Robin
Reply With Quote
  #8  
Old 02-06-2017, 10:09 AM
kasperpihl kasperpihl is offline
Junior Member
 
Join Date: Oct 2015
Posts: 27
Default

The code for your force plates looks correct to me.

Some ideas for finding the issue:
- Ensure that the plate types are correct with your c3d metadata.
- The Height tolerance seems a bit high, try decreasing it.
- Try running the model with muscles turned off.
Quote:
#define BM_LEG_MUSCLES_BOTH CONST_MUSCLES_NONE
#define BM_TRUNK_MUSCLES CONST_MUSCLES_NONE
- Are you sure you are running things in the correct sequence? (First MotionAndParameterOptimizationModel and then InverseDynamicAnalysisSequence)

If nothing comes up, I can take a look if you share the model.

Best regards,
Kasper Pihl Rasmussen
Reply With Quote
  #9  
Old 02-06-2017, 12:32 PM
robin_layton robin_layton is offline
Junior Member
 
Join Date: Nov 2016
Posts: 8
Default Success!

Kasper,

Many thanks - following your suggestions I have managed to run the inverse dynamics successfully. I am extremely appreciative of your help!

Best wishes,
Robin
Reply With Quote
  #10  
Old 02-06-2017, 01:14 PM
kasperpihl kasperpihl is offline
Junior Member
 
Join Date: Oct 2015
Posts: 27
Default

Glad to hear it. Could you share the solution for us to learn from?

Best,
Kasper
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:29 PM.