[38ba34]: / Body / AAUHuman / Arm / InitialPositions.any

Download this file

99 lines (79 with data), 3.4 kB

AnyFolder &Trunk=..Trunk;
//right humerus
Seg.Humerus.Axes0 =
Trunk.SegmentsRibCage.SternumSeg.Axes0*
ShoulderRef.ARel*
ShoulderRef.RotNode.ARel*
#ifndef ANYBODY_DISABLE_HUMMERAL_ABTUCTION_PERTUBATION  
RotMat((pi/180)*.JointPos.GlenohumeralAbduction
      + iffun(orfun(.JointPos.GlenohumeralFlexion, .JointPos.GlenohumeralAbduction), 0.0, 0.001)
      ,x)*
#else
RotMat((pi/180)*.JointPos.GlenohumeralAbduction,x)*
#endif
RotMat((pi/180)*.JointPos.GlenohumeralFlexion,z)*
RotMat((pi/180)*.JointPos.GlenohumeralExternalRotation,y)*
Seg.Humerus.gh.RotNode.ARel'*
Seg.Humerus.gh.ARel';

//right ulna
Seg.Ulna.Axes0 = 
Seg.Humerus.Axes0*
Seg.Humerus.fe.ARel*
Seg.Humerus.fe.RotNode.ARel*
RotMat((pi/180)*.JointPos.ElbowFlexion,x)*
Seg.Ulna.fe.RotNode.ARel'*
Seg.Ulna.fe.ARel';


//right Radius
Seg.Radius.Axes0 = 
Seg.Ulna.Axes0*
Seg.Ulna.ps2.ARel*
Seg.Ulna.ps2.RotNode.ARel*
RotMat((pi/180)*.JointPos.ElbowPronation ,x)*
Seg.Radius.PointPS2.RotNode.ARel'*
Seg.Radius.PointPS2.ARel';




//wrist joint
Seg.WristJointSeg.Axes0 =
Seg.Radius.Axes0*
Seg.Radius.wj.ARel*
Seg.Radius.wj.RotNode.ARel*
RotMat((pi/180)*.JointPos.WristFlexion,y)*
Seg.WristJointSeg.FlexionExtensionAxis.RotNode.ARel'*
Seg.WristJointSeg.FlexionExtensionAxis.ARel';


// hand

#if !((BM_ARM_RIGHT & BM_ARM_DETAILED_HAND) | (BM_ARM_LEFT & BM_ARM_DETAILED_HAND))
  AnySeg &HandSeg = Seg.Hand;
#else
  AnySeg &HandSeg = Seg.Hand.Carpals;
#endif

HandSeg.Axes0 =
Seg.WristJointSeg.Axes0*
Seg.WristJointSeg.RadialUlnarDeviation.ARel*
Seg.WristJointSeg.RadialUlnarDeviation.RotNode.ARel*
RotMat((pi/180)*.JointPos.WristAbduction,z)*
Seg.Hand.HandRef.wj.RotNode.ARel'*
Seg.Hand.HandRef.wj.ARel';




Seg.Humerus = {
#ifndef ANYBODY_DISABLE_HUMMERAL_ABTUCTION_PERTUBATION  
#ifndef ANYBODY_DISABLE_HUMMERAL_ABTUCTION_PERTUBATION_WARNING

#ifndef ANYBODY_DISABLE_HUMMERAL_ABTUCTION_PERTUBATION_WARNING
#define ANYBODY_DISABLE_HUMMERAL_ABTUCTION_PERTUBATION_WARNING
#endif
  
 AnyFloat AbductionInitialPosturePertubation = warn(orfun(...JointPos.GlenohumeralFlexion, ...JointPos.GlenohumeralAbduction)
 , strformat("\n"+
  "\n"+
  "-----------------------------------------------------------------------------------------------------------------------------------\n"+
  "         WARNING: Problematic start mannequin values for GlenohumeralFlexion/GlenohumeralAbduction. \n"+
  " \n"+ 
  "  The initial postures (mannequin values) GlenohumeralFlexion (0 deg) and GlenohumeralAbduction (0 deg) can cause problems as initial because \n"+
  "  some measures/drivers which uses on the humurus 'plane of elevation' (i.e. shoulder rhythm) have a sigularity at these angles. \n"+
  "  \n"+
  "  A small pertubation to the inital values for the humeral abduction have automatically been applied. \n"+
  "  \n"+
  "  You can avoid this warning by changing the values in HumanModel.Mannequin.Posture\n"+
  "  or by setting the one of the following statements to suppress either the warning or disable the automatic small pertubation: \n"+
  "      #define ANYBODY_DISABLE_HUMMERAL_ABTUCTION_PERTUBATION_WARNING \n"+
  "      #define ANYBODY_DISABLE_HUMMERAL_ABTUCTION_PERTUBATION \n"+
  "-----------------------------------------------------------------------------------------------------------------------------------\n"));

#endif
#endif
};