Download this file

499 lines (386 with data), 15.8 kB

  // Todo: Write a small description of your model here

Main = {

   AnyFolder  Colors = {
      AnyVec3 Nodes ={235/256,197/256,17/256}; //AnyBody standard yellow
      AnyVec3 Segments = {235/256,197/256,17/256}; //AnyBody standard yellow

};
  AnyFolder BodyParameters = {
      AnyVar BodyMass = 75;
      AnyVar BodyHeight = 1.88;
      AnyVar Density = 1000;
    };

 
  AnyFolder BodyModel = {


    AnyFixedRefFrame GlobalRef = {
      Origin ={0.0,0.1,0.0}; 
      
     AnyDrawRefFrame DrwGlobalRef = {
          ScaleXYZ={0.5,0.5,0.5};
          RGB ={0,0,1}  ;
      };
           
      AnyRefNode PelvisGroundLock = {
         sRel = {0.0,0.0,0.0};
      };    

    };//GlobalRef


//-------------------------------------------------------
// Leg pos definition
//-------------------------------------------------------

    AnyFixedRefFrame FootLocation = {
      AnyDrawRefFrame DrwGlobalRef = {
          ScaleXYZ={0.1,0.1,0.1};
           RGB ={0,0,1}  ;
      };
      Origin ={0.70,-0.4,0.20}; 
    };
    

    AnyFixedRefFrame KneePos = {
      AnyDrawRefFrame DrwGlobalRef = {
          ScaleXYZ={0.1,0.1,0.1};
          RGB ={0,0,1}  ;
      };
      Origin ={0.5,0.0,0.20}; 
    };


 
//-------------------------------------------------------
// Control of GH position
//-------------------------------------------------------
  AnyFixedRefFrame GHPos = {
      AnyDrawRefFrame DrwGlobalRef = {
          ScaleXYZ={0.1,0.1,0.1};
          RGB ={0,0,1}  ;
      };
      Origin ={-0.09,0.58,0.20}; 
    };

   
    
 
//-------------------------------------------------------
// Arm frontal pos definition
//-------------------------------------------------------
  AnyFixedRefFrame HandLocation = {
      AnyDrawRefFrame DrwGlobalRef = {
          ScaleXYZ={0.1,0.1,0.1};
          RGB ={0,0,1}  ;
      };
      Origin ={0.45,0.4,0.20}; 
    };

   AnyFixedRefFrame ElbowPos = {
      AnyDrawRefFrame DrwGlobalRef = {
          ScaleXYZ={0.1,0.1,0.1};
          RGB ={0,0,1}  ;
      };
      Origin ={0.3,0.4,0.20}; 
    };
    #include "Body.Model.any"

 };//BodyModel

  
//-------------------------------------------------------
//This Seg
//-------------------------------------------------------


AnyFolder SetInitialPos ={

//-------------------------------------------------------
//This Initial pos for armshoulder segments
//-------------------------------------------------------
Main.BodyModel.Right.ShoulderArm.Seg.Humerus.r0 = {-0.083707, 0.568691, 0.182766};
Main.BodyModel.Right.ShoulderArm.Seg.Humerus.Axes0 = {{0.036562, -0.830751, -0.555442}, {-0.034728, 0.554422, -0.831511}, {0.998728, 0.049691, -0.008580}};
Main.BodyModel.Right.ShoulderArm.Seg.Scapula.r0 = {-0.118362, 0.613061, 0.199031};
Main.BodyModel.Right.ShoulderArm.Seg.Scapula.Axes0 = {{0.898861, -0.218230, -0.380032}, {0.201003, 0.975897, -0.084983}, {0.389418, -0.000000, 0.921061}};
Main.BodyModel.Right.ShoulderArm.Seg.Radius.r0 = {0.239102, 0.396104, 0.195996};
Main.BodyModel.Right.ShoulderArm.Seg.Radius.Axes0 = {{-0.998489, 0.054797, -0.004200}, {-0.054872, -0.998281, 0.020605}, {-0.003063, 0.020804, 0.999779}};
Main.BodyModel.Right.ShoulderArm.Seg.Ulna.r0 = {0.196187, 0.391280, 0.179439};
Main.BodyModel.Right.ShoulderArm.Seg.Ulna.Axes0 = {{0.148589, 0.987954, 0.043214}, {-0.014130, 0.045816, -0.998850}, {-0.988798, 0.147808, 0.020767}};
Main.BodyModel.Right.ShoulderArm.Seg.Hand.r0 = {0.470101, 0.426800, 0.197076};
Main.BodyModel.Right.ShoulderArm.Seg.Hand.Axes0 = {{-0.998489, 0.054797, -0.004200}, {-0.054872, -0.998281, 0.020605}, {-0.003063, 0.020804, 0.999779}};
Main.BodyModel.Right.ShoulderArm.Seg.Clavicula.r0 = {-0.132136, 0.609981, 0.000000};
Main.BodyModel.Right.ShoulderArm.Seg.Clavicula.Axes0 = {{0.069032, -0.218230, -0.973453}, {0.015437, 0.975897, -0.217683}, {0.997495, 0.000000, 0.070737}};


//-------------------------------------------------------
//This Initial pos for leg segments
//-------------------------------------------------------
Main.BodyModel.Right.Leg.Seg.Shank.r0 = {0.594929, -0.080616, 0.202714};
Main.BodyModel.Right.Leg.Seg.Shank.Axes0 = {{0.892092, -0.407002, -0.196266}, {0.400657, 0.913325, -0.072876}, {0.208916, -0.013623, 0.977839}};
Main.BodyModel.Right.Leg.Seg.Thigh.r0 = {0.257590, 0.060876, 0.174185}; 
Main.BodyModel.Right.Leg.Seg.Thigh.Axes0 = {{-0.252386, -0.947513, -0.196266}, {0.967389, -0.242584, -0.072876}, {0.021440, -0.208258, 0.977839}};
Main.BodyModel.Right.Leg.Seg.Foot.r0 = {0.778702, -0.350421, 0.219492};
Main.BodyModel.Right.Leg.Seg.Foot.Axes0 = {{-0.397348, -0.896434, -0.196266}, {0.917598, -0.390773, -0.072876}, {-0.011367, -0.209050, 0.977839}};


//-------------------------------------------------------
//This Initial pos for spine and thorax
//-------------------------------------------------------
Main.BodyModel.Trunk.Seg.Pelvis.r0 = {0.000000, 0.100000, 0.000000};
Main.BodyModel.Trunk.Seg.Pelvis.Axes0 = {{0.731689, -0.681639, 0.000000}, {0.681639, 0.731689, 0.000000}, {0.000000, 0.000000, 1.000000}};
Main.BodyModel.Trunk.Seg.Thorax.r0 = {-0.132136, 0.609981, 0.000000};
Main.BodyModel.Trunk.Seg.Thorax.Axes0 = {{0.975897, -0.218230, -0.000000}, {0.218230, 0.975897, -0.000000}, {0.000000, 0.000000, 1.000000}};
Main.BodyModel.Trunk.Seg.L4L5Seg.r0 = {-0.025298, 0.132476, 0.000000};
Main.BodyModel.Trunk.Seg.L4L5Seg.Axes0 = {{0.867819, -0.496880, -0.000000}, {0.496880, 0.867819, 0.000000}, {-0.000000, -0.000000, 1.000000}};
Main.BodyModel.Trunk.Seg.L2L3Seg.r0 = {-0.051114, 0.194959, 0.000000};
Main.BodyModel.Trunk.Seg.L2L3Seg.Axes0 = {{0.975897, -0.218230, 0.000000}, {0.218230, 0.975897, 0.000000}, {-0.000000, 0.000000, 1.000000}};

};
   
AnyFolder Drv = {

//-------------------------------------------------------
//This joint and driver locks the pelvis segment to the ground !
//-------------------------------------------------------

 AnyRevoluteJoint PelvisGroundJoint = {
    Axis = z;
    AnyRefNode &PelvisNode = Main.BodyModel.Trunk.Seg.Pelvis.GroundLock;
    AnyRefNode &GroundNode = Main.BodyModel.GlobalRef.PelvisGroundLock;
  }; //Pelvis Ground Joint

  AnyKinEqSimpleDriver GroundDriver = {
    AnyRevoluteJoint &GroundJoint = .PelvisGroundJoint;
    DriverPos = {-0.75};
    DriverVel = {0};
    Reaction.Type = {0};
  };

//-------------------------------------------------------
//This joint locks the foot to the ground!
//-------------------------------------------------------

  AnySphericalJoint HeelToGround = {
    AnyRefNode &HeelNode = Main.BodyModel.Right.Leg.Seg.Foot.Heel;
    AnyRefNode &GroundNode = ..BodyModel.FootLocation;
  }; //Heel to ground


//-------------------------------------------------------
//This joint and driver controls the knee pos in the frontal plane
//-------------------------------------------------------

 AnyKinLinear XYZmeasureKnee = {
    AnyFixedRefFrame& Ground = ..BodyModel.KneePos;
    AnyRefNode &Knee = Main.BodyModel.Right.Leg.Seg.Shank.KneeJoint;
  };

  AnyKinEqSimpleDriver KneeMotionZ = {
    AnyKinLinear &Jnt = .XYZmeasureKnee;
    MeasureOrganizer = {2};
    
    DriverPos = {0};
    DriverVel = {0.0};
   // DriverAcc = {0.0};
   Reaction.Type = {0.0};
  };


//-------------------------------------------------------
//This joint locks the hand to the ground!
//-------------------------------------------------------

  AnySphericalJoint HandToGround = {
    AnyRefNode &HandNode = Main.BodyModel.Right.ShoulderArm.Seg.Hand.Hand;
    AnyRefNode &GroundNode = ..BodyModel.HandLocation;
  }; //Heel to ground



//-------------------------------------------------------
//This joint and driver controls the elbow pos in the frontal plane
//-------------------------------------------------------

 AnyKinLinear XYZmeasureElbow = {
    AnyFixedRefFrame& Ground = ..BodyModel.ElbowPos;
    AnyRefNode &Knee = Main.BodyModel.Right.ShoulderArm.Seg.Humerus.em;
  };

  AnyKinEqSimpleDriver ElbowMotionZ = {
    AnyKinLinear &Jnt = .XYZmeasureElbow;
    MeasureOrganizer = {2};
    
    DriverPos = {0};
    DriverVel = {0.0};
   // DriverAcc = {0.0};
   // Reaction.Type = {0.0};
  };


//-------------------------------------------------------
//  Standard drivers
//-------------------------------------------------------

//-------------------------------------------------------
//  Drives for the spine model
//-------------------------------------------------------

  AnyKinEqSimpleDriver L5PelvisJntDriver = {
    AnyRevoluteJoint &L5PelvisJoint = Main.BodyModel.Trunk.Jnt.L5PelvisJnt;
    DriverPos = {-0.20};
    DriverVel = {0.};
//  Reaction.Type = {0.0};
    Reaction.Type = {0.0};
  };

  AnyKinEqSimpleDriver L3L4JntDriver = {
    AnyRevoluteJoint &L3L4Joint = Main.BodyModel.Trunk.Jnt.L3L4Jnt;
    DriverPos = {-0.20};
    DriverVel = {0.0};
   // Reaction.Type = {0.0};
    Reaction.Type = {0.0};
  };

  AnyKinEqSimpleDriver HATL2JntDriver = {
    AnyRevoluteJoint &HATL2Joint = Main.BodyModel.Trunk.Jnt.HATL2Jnt;
    DriverPos = {-0.20};
    DriverVel = {0.0};
    // Reaction.Type = {0.0};
    Reaction.Type = {0.0};
  };
 

//-------------------------------------------------------
//  Drivers for the shoulder and the arm
//-------------------------------------------------------
/*
  AnyKinEqSimpleDriver SC_Driver = {
      AnySphericalJoint &joint =  Main.BodyModel.Right.ShoulderArm.Jnt.SC;
      DriverPos = {0,-1.50,0};
      DriverVel = {0.0,0.5,0.0};
      Reaction.Type = {0.0,0.0,0.0};

  };
 
 AnyKinEqSimpleDriver AC_Driver = {
      AnyUniversalJoint &joint = Main.BodyModel.Right.ShoulderArm.Jnt.AC;
      DriverPos = {1.1,0.0};
      DriverVel = {0.0,0.0};
      Reaction.Type = {0.0,0.0};

  };

AnyKinEqSimpleDriver GH_Driver = {
      AnySphericalJoint &joint = Main.BodyModel.Right.ShoulderArm.Jnt.GH;
      //DriverPos = {0.0,-1.65,0.25};
     //  DriverPos = {1.5,-0.015,1.25};//hand in the air !
     // DriverPos = {0.7,-1.5,0.5};
      DriverPos = {0.7,-1.1,0.4};
      DriverVel = {1.0,0.0,0.0};
      Reaction.Type = {0.0,0.0,0.0};
  };


  AnyKinEqSimpleDriver FEDriver = {
      AnyRevoluteJoint &joint = Main.BodyModel.Right.ShoulderArm.Jnt.HumeroUlnarJoint;
      DriverPos = {2.5};
      DriverVel = {0.0};
      Reaction.Type = {1.0};
  };

*/

  AnyKinEqSimpleDriver PSDriver = {
      AnyRevoluteJoint &joint = Main.BodyModel.Interface.Right.ElbowPronation;
      DriverPos = {0.0};
      DriverVel = {0.0};
      Reaction.Type = {0.0};
  };

 AnyKinEqSimpleDriver Wrist_Driver = {
      AnySphericalJoint &joint =Main.BodyModel.Right.ShoulderArm.Jnt.WristJoint;
      DriverPos = {0.0,0.0,-0.0};
      DriverVel = {0.0,0.0,0.0};
      Reaction.Type = {1.0,1.0,1.0};
  };


 AnyKinLinear XYZMeasureGH = {
    AnyFixedRefFrame& GHGround = ..BodyModel.GHPos;
    AnyRefNode &GH = Main.BodyModel.Right.ShoulderArm.Seg.Scapula.gh;
  };

  AnyKinEqSimpleDriver GHMotion = {
    AnyKinLinear &Jnt = .XYZMeasureGH;
    MeasureOrganizer = {0,1};
    
   DriverPos = {0.04,0};
  //stc DriverPos = {0.03,0.0};
  //stc 2 DriverPos = {0.0,0.0};
  //stc 3 DriverPos = {0.0,0.1};
    DriverVel = {0.0,0.0};
   // DriverAcc = {0.0};
   Reaction.Type = {0.0,0.0};
};


//-------------------------------------------------------
//  Drivers for the leg, from hipjoint and downwards
//-------------------------------------------------------

  AnyKinEqSimpleDriver AnkleDriver = {
    AnyRevoluteJoint &AnkleJoint = Main.BodyModel.Right.Leg.Jnt.Ankle;
    DriverPos = {1.56};
    DriverVel = {0.0};
    Reaction.Type = {0.0};
  };


//  AnyKinEqSimpleDriver KneeDriver = {
//    AnyRevoluteJoint &KneeJoint = Main.BodyModel.Right.Leg.Jnt.Knee;
//    DriverPos = {-1.76};
//    DriverVel = {0.88};
//    Reaction.Type = {0.0};
//  };

//  AnyKinEqSimpleDriver HipDriver = {
//    AnySphericalJoint &HipJoint = Main.BodyModel.Right.Leg.Jnt.Hip;
//    DriverPos = {0.0,0,-1.70};
//    DriverVel = {0,0,0.0};
//    Reaction.Type = {0,0,0};
//  };

}; //End drv

//---------------------------------------------------------
//  Loading
//---------------------------------------------------------
AnyFolder BackLoad= {

AnySeg &ThoraxRef= Main.BodyModel.Trunk.Seg.Thorax;

ThoraxRef={

   AnyRefNode FThorax1  = {sRel = {-0.12000000, 0.000000 , 0.000000};
     AnyDrawRefFrame DrwGlobalRef = {ScaleXYZ={0.1,0.,0.}; RGB ={1,0,0};  };
   };
   AnyRefNode FThorax2  = {sRel = {-0.15000000, -0.1700000 , 0.000000};
     AnyDrawRefFrame DrwGlobalRef = {ScaleXYZ={0.1,0.,0.}; RGB ={1,0,0};  };
   };
   AnyRefNode FThorax3  = {sRel = {-0.12000000, -0.3400000 , 0.000000};
     AnyDrawRefFrame DrwGlobalRef = {ScaleXYZ={0.1,0.,0.}; RGB ={1,0,0};  };
   };
};

AnySeg &FL2L3Ref= Main.BodyModel.Trunk.Seg.L2L3Seg;

   FL2L3Ref = {
    AnyRefNode FL2L3  = {sRel = {-0.0500000, 0.000000 , 0.000000};
     AnyDrawRefFrame DrwGlobalRef = {ScaleXYZ={0.1,0.,0.}; RGB ={1,0,0};  };
   };
};

AnySeg &FL4L5Ref= Main.BodyModel.Trunk.Seg.L4L5Seg;

   FL4L5Ref = {
    AnyRefNode FL4L5  = {sRel = {-0.0500000, 0.000000 , 0.000000};
     AnyDrawRefFrame DrwGlobalRef = {ScaleXYZ={0.1,0.,0.}; RGB ={1,0,0};  };
   };
};

AnyForce3D FThorax1 = {
    AnyRefNode &LoadNode = .ThoraxRef.FThorax1;
    F = {t*1,0,0}; //Global force vector
};


AnyForce3D FThorax2 = {
    AnyRefNode &LoadNode = .ThoraxRef.FThorax2;
    F = {t*1,0,0}; //Global force vector
};

AnyForce3D FThorax3 = {
    AnyRefNode &LoadNode = .ThoraxRef.FThorax3;
    F = {t*1,0,0}; //Global force vector
};

AnyForce3D FTL4L5 = {
    AnyRefNode &LoadNode = .FL4L5Ref.FL4L5;
    F = {t*1,0,0}; //Global force vector
};

AnyForce3D FTL2L3 = {
    AnyRefNode &LoadNode = .FL2L3Ref.FL2L3;
    F = {t*1,0,0}; //Global force vector
};


};



//---------------------------------------------------------
//  Loading  ElbowLoad
//---------------------------------------------------------
AnyFolder ElbowLoad= {

   AnySeg &UlnaRef= Main.BodyModel.Right.ShoulderArm.Seg.Ulna;

   UlnaRef = {
     AnyRefNode UlnaLoad  = {
        sRel = {0.000000, 0.000000 , 0.000000};
        AnyDrawRefFrame DrwGlobalRef = {
           ScaleXYZ={0.1,0.,0.};
           RGB ={1,0,0};
        }; 
     };
   }; 
   AnyForce3D ElbowF = {
      AnyRefNode &LoadNode = .UlnaRef.UlnaLoad;
      F = {0,t*1,0}; //Global force vector
   };

};



 AnyBodyStudy CalibrationStudy = {
    AnyFolder &Drv =.Drv;
    AnyFolder &Model = .BodyModel;
    RecruitmentSolver = MinMaxSimplex;
    tEnd = 1.0;
    Gravity = {0.0, -9.81, 0.0};
    UsabilityExponent = 0.00;
    nStep=2;
    KinematicRelax=0.05;
 }; // End of study

 AnyBodyStudy MainStudy = {
    AnyFolder &Drv =.Drv;
    AnyFolder &Model = .BodyModel;
    RecruitmentSolver = MinMaxSimplex;
    tEnd = 1.0;
    Gravity = {0.0, -9.81, 0.0};
    UsabilityExponent = 0.00;
    nStep=10;
    KinematicRelax=0.05;
 }; // End of study


 AnyBodyStudy BackLoadStudy = {
    AnyFolder &Drv =.Drv;
    AnyFolder &Model = .BodyModel;
    AnyFolder &Load =.BackLoad;
    RecruitmentSolver = MinMaxSimplex;
    tEnd = 20.0;
    Gravity = {0.0, -9.81, 0.0};
    UsabilityExponent = 0.00;
    nStep=10;
    KinematicRelax=0.05;
  }; // End of study


 AnyBodyStudy ElbowStudy = {
    AnyFolder &Drv =.Drv;
    AnyFolder &Model = .BodyModel;
    AnyFolder &Load =.ElbowLoad;
    RecruitmentSolver = MinMaxSimplex;
    tEnd = 10.0;
    Gravity = {0.0, -9.81, 0.0};
    UsabilityExponent = 0.00;
    nStep=10;
    KinematicRelax=0.05;
  }; // End of study

}; //Main