[770c98]: / Application / Examples / ShoulderBag / Model / LeftLegTDDrivers.any

Download this file

124 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.BodyModel.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.BodyModel.Left.Leg.Seg.Foot.HeelNode;
    };
    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.SubTalarJoint;
    };
    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 =...BodyModel.Interface.Left.HipFlexion;
   AnyKinMeasure& ref2 =...BodyModel.Interface.Left.HipExternalRotation;
   AnyKinMeasure& ref3 =...BodyModel.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 =...BodyModel.Interface.Left.KneeFlexion;
    DriverPos=pi/180*{      .JntPos.Left.KneeFlexion   };  
    DriverVel = pi/180*{      .JntVel.Left.KneeFlexion   };  
    Reaction.Type={Off};
  };
  

  
 
//Ankle driver
  AnyKinEqSimpleDriver AnkleDriverLeft={
   AnyKinMeasure& ref1=...BodyModel.Interface.Left.AnklePlantarFlexion;
   AnyKinMeasure& ref2=...BodyModel.Interface.Left.SubTalarEversion;
    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.Talus.AnkleJoint;
      F = .locmql.Ankle;
    };    
  };