AnyBody™ Tutorials
Lesson 2: Controlling the posture

The Standing Model has been set up to have its posture defined by specification of anatomical angles in the joints. These specifications have been collected in one of the model files, mannequin.any. You can see where this file is included if you scroll down a bit in the StandingModel.any file until you come to this point:

// The Mannequin file specifies load-time positions for all the segments
// in the HumanModel. This is important for the model's ablity to resolve
// all the kinematic constraints when the model is analyzed.
// The mannequin file also drives those degrees of freedom of the human 
// model that are not governed by problem-specific drivers at run time.        
#include "Mannequin.any"

If you double-click the Mannequin.any file name in the editor window, then the file opens up a new window. The first part of the file contains some logic to handle the fact that different models have different body parts. Please skip over that and scroll down until you see the following structure (In the interest of legibility we have removed many of the lines):

AnyFolder Mannequin = {
  
  AnyFolder Posture = {
    
    AnyFolder Right = {      
    };
    
    AnyFolder Left = {
    };
  };
  
AnyFolder PostureVel={  
    
    AnyFolder Right = {      
    };
    
    AnyFolder Left = {
    };
  };
   AnyFolder Load = {
    
    AnyFolder Right = {
    };
    AnyFolder Left = {
    };
  };  // Loads
  
};

This file is typical for the AnyScript language in the sense that it is organized into so-called folders, which is a hierarchy formed by the braces. Each pair of braces delimits an independent part of the model with its own variables and other definitions.

Everything in this file is contained in the Mannequin folder. It contains specifications of joint angles, movements,and externally applied loads on the body. Each of these specifications is again subdivided into parts for the right and left hand sides of the body respectively.

The first folder, Posture, contains joint angle specifications. You can set any of the joint angles to a reasonable value (in degrees), and when you reload the model it will change its posture accordingly. Please make sure that the values are as follows:

AnyFolder Right = {
      //Arm 
      AnyVar SternoClavicularProtraction=-23;   //This value is not used for initial position
      AnyVar SternoClavicularElevation=11.5;    //This value is not used for initial position
      AnyVar SternoClavicularAxialRotation=-20; //This value is not used for initial position
      
      AnyVar GlenohumeralFlexion = 0; 
      AnyVar GlenohumeralAbduction = 10; 
      AnyVar GlenohumeralExternalRotation = 0; 
      
      AnyVar ElbowFlexion = 0.01; 
      AnyVar ElbowPronation = 10.0;
      
      AnyVar WristFlexion =0;
      AnyVar WristAbduction =0;
      
      AnyVar HipFlexion = 0.0; 
      AnyVar HipAbduction = 5.0; 
      AnyVar HipExternalRotation = 0.0;
      
      AnyVar KneeFlexion = 0.0; 
      
      AnyVar AnklePlantarFlexion =0.0; 
      AnyVar AnkleEversion =0.0; 
    };

When these parameters are set for the right hand side, the left hand side automatically follows along and creates a symmetric posture. This happens because each of the corresponding settings in the Left folder just refers back to the setting in the right folder. The ability to do this is an important part of the AnyScript language: Anywhere a number is expected, you can write a reference to a variable instead, or even a mathematical expression, if you need it.

If at any time you want a non-symmetric posture, simply replace some of the variable references in the Left folder by numbers of your choice.

Further down in the Mannequin.any file you find the folder PostureVel. This is organized exactly like Posture, but the numbers you specify here are joint angle velocities in degrees per second. For now, please leave all the values in this folder to zero.

Finally, the last section of the file is named Load. At this place you can apply three-dimensional load vectors to any of the listed points. These load vectors are in global coordinates, which means that x is forward, y is vertical, and z is lateral to the right. Let us apply a vertical load to the right hand as if the model was carrying a bag:

AnyFolder Load = {
    AnyVec3 TopVertebra = {0.000, 0.000, 0.000};
    
    AnyFolder Right = {
      AnyVec3 Shoulder  = {0.000, 0.000, 0.000};
      AnyVec3 Elbow     = {0.000, 0.000, 0.000};
      AnyVec3 Hand      = {0.000, -50.000, 0.000};
      AnyVec3 Hip       = {0.000, 0.000, 0.000};
      AnyVec3 Knee      = {0.000, 0.000, 0.000};
      AnyVec3 Ankle     = {0.000, 0.000, 0.000};
    };
    AnyFolder Left = {
      AnyVec3 Shoulder  = {0.000, 0.000, 0.000};
      AnyVec3 Elbow     = {0.000, 0.000, 0.000};
      AnyVec3 Hand      = {0.000, 0.000, 0.000};
      AnyVec3 Hip       = {0.000, 0.000, 0.000};
      AnyVec3 Knee      = {0.000, 0.000, 0.000};
      AnyVec3 Ankle      = {0.000, 0.000, 0.000};
    };
  };  // Loads

The downward load of -50 N in the right hand roughly corresponds to a weight of 5 kg or 10 lbs. Please reload the model (by pressing F7). If you have done everything right, you should see the comforting message 'Loaded Successfully' in the message window at the lower left hand side of the AnyBody main frame window. Now it is time to perform an analysis.

On the left hand side of the screen you find a tall, narrow window with tabs on its left edge. Please select the Operations tab and find the following:

What you see are different operations, i.e. analysis types, the system can perform on the model. Select the InverseDynamics and click the Run button on the toolbar:

You will see the model move slightly into position and and you are finally awarded with the following message:

...Inverse dynamic analysis completed
Total simulation time: 1.593

The standing model has been set up in such a way that when the muscles are removed from the model, they are automatically replaces by joint torque providers with strengths roughly equivalent to the normal strength of the different degrees of freedom of our joints. So what the analysis has done in the absence of muscles is to compute the necessary joint torques to balance gravity and the hand load in the posture we have selected.

You have just completed your first analysis of an AnyBody model. In the next lesson we shall briefly examine the results and also see what happens if we ad muscles to the model: Lesson 3: Reviewing analysis results .

AnyBody Technology A/S · Niels Jernes vej 10 · DK-9220 Aalborg Ø · Denmark · Tel. +45 9635 4286 · Fax. +45 9635 4599            Sitemap