Angle sequence

Hi

I am working on a model that has the scapula, humerus and rotator cuff muscles (based on the shoulder model from the repository). When I define the GH joint I do the same as the shoulder model i.e.:

  AnyKinRotational GHRot = 
  {
    AnyRefNode &Scapula_gh= ..Segs.Scapula.gh;
    AnyRefNode &Humerus_gh= ..Segs.Humerus.gh;
    Type = RotAxesAngles;
    Axis1 = y;
    Axis2 = z;
    Axis3 = y;
  };
  
  AnyKinLinear GHLin = 
  {
    AnyRefNode &Scapula_gh= ..Segs.Scapula.gh;
    AnyRefNode &Humerus_gh= ..Segs.Humerus.gh;
    Ref = 0;
  };
  
  AnyKinEq GHLinCon = {
    AnyKinMeasure &GHLinCon = .GHLin;
  };

I then drive the joint using:

AnyKinEqSimpleDriver GHMotion = {
  AnyKinRotational &Joint =Main.BodyModel.Joints.GHRot;
  DriverPos = pi/180*{.Parameters.yrot,.Parameters.zrot,.Parameters.y2rot};
  DriverVel = pi/180*{0,0,0};
  Reaction.Type = {Off,Off,Off};
}; // GHMotion

However I get the following error when I run the kinematics and the model view disappears:


  1. Operation Sequence: (Operation: Main.RunApplication):
    0.0) Kinematics (Operation: Main.MyStudy.Kinematics):
    0.0.0) PreOperation (Operation: Main.MyStudy.Kinematics.PreOperation):
    0.0.0) InitialConditions (Operation: Main.MyStudy.InitialConditions):
    0.0.0) …Design variables have been updated.
    WARNING(OBJ.MCH.KIN6) : D:/Anybody/Work…iles/T…s/Feb28/TwoBones.any : GHRot : Close to singular position : Orientation close to Gimbal Lock, i.e., first and third axis of rotation being parallel
    0.0.1) …Load time positions have been re-established.
    0.0.2) …Kinematic analysis completed. The kinematic constraints have been resolved.
    ERROR(OBJ.LIB.OOS1) : D:/Anybody/Work…les/T…s/Feb28/MuscleDef.any : infraspinatus_1.SPLine : Unexpected exception in the library OOSol :
    OOSol exception : MISSING MESSAGE.

This error does not occur if I change the axis sequence to x,y,z - in this case the model works as intended. Any ideas what might be causing the problem? I have tried changing to parameters that drive the kinematics in case it was the particular angles chosen but this did not help.

Thanks for the help

Monique

Hi Monique,

The Y,Z,Y sequence is a special way to drive the shoulder, and in some ways it is prone to create a gimbal lock. You was actually close to it (see the warning). You will see that in the repository even if the joint itself is defined with the Y,Z,Y sequence, we actually use a different one to drive it (X,Z,Y in the interface folder). That one is less likely to create a gimbal lock. You are welcome to use it.

The SPline error means that the muscle failed to wrap correctly over the surface. That is closely related to the kinematic. So probably changing the axis sequence gives you a different motion which doesn’t fail on the wrapping.

Best regards, Sylvain.

Hi Sylvain

I am looking at the BergmannGH model. I cannot see how this uses the driver you mentioned (X,Z,Y). To me it seems that you drive GlenohumeralExternalRotation using the value in the manequin file which is zero and then drive the GlenohumeralAbduction using a sin funtion. There is also a constraint to keep the hand in the frontal plane - I am not sure if this affects GlenohumeralFlexion.

Could you please provide some clarification. I would like to drive the glenohumeral joint in all 3 directions - in this case I do not see how you can define the joint with one angle sequence (yzy) but drive it with another.

Thanks for the help

Monique

Hi

I have looked more closely at the interface file and I understand that this defines the dof to be driven. I guess this leaves me with just the following question:

  1. I have joint angles in the rotation sequence yzy (these angles have been dervied from vicon data).

  2. I have a model with the glenohumeral joint defined using the ISB sequence i.e. yzy

Can I drive the model using the angle data that I have i.e. in the same sequence as the model definition? If not I can only think of using rotation matrices to transform the kinematic data to a different rotation sequence to drive the model - however this does not seem like the simplest way to solve the problem.

Any ideas?

Monique

Hi Monique,

If you have the rotations measured in a certain way in terms of coordinate systems being used and sequence of rotations, then we would usually simply do the following:

1 create new nodes in the joint center on both segments.
2 use the ARel property to rotate the coordinate systems of these node to be identical to how the measurement was done.
3 create a rotational measure with the correct rotation sequence between the two new nodes.
4 use the new rotational measure for driving the model.

Best regards
Søren

In this example which is the reference frame and which is the referred frame and how is the right calculate in anybody for the rotation matrices?

AnyKinRotational GHRot =
{
AnyRefNode &Scapula_gh= …Segs.Scapula.gh;
AnyRefNode &Humerus_gh= …Segs.Humerus.gh;
Type = RotAxesAngles;
Axis1 = y;
Axis2 = z;
Axis3 = y;
};

Is this the right calculation:

Rotmat=humerus*scapula(T)

Hi Johannes,

In AnyBody, always the first mentioned RefFrame (node) is the Reference Frame used for the translation or rotation. So in this example, it is the scapula_gh.

I’m assuming you want to get the rotation matrix between both nodes?

I added a little section to the Wiki that explains how to calculate positions and rotations between two segments/nodes.

http://wiki.anyscript.org/index.php/All_about_Kinematics#How_can_I_measure_pelvis_position_and_rotation_wrt_to_the_femur.3F

I hope that helps.

Hello aalmunajjed,

perfect, that is excactly what I'm looking for.

Thanks a lot!

Hallo again,

one more and I hope the last question.

Are the i.e. Femur.Axes build out of row or column vektors?

Hi Johannes,

row vectors.


Thanks a lot!!!

Best regards,

Johannes