[38ba34]: / Body / AAUHuman / Trunk / Calibration / ThoraxCal.any

Download this file

172 lines (145 with data), 6.3 kB

// This is the first calibration file. It will calibrate all the ligaments in the 
// lumbar spine, further sequences will overwrite some values

AnyFolder ThoraxCal ={
  AnyComponentDefinition obj = {};  
  AnyFolder &ThoraxSegs =  ...BodyModel.Trunk.SegmentsThorax;
  AnyFolder &LumbarSegs =  ...BodyModel.Trunk.SegmentsLumbar;
  AnyFolder &CervialSegs = ...BodyModel.Trunk.SegmentsCervicalSpine;
  AnyFolder &RightArmSegs = ...BodyModel.Right.ShoulderArm.Seg;
  AnyFolder &LeftArmSegs = ...BodyModel.Left.ShoulderArm.Seg;
  AnyFolder &RightArmSegs = ...BodyModel.Right.ShoulderArm.Seg;
  AnyFolder &LeftArmSegs = ...BodyModel.Left.ShoulderArm.Seg;
  
  AnyFolder &CervicalJoints =  ...BodyModel.Trunk.JointsCervicalSpine;
  AnyFolder &LumbarJoints =  ...BodyModel.Trunk.JointsLumbar;
  AnyFolder &CervicalJoints =  ...BodyModel.Trunk.JointsCervicalSpine;
  AnyFolder &RightArmJoints = ...BodyModel.Right.ShoulderArm.Jnt;
  AnyFolder &LeftArmJoints = ...BodyModel.Left.ShoulderArm.Jnt;
  
  AnyFolder &Buckle =  ...BodyModel.Trunk.Buckle;
  
  AnyFolder &MusclesSpineRight =  ...BodyModel.Trunk.MusclesSpineRight;
  AnyFolder &MusclesSpineLeft =  ...BodyModel.Trunk.MusclesSpineLeft;
  AnyFolder &MusclesSpine =  ...BodyModel.Trunk.MusclesSpine;
  
  AnyFolder &LumbarSpineLigaments =  ...BodyModel.Trunk.LumbarSpineLigaments;
  //AnyFolder &ThoracicSpineLigaments =  ...BodyModel.Trunk.ThoracicSpineLigaments; //< placeholder
  
  AnyFixedRefFrame ground = 
  {
    AnyRefNode node = 
    { 
      ARel=..LumbarSegs.PelvisSeg.Axes0;
      sRel=..LumbarSegs.PelvisSeg.r0;
    };
  };

  AnyKinEq PelvisFix = 
  {
    AnyKinLinear Lin = 
    {
      AnyRefFrame &ground = ..ground.node;
      AnyRefFrame &Pelvis = .....BodyModel.Trunk.SegmentsLumbar.PelvisSeg;
    };
    AnyKinRotational Rot = 
    {
      Type = RotAxesAngles;
      AnyRefFrame &ground = ..ground.node;
      AnyRefFrame &Pelvis = .....BodyModel.Trunk.SegmentsLumbar.PelvisSeg;
    };
  };
  
  // Posture data //
  AnyFloat ThoraxNeutral  = {  0,  0,  0} * pi/180;
  AnyFloat ThoraxFlex     = {-75,  0,  0} * pi/180;
  AnyFloat ThoraxLatRight = {  0,-30,  0} * pi/180;
  AnyFloat ThoraxExtend   = { 30,  0,  0} * pi/180;
  AnyFloat ThoraxLatLeft  = {  0, 30,  0} * pi/180;
  AnyFloat ThoraxRotLeft  = {  0,  0, 30} * pi/180;
  AnyFloat ThoraxRotRight = {  0,  0, -30} * pi/180;
  
  AnyFloat NeckNeutral  = {  0,  0,  0} * pi/180;
  AnyFloat NeckFlex     = {  0,  0,-45} * pi/180;
  AnyFloat NeckLatRight = { 45,  0,  0} * pi/180;
  AnyFloat NeckExtend   = {  0,  0, 45} * pi/180;
  AnyFloat NeckLatLeft  = {-45,  0,  0} * pi/180;
  AnyFloat NeckRotLeft  = {  0, 75,  0} * pi/180;
  AnyFloat NeckRotRight = {  0,-75,  0} * pi/180;
  
  AnyFloat ThoraxPosData = repmat(1,{
      ThoraxNeutral,
      ThoraxFlex,
      ThoraxLatRight,
      ThoraxExtend,
      ThoraxLatLeft,
      ThoraxRotLeft,
      ThoraxRotRight
    }');
    
    AnyFloat NeckPosData = repmat(1,{
        NeckNeutral,
        NeckFlex,
        NeckLatRight,
        NeckExtend,
        NeckLatLeft,
        NeckRotLeft,
        NeckRotRight
      }');
  
  
  
  // BM_TRUNK_LUMBAR_RHYTHM & BM_TRUNK_CERVICAL_RHYTHM must be turned ON //
  AnyKinEqInterPolDriver NeckJntDriver = {
    AnyKinMeasure& lb = ....BodyModel.Interface.Trunk.SkullThoraxLateralBending;
    AnyKinMeasure& ar = ....BodyModel.Interface.Trunk.SkullThoraxRotation;
    AnyKinMeasure& fe = ....BodyModel.Interface.Trunk.SkullThoraxFlexion;
    Type = PiecewiseLinear;
    T = linspace(0,1,SizesOf(Data)[1]);
    Data = .NeckPosData;
    Reaction.Type = {Off, Off, Off};
  };
  
  AnyKinEqInterPolDriver ThoraxDriver = {
    AnyKinMeasure& PelvisThoraxExtension = ....BodyModel.Interface.Trunk.PelvisThoraxExtension;
    AnyKinMeasure& PelvisThoraxLateralBending = ....BodyModel.Interface.Trunk.PelvisThoraxLateralBending;
    AnyKinMeasure& PelvisThoraxRotation = ....BodyModel.Interface.Trunk.PelvisThoraxRotation;    
    Type = PiecewiseLinear;
    T = linspace(0,1,SizesOf(Data)[1]);
    Data = .ThoraxPosData;
    Reaction.Type = {On,On,On};
  };
  
  #if !BM_ARM_SHOULDER_RHYTHM
  AnyKinEqSimpleDriver SCDriver ={
    AnyKinRotational &SCR =  ....BodyModel.Interface.Right.SternoClavicularProtraction.SCRot;
    AnyKinRotational &SCL =  ....BodyModel.Interface.Left.SternoClavicularProtraction.SCRot;
    DriverPos = {-0.4226357, 0.148608, -0.1283884, -0.4226357, 0.148608, -0.1283884};
    DriverVel = {0.0,0.0,0.0, 0.0,0.0,0.0};
    Reaction.Type={Off,Off,Off, Off,Off,Off};
  };
  #endif
  
  AnyKinEqSimpleDriver WristDriver ={
    AnyKinMeasure& WFR = ....BodyModel.Interface.Right.WristFlexion;
    AnyKinMeasure& WFL = ....BodyModel.Interface.Left.WristFlexion;
    AnyKinMeasure& WAR = ....BodyModel.Interface.Right.WristAbduction;
    AnyKinMeasure& WAL = ....BodyModel.Interface.Left.WristAbduction;
    DriverPos = {0,0,0,0};
    DriverVel = {0,0,0,0};
    Reaction.Type={On,On,On,On};
  };
    
  AnyKinEqSimpleDriver FEDriver ={
    AnyKinMeasure& FER = ....BodyModel.Interface.Right.ElbowFlexion;
    AnyKinMeasure& FEL = ....BodyModel.Interface.Left.ElbowFlexion;
    DriverPos = {0,0};
    DriverVel = {0,0};
    Reaction.Type = {Off, Off};  
  };

  AnyKinEqSimpleDriver PSDriver ={
    AnyKinMeasure& PSR = ....BodyModel.Interface.Right.ElbowPronation;
    AnyKinMeasure& PSL = ....BodyModel.Interface.Left.ElbowPronation;
    DriverPos = {0,0};
    DriverVel = {0,0};
    Reaction.Type = {Off, Off};  
  };
 
  AnyKinEqSimpleDriver GHDriver ={
    AnyKinRotational &GHRotR = ....BodyModel.Interface.Right.GlenohumeralFlexion.GHMeasure;
    AnyKinRotational &GHRotL = ....BodyModel.Interface.Left.GlenohumeralFlexion.GHMeasure;
    DriverPos = pi/180*{10.0,0,0.0, 10.0,0,0.0};  
    DriverVel = {0,0,0,0,0,0};
    Reaction.Type = {Off,Off,Off, Off,Off,Off};  
  };

 
};

// The study: Operations to be performed on the model
AnyBodyCalibrationStudy ThoraxCalibrationStudy = {
  AnyFolder &ref=.ThoraxCal; 
  nStep = 7;
  InitialConditions.SmallStepAssumptionOnOff = Off;
  Kinematics.SmallStepAssumptionOnOff = Off;
  Kinematics.PosAnalysisOnlyOnOff = On;
  InitialConditions.PosAnalysisOnlyOnOff = On;
};