[770c98]: / Application / Examples / THA-KneeBendDemo / Model / LeftLegDrivers.any

Download this file

125 lines (93 with data), 3.5 kB



  // Place the left toe and heel on the ground
AnyKinEqSimpleDriver LToeGroundConstraint ={
    AnyKinLinear ToePos = {
      AnyFixedRefFrame &Ground = Main.Model.EnvironmentModel.GlobalRef;
      AnyRefNode &Ball = Main.Model.HumanModel.Left.Leg.Seg.Foot.ToeJoint;
    };
    MeasureOrganizer = {1};  // Only the y coordinate
    DriverPos = {0.0};
    DriverVel = {0};
    Reaction.Type = {Off};  // Provide ground reaction

  };
  
  AnyKinEqSimpleDriver LHeelGroundConstraint ={
    AnyKinLinear HeelPos = {
      AnyFixedRefFrame &Ground = Main.Model.EnvironmentModel.GlobalRef;
      AnyRefNode &Ball = Main.Model.HumanModel.Left.Leg.Seg.Foot.HeelJoint;
    };
    MeasureOrganizer = {1};  // Only the y coordinate
    DriverPos = {0.0};
  DriverVel = {0};
    Reaction.Type = {Off};  // Provide ground reaction
  };  

  
  
    // Position the Ankles right above the z axis
  AnyKinEqSimpleDriver LAnkleX ={
    AnyKinLinear AnklePos = {
      AnyFixedRefFrame &Ground = Main.Model.EnvironmentModel.GlobalRef;
      AnyRefNode &Ankle = ..LegL.Seg.Foot.AnkleJoint;
    };
    MeasureOrganizer = {0};  // Only the x coordinate
    DriverPos = {0.0};
    DriverVel = {0.0};
    Reaction.Type = {Off};
  };

  
    // ************************************
  // Drivers for the Left leg
  // ************************************
  
  //Left hip driver
  AnyKinEqSimpleDriver HipDriverLeft={
    AnyKinMeasure& ref1 =...HumanModel.Interface.Left.HipFlexion;
    AnyKinMeasure& ref2 =...HumanModel.Interface.Left.HipExternalRotation;
    AnyKinMeasure& ref3 =...HumanModel.Interface.Left.HipAbduction;
    DriverPos=pi/180*{
      .JntPos.Left.HipFlexion,
      .JntPos.Left.HipExternalRotation,
      .JntPos.Left.HipAbduction
    };    
    DriverVel = pi/180*{
      .JntVel.Left.HipFlexion,
      .JntVel.Left.HipExternalRotation,
      .JntVel.Left.HipAbduction
    };    
    Reaction.Type={Off,Off,Off};
  };
  
  //Knee driver
  AnyKinEqSimpleDriver KneeDriverLeft={
    AnyKinMeasure& Knee =...HumanModel.Interface.Left.KneeFlexion;
    DriverPos=pi/180*{      .JntPos.Left.KneeFlexion   };  
    DriverVel = pi/180*{      .JntVel.Left.KneeFlexion   };  
    Reaction.Type={Off};
  };
  

  
 
//Ankle driver
  AnyKinEqSimpleDriver AnkleDriverLeft={
    AnyKinMeasure& ref1=...HumanModel.Interface.Left.AnklePlantarFlexion;
    AnyKinMeasure& ref2=...HumanModel.Interface.Left.AnkleEversion;
    DriverPos = pi/180*{.JntPos.Left.SubTalarEversion};  
    DriverVel=pi/180*{.JntVel.Left.SubTalarEversion};  
    Reaction.Type={Off};
    MeasureOrganizer={1};
  };
  
  
  
  
    AnyReacForce LeftFootReaction = {
    
    AnyKinLinear LeftFootLinMeasure = {
      AnySeg &ref1=..LegL.Seg.Foot;
      AnyFixedRefFrame &ref2 = ....EnvironmentModel.GlobalRef;
    };
    AnyKinRotational LeftFootRotMeasure = {
      AnySeg &ref1=..LegL.Seg.Foot;
      AnyFixedRefFrame &ref2 = ....EnvironmentModel.GlobalRef;
      Type = RotVector;
    };  
    
    
  };

  
  
  
  MannequinLoads.Left = {
  
      AnyForce3D Hip = {
      AnyRefNode &ApplPoint = .lhm.Leg.Seg.Thigh.HipJoint;
      F = .locmql.Hip;
    };
    
    AnyForce3D Knee = {
      AnyRefNode &ApplPoint = .lhm.Leg.Seg.Thigh.KneeJoint;
      F = .locmql.Knee;
    };
    
    AnyForce3D Ankle = {
      AnyRefNode &ApplPoint = .lhm.Leg.Seg.Foot.AnkleJoint;
      F = .locmql.Ankle;
    };    
  };