[770c98]: / Tools / ModelUtilities / Diagnostics / DiagnosticMuscle3.any

Download this file

44 lines (32 with data), 1.1 kB

//This is file is used to apply an artificial muscle to 
//a particular dof in a measure
 
//the file add to muscles to the dof of the joint, the strength of these muscles are dependent on joint
//range of motion

AnyFolder Muscle={
  
  AnyKinMeasureOrg MeasureOrg={
    AnyKinMeasure& Ref=...DOF;
    MeasureOrganizer ={..dof};
  };
 
  //this variable is true if the joint is outside ROM
  
  AnyInt ROMExceeded = iffun(orfun(  gtfun(MeasureOrg.Pos[0],.ROM[0]),  ltfun(MeasureOrg.Pos[0],-.ROM[1])),0,1);
  
  AnyMuscleGeneric PosMuscle={
    AnyVar ROMStrenghtScale=iffun(.ROMExceeded,1.0,0.1); 
    
    AnyMuscleModelUsr1 MusMdl={
      F0=0;
      S=...Strength[0]*.ROMStrenghtScale; 
    };
    AnyKinMeasure& ref=.MeasureOrg;
    Type = NonNegative;
    EXCLUDE_MUSCLE_METABOLISM
     
  };
  
  AnyMuscleGeneric NegMuscle={
    
    AnyVar ROMStrenghtScale=iffun(.ROMExceeded,1.0,0.1); 
    AnyMuscleModelUsr1 MusMdl={
      F0=0;
      S=...Strength[1]*.ROMStrenghtScale; 
    };
    AnyKinMeasure& ref=.MeasureOrg;
    Type = NonPositive;
    EXCLUDE_MUSCLE_METABOLISM
     
  };
  
};