Lesson 2: Controlling the posture

The Standing Model has been developed to a fairly complex level, automating many of the operations that are necessary to specify the posture of a full body model. The short story about the kinematics of the model is that it is based on a specification of angles in all the joints. These specifications can be found 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:

//This file contains joint angles which are used at load time for
//setting the initial positions
#include "Mannequin.any"

If you double-click the Mannequin.any file name in the editor window, then the file opens up a new window. You will see a file with the following structure:

AnyFolder Mannequin = {

  AnyFolder Posture = {

    AnyFolder Right = {
    };

    AnyFolder Left = {
    };
  };

  AnyFolder PostureVel={

    AnyFolder Right = {
    };

    AnyFolder Left = {
    };
  };
  AnyFolder Load = {

    AnyFolder Right = {
    };
    AnyFolder Left = {
    };
  };  // Loads

};

(We have removed all the stuff in between the braces.) 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 substitute a variable.

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. To enable the model to actually carry the load we must equip it with muscles. This is done by selecting a body model with muscles:

//This model should be used when playing around with the model in the
//initial modelling phase since leaving the normal muscles out, makes the
//model run much faster. The model uses artificial muscles on each dof. in
//the joints which makes it possible also to run the inverse analysis.
//#include  "..\..\..\BRep\Aalborg\BodyModels\FullBodyModel\BodyModel_NoMuscles.any"

//This model uses the simple constant force muscles
#include  "..\..\..\BRep\Aalborg\BodyModels\FullBodyModel\BodyModel.any"

When you reload the model (by pressing F7) it will take more time than before because it is now equipped with more than 500 muscles. 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 analyze muscle and joint forces.

Also at the upper left hand side of the screen you will see a tree containing 'Main' and 'Study'. If you unfold 'Study' you will get the following:

If you click once on InverseDynamicAnalysis and then on the Run button in the bottom of the window then the system will start analyzing the muscle and joint forces in the model under the influence of gravity and the load we applied to the hand. This takes a few seconds during which you will see the muscles standing out from the body and subsequently falling into place. When the analysis is finished you will notice a slight color change in the muscles and also some bulging, primarily in the right arm. The bulging is proportional to the force in each muscle, and the degree of red color is proportional to the muscles tone.

You have just completed your first analysis of an AnyBody model. In the next lesson we shall briefly examine the results. 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
Copyright (c) AnyBody Technology A/S · 2006 · All rights reserved · Email webmaster@anybodytech.com