Forums Anyscript.org  

Go Back   Forums Anyscript.org > Professional Forum > Debug model

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 02-22-2017, 07:41 PM
Zach_Welshman Zach_Welshman is offline
Member
 
Join Date: Sep 2016
Posts: 38
Default GMFoot MoCap and RBF Scaling

Hello, I've been trying to get the GM foot model to run with the suggested RBFLandmark scaling for each individual bones. I can scale and morph each bone with the GMFreePosture Model, but would like to incorporate this with gait data. I've attached my model in a zip file below.

When i run my model it returns with:
Code:
ERROR(SCR.SCN6) :   D:/D..s/A..s/A..y/Body/A..n/B..s/G..t/BodyModel.any(37)  :   'TRUNK' :  Unexpected character.
Model loading skipped
Thank you for any help you can provide.
Thanks,
Zach
Attached Files
File Type: zip MoCap-GMFootZW.zip (2.98 MB, 17 views)
Reply With Quote
  #2  
Old 02-28-2017, 03:07 PM
pgalibarov's Avatar
pgalibarov pgalibarov is offline
Senior Member
 
Join Date: Oct 2010
Posts: 926
Default

Hi Zach,

I am sorry for the late reply.

Unfortunately the structure of the MoCap models is a little different from other models. You need to do a few modifications to make it work with the subject-specific scaling functions.
1. Please copy Body\AAUHuman\Scaling\FootScaling\ScalingLengthMas sFatRBF.any into the Model folder.

In MoCap-Model/Model you need to find HumanModel.any and change the path to be relative and looking at the file that you copied:
Code:
//     #include "<ANYBODY_PATH_BODY>\Scaling\FootScaling/ScalingLengthMassFatRBF.any"
   #include "ScalingLengthMassFatRBF.any"
2. In ScalingLengthMassFatRBF.any for the segments that you individualize you would need to define a block like the example below:

Code:
      
      AnyFolder Thigh = {
        AnyVar LengthScale  = ...AnthroSegmentLengths.Right.ThighLength / ...StandardParameters.Right.Thigh.Length;
        AnyVar ms = ...MassScaling.Right.Thigh.MassScale;
        AnyVar ls = LengthScale;
        
        #ifndef CUSTOM_SCALING_Right_Thigh
        AnyFunTransform3DLin ScaleFunction = {
          ScaleMat = {{(.ms/.ls)^0.5, 0, 0},{0, .ls, 0},{0, 0, (.ms/.ls)^0.5}} ;
          Offset = {0, 0, 0};
        };
        #else
        
        #endif
        
      };
    }; // Right
This block of code should exclude ScaleFunction if CUSTOM_SCALING_#SIDE#_#SEGMENT# is specified.

This should be sufficient. Please let me know if that makes sense and you can make it work.

Kind regards,
Pavel
Reply With Quote
  #3  
Old 03-06-2017, 05:05 PM
Zach_Welshman Zach_Welshman is offline
Member
 
Join Date: Sep 2016
Posts: 38
Default GMFoot MoCap and RBF Scaling

Hi Pavel, again thank you for your time, I see where the differences exist between the free posture and the mocap models.

I've completed the changes and the model is returning:

Code:
Closing model...
Deleting last loaded model...
...Model deleted.
Loading  Main  :  "D:\Documents\Anyscripts\AMMR.v1.6.2-MyDemo - Copy\Application\Beta\MoCap-GMFoot\MoCap-GMFoot.main.any"
Scanning...
Parsing...
Constructing model tree...
Linking identifiers...
Evaluating constants...
ERROR(SCR.EXP0) :   D:/D..s/A..s/A..y/A..n/Beta/M..t/M..l/Environment.any(53)  :   'sRel'  :  Error in expression. Please refer to the following error messages for details ...
ERROR(SCR.EXP.FUN.EXT8) :   D:/D..s/A..s/A..y/A..n/Beta/M..t/M..l/Environment.any(37)  :   LocationFunction  :  Exception in Python extention module.
  Python error : 
Model loading skipped
The Python file FootLocation4 is already in the model folder.
I look forward to your reply.
Many Thanks,
Zach
Attached Files
File Type: zip MoCap-GMFootZW2.zip (4.74 MB, 2 views)
Reply With Quote
  #4  
Old 03-07-2017, 12:52 PM
pgalibarov's Avatar
pgalibarov pgalibarov is offline
Senior Member
 
Join Date: Oct 2010
Posts: 926
Default

Zach,

I tried and got the same error. And it seems that you may be using Python 3 and it has changed a couple of functions. Please try this correction, it worked for me.

Kind regards,
Pavel
Reply With Quote
  #5  
Old 03-07-2017, 12:53 PM
pgalibarov's Avatar
pgalibarov pgalibarov is offline
Senior Member
 
Join Date: Oct 2010
Posts: 926
Default

Please rename it into .py
Attached Files
File Type: txt FootLocation4.txt (10.1 KB, 3 views)
Reply With Quote
  #6  
Old 03-07-2017, 01:33 PM
Zach_Welshman Zach_Welshman is offline
Member
 
Join Date: Sep 2016
Posts: 38
Default GMFoot MoCap and RBF Scaling

Thanks Pavel, the model is loading now. As you can probably see too, there seems to be a problem with the location rest of the foot, but I will investigate this further when i try an individualise more bones into the GM model, perhaps this will adjust the foot when these bones are morphed.

Thanks for your help Pavel.
Zach
Reply With Quote
  #7  
Old 03-13-2017, 11:08 AM
Zach_Welshman Zach_Welshman is offline
Member
 
Join Date: Sep 2016
Posts: 38
Default GMFoot MoCap and RBF Scaling

Hi Pavel, I can get it to work with each the calcaneus and talus separately, but I am getting an "object already declared at" error when i try to combine the laws. I tried to change the name of the scale function of one of the bones but then i get another error at the AnyInt.

My ScalingLengthMassFatRBF folders look like
Code:
 // AnyFolder &Talus = Foot;
		
        AnyFolder Talus = {
        AnyVar LengthScale  = ...AnthroSegmentLengths.Right.TalusLength / ...StandardParameters.Right.Talus.Length;
        AnyVar ms = ...MassScaling.Right.Talus.MassScale;
        AnyVar ls = LengthScale;
        
        #ifndef CUSTOM_SCALING_Right_Talus
        AnyFunTransform3DLin ScaleFunction = {
          ScaleMat = {{(.ms/.ls)^0.5, 0, 0},{0, .ls, 0},{0, 0, (.ms/.ls)^0.5}} ;
          Offset = {0, 0, 0};
        };
        #else
        
        #endif
        
      };
        
     // AnyFolder &Calcaneus = Foot;
        
        AnyFolder Calcaneus = {
        AnyVar LengthScale  = ...AnthroSegmentLengths.Right.CalcaneusLength / ...StandardParameters.Right.Calcaneus.Length;
        AnyVar ms = ...MassScaling.Right.Calcaneus.MassScale;
        AnyVar ls = LengthScale;
        
        #ifndef CUSTOM_SCALING_Right_Calcaneus
        AnyFunTransform3DLin ScaleFunction = {
          ScaleMat = {{(.ms/.ls)^0.5, 0, 0},{0, .ls, 0},{0, 0, (.ms/.ls)^0.5}} ;
          Offset = {0, 0, 0};
        };
        #else
        
        #endif
        
      };
and my HumanModel file looks like:
Code:
 //Choose between scaling laws
  //#include "<ANYBODY_PATH_BODY>Scaling\ScalingUniform.any"
  //#include "<ANYBODY_PATH_BODY>Scaling\ScalingLengthMass.any" 
  //#include "<ANYBODY_PATH_BODY>Scaling\FootScaling\ScalingLengthMassFat.any" 
  //#include "<ANYBODY_PATH_BODY>\Scaling\FootScaling/ScalingLengthMassFatRBF.any"
    #include "ScalingLengthMassFatRBF.any"
 
  Scaling = {
    //This is the file which set the segments lenghts
    #include "AnyManRBF.any" 
    
    //GeometricalScaling.Right.Foot = {#include "../Scaling/RBFLandmarksTalus.any"};
	GeometricalScaling.Right.Foot = {#include "../Scaling/RBFLandmarksCalcaneus.any"};
    
    //MorphingLandmarks = {AnyFolder &SegRef = Main.Studies.HumanModel.BodyModel.Right.Leg.Seg;};
    //#include "<ANYBODY_PATH_BODY>Scaling\FootScaling\MorphingLandmarks.any"
  };
  #include "FootType.any"
};
I'm sure it's a trivial organisational problem, sorry!
Attached Files
File Type: zip MoCap-GMFootZW.zip (21.50 MB, 3 views)
Reply With Quote
  #8  
Old 03-13-2017, 11:26 AM
pgalibarov's Avatar
pgalibarov pgalibarov is offline
Senior Member
 
Join Date: Oct 2010
Posts: 926
Default

Hi Zach,

Yes, it is simple. You provide your RBF scaling functions and redefine the scaling law at the same time to contain a linear scaling functions. They conflict.

The way I expected you to work was to modify the scaling law, and externally add this block:

Code:
 
#define CUSTOM_SCALING_Right_Talus
#define CUSTOM_SCALING_Right_Calcaneus

Scaling = {
    //This is the file which set the segments lenghts
    #include "AnyManRBF.any" 
    
    GeometricalScaling.Right.Foot = {#include "../Scaling/RBFLandmarksTalus.any"};
    GeometricalScaling.Right.Foot = {#include "../Scaling/RBFLandmarksCalcaneus.any"};
    
    //MorphingLandmarks = {AnyFolder &SegRef = Main.Studies.HumanModel.BodyModel.Right.Leg.Seg;};
    //#include "<ANYBODY_PATH_BODY>Scaling\FootScaling\MorphingLandmarks.any"
  };

Please note that this code should be included before HumanModel.any so it would have an effect. Just remove it and define before:

Code:
  #if MotionAndParameterOptimizationModel
  #include "Model/Kinematics.any"
  #endif 
  
  #if InverseDynamicModel
  #include "Model/InverseDynamics.any"
  #endif
Hope this makes sense.

Kind regards,
Pavel
Reply With Quote
  #9  
Old 03-13-2017, 01:36 PM
Zach_Welshman Zach_Welshman is offline
Member
 
Join Date: Sep 2016
Posts: 38
Default GMFoot MoCap and RBF Scaling

Hi Pavel, i'm getting back error:

Code:
Closing model...
Deleting last loaded model...
...Model deleted.
Loading  Main  :  "D:\Documents\Anyscripts\AMMR.v1.6.2-MyDemo - Copy (2)\Application\Beta\MoCap-GMFoot\MoCap-GMFoot.main.any"
Scanning...
Parsing...
Constructing model tree...
ERROR(SCR.PRS9) :   D:/Documents/A..s/A..)/Body/A..n/FootGM/Seg.any(223)  :   'ScaleFunction'  :  Unresolved object
Model loading skipped
this is after defining the custom scaling laws.
Code:
Main = {
  
 //** ModelSetup will let you edit the general Marker setup and the Foot Folder location** 
  #include "Model/ModelSetup.any" 
 //** Trials will let you edit names and Start-End times of the trials** 
  #include "Model/TrialSpecificData3.any"

  #define CUSTOM_SCALING_Right_Talus
  #define CUSTOM_SCALING_Right_Calcaneus
  
  #if MotionAndParameterOptimizationModel
  #include "Model/Kinematics.any"
  #endif 
  
  #if InverseDynamicModel
  #include "Model/InverseDynamics.any"
  #endif

}; //Main
Sorry if i have misunderstood Pavel.
Many Thanks,
Zach
Reply With Quote
  #10  
Old 03-13-2017, 02:21 PM
pgalibarov's Avatar
pgalibarov pgalibarov is offline
Senior Member
 
Join Date: Oct 2010
Posts: 926
Default

Zach,

The place to provide these #defines is correct. Did you remove definition of custom scaling functions from HumanModel.any?

If yes, you need to provide them again. If not - it could be that the one for calcaneus is commented out. Please check.

The logic is simple: the scaling law should either use linear one or custom - these switched control behaviour.

Pavel
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 10:22 PM.