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

Download this file

122 lines (93 with data), 3.5 kB



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

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

  
  
    // ************************************
  // Drivers for the right leg
  // ************************************
  
   //Hip driver 
  AnyKinEqSimpleDriver HipDriverRight={
    AnyKinMeasure& ref1 =...HumanModel.Interface.Right.HipFlexion;
    AnyKinMeasure& ref2 =...HumanModel.Interface.Right.HipExternalRotation;
    AnyKinMeasure& ref3 =...HumanModel.Interface.Right.HipAbduction;
    DriverPos= pi/180*{
      .JntPos.Right.HipFlexion,
      .JntPos.Right.HipExternalRotation,
      .JntPos.Right.HipAbduction
    };    
    DriverVel = pi/180*{
      .JntVel.Right.HipFlexion,
      .JntVel.Right.HipExternalRotation,
      .JntVel.Right.HipAbduction
    };    
    Reaction.Type={Off,Off,Off};
  
  };
   
  //Knee driver
  AnyKinEqSimpleDriver KneeDriverRight={
    AnyKinMeasure& Knee = ...HumanModel.Interface.Right.KneeFlexion;
    DriverPos=pi/180*{.JntPos.Right.KneeFlexion};  
    DriverVel = pi/180*{.JntVel.Right.KneeFlexion};  
    Reaction.Type={Off};
  };
  
  //Ankle driver
  AnyKinEqSimpleDriver AnkleDriverRight={
    AnyKinMeasure& ref1=...HumanModel.Interface.Right.AnklePlantarFlexion;
    AnyKinMeasure& ref2=...HumanModel.Interface.Right.AnkleEversion;
    DriverPos = pi/180*{.JntPos.Right.SubTalarEversion};  
    DriverVel=pi/180*{.JntVel.Right.SubTalarEversion};  
    Reaction.Type={Off};
    MeasureOrganizer={1};
  };
  
  
  
  
    AnyReacForce RightFootReaction = {
    
    
    AnyKinRotational rot = {
      AnySeg &ref1=..LegR.Seg.Foot;
      AnyFixedRefFrame &ref2 = ....EnvironmentModel.GlobalRef;
      Type = RotVector;
    };  
    
    AnyKinLinear RightFootLinMeasure = {
      AnySeg &ref1=..LegR.Seg.Foot;
      AnyFixedRefFrame &ref2 = ....EnvironmentModel.GlobalRef;  
    };
    
  };

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