a b/Application/Examples/ShoulderBag/Model/LeftLegDrivers.any
1
2
3
4
  // Place the left toe and heel on the ground
5
AnyKinEqSimpleDriver LToeGroundConstraint ={
6
    AnyKinLinear ToePos = {
7
      AnyFixedRefFrame& Ground = Main.Model.EnvironmentModel.GlobalRef;
8
      AnyRefNode& Ball = Main.Model.HumanModel.Left.Leg.Seg.Foot.ToeJoint;
9
    };
10
    MeasureOrganizer = {1};  // Only the y coordinate
11
    DriverPos = {0.0};
12
    DriverVel = {0};
13
    Reaction.Type = {Off};  // Provide ground reaction
14
15
  };
16
  
17
  AnyKinEqSimpleDriver LHeelGroundConstraint ={
18
    AnyKinLinear HeelPos = {
19
      AnyFixedRefFrame& Ground = Main.Model.EnvironmentModel.GlobalRef;
20
      AnyRefNode& Ball = Main.Model.HumanModel.Left.Leg.Seg.Foot.HeelJoint;
21
    };
22
    MeasureOrganizer = {1};  // Only the y coordinate
23
    DriverPos = {0.0};
24
  DriverVel = {0};
25
    Reaction.Type = {Off};  // Provide ground reaction
26
  };  
27
28
  
29
  
30
    // Position the Ankles right above the z axis
31
  AnyKinEqSimpleDriver LAnkleX ={
32
    AnyKinLinear AnklePos = {
33
      AnyFixedRefFrame& Ground = Main.Model.EnvironmentModel.GlobalRef;
34
      AnyRefNode& Ankle = ..LegL.Seg.Foot.AnkleJoint;
35
    };
36
    MeasureOrganizer = {0};  // Only the x coordinate
37
    DriverPos = {0.0};
38
    DriverVel = {0.0};
39
    Reaction.Type = {Off};
40
  };
41
42
  
43
    // ************************************
44
  // Drivers for the Left leg
45
  // ************************************
46
  
47
  //Left hip driver
48
  AnyKinEqSimpleDriver HipDriverLeft={
49
    AnyKinMeasure& ref1 =...HumanModel.Interface.Left.HipFlexion;
50
    AnyKinMeasure& ref2 =...HumanModel.Interface.Left.HipExternalRotation;
51
    AnyKinMeasure& ref3 =...HumanModel.Interface.Left.HipAbduction;
52
    DriverPos=pi/180*{
53
      .JntPos.Left.HipFlexion,
54
      .JntPos.Left.HipExternalRotation,
55
      .JntPos.Left.HipAbduction
56
    };    
57
    DriverVel = pi/180*{
58
      .JntVel.Left.HipFlexion,
59
      .JntVel.Left.HipExternalRotation,
60
      .JntVel.Left.HipAbduction
61
    };    
62
    Reaction.Type={Off,Off,Off};
63
  };
64
  
65
  //Knee driver
66
  AnyKinEqSimpleDriver KneeDriverLeft={
67
    AnyKinMeasure& Knee =...HumanModel.Interface.Left.KneeFlexion;
68
    DriverPos=pi/180*{      .JntPos.Left.KneeFlexion   };  
69
    DriverVel = pi/180*{      .JntVel.Left.KneeFlexion   };  
70
    Reaction.Type={Off};
71
  };
72
  
73
74
  
75
 
76
//Ankle driver
77
  AnyKinEqSimpleDriver AnkleDriverLeft={
78
    AnyKinMeasure& ref1=...HumanModel.Interface.Left.AnklePlantarFlexion;
79
    AnyKinMeasure& ref2=...HumanModel.Interface.Left.AnkleEversion;
80
    DriverPos = pi/180*{.JntPos.Left.SubTalarEversion};  
81
    DriverVel=pi/180*{.JntVel.Left.SubTalarEversion};  
82
    Reaction.Type={Off};
83
    MeasureOrganizer={1};
84
  };
85
  
86
  
87
  
88
  
89
    AnyReacForce LeftFootReaction = {
90
    
91
    AnyKinLinear LeftFootLinMeasure = {
92
      AnySeg& ref1=..LegL.Seg.Foot;
93
      AnyFixedRefFrame& ref2 = ....EnvironmentModel.GlobalRef;
94
    };
95
    AnyKinRotational LeftFootRotMeasure = {
96
      AnySeg& ref1=..LegL.Seg.Foot;
97
      AnyFixedRefFrame& ref2 = ....EnvironmentModel.GlobalRef;
98
      Type = RotVector;
99
    };  
100
    
101
    
102
  };
103
104
  
105
  
106
  
107
  MannequinLoads.Left = {
108
  
109
      AnyForce3D Hip = {
110
      AnyRefNode& ApplPoint = .lhm.Leg.Seg.Thigh.HipJoint;
111
      F = .locmql.Hip;
112
    };
113
    
114
    AnyForce3D Knee = {
115
      AnyRefNode& ApplPoint = .lhm.Leg.Seg.Thigh.KneeJoint;
116
      F = .locmql.Knee;
117
    };
118
    
119
    AnyForce3D Ankle = {
120
      AnyRefNode& ApplPoint = .lhm.Leg.Seg.Foot.AnkleJoint;
121
      F = .locmql.Ankle;
122
    };    
123
  };
124