Switch to unified view

a b/Application/Examples/THA-KneeBendDemo/Model/JointsAndDrivers.any
1
/* ----------------------------------------------------------------
2
   Drivers for a standing model:
3
   
4
   - The two feet are constrained forward/backward and vertically (x & y)
5
   - The pelvis is constrained laterally (z)
6
   - The CoM is constrained forward/backward and laterally above the origin.
7
   
8
   The remaining degrees of freedom (with the exception of a few shoulder
9
   movements) are controlled by parameters in the mannequin.any file.
10
   
11
   The forces defined in the mannequin.any file are attached to the body
12
   locations at the bottom of this file.
13
   
14
   John Rasmussen, March 5, 2004.
15
   ----------------------------------------------------------------  */
16
17
AnyFolder Drivers = {
18
  
19
  #include "<ANYBODY_PATH_BODY>/BodyModels/include/MannequinDrivers.any"
20
  
21
  // Aliases for convenient referencing
22
  AnyFolder &JntPos=..Mannequin.Posture;  
23
  AnyFolder &JntVel=..Mannequin.PostureVel;  
24
  
25
  AnyFolder &LegR = ..BodyModel.Right.Leg;
26
  AnyFolder &LegL = ..BodyModel.Left.Leg;
27
  
28
  AnyFolder &RefHM = Main.Model.BodyModel;
29
30
31
32
  //Constraint the collective CoM to be right above the GlobalRef
33
  AnyKinEqSimpleDriver CoMDriver = {
34
    AnyKinCoM CoM = {
35
      AnyFolder &Body = Main.Model.BodyModel;
36
    };
37
    MeasureOrganizer = {0,2};  // Only the x and z directions
38
    DriverPos = {0,0};
39
    DriverVel = {0,0};
40
    Reaction.Type = {Off,Off};
41
  };  
42
  
43
  
44
  // The body parts are included only if there is no unhallowed combination detected
45
  #ifdef UNHALLOWED_COMBINATION
46
  #else
47
  
48
  #include "TrunkDrivers.any"
49
  
50
  #if BM_ARM_RIGHT == ON
51
  #include "RightArmDrivers.any"
52
    #if BM_ARM_DETAILED_HAND == ON
53
    #include "RightHandDrivers.any"
54
    #endif
55
  #else
56
  #endif
57
  
58
  
59
  #if BM_ARM_LEFT == ON
60
  #include "LeftArmDrivers.any"
61
    #if BM_ARM_DETAILED_HAND == ON
62
    #include "LeftHandDrivers.any"
63
    #endif
64
  #else
65
  #endif
66
  
67
  
68
  #if BM_LEG_RIGHT & (BM_LEG_MODEL == _LEG_MODEL_LEG_)
69
  #include "RightLegDrivers.any"
70
  #else
71
  #endif
72
  
73
  
74
  #if BM_LEG_MODEL & (BM_LEG_MODEL == _LEG_MODEL_LEG_)
75
  #include "LeftLegDrivers.any"
76
  #else
77
  #endif
78
  
79
  
80
  #if BM_LEG_RIGHT & BM_LEG_MODEL_IS_TLEM
81
  #include "RightLegTDDrivers.any"
82
  #else
83
  #endif
84
  
85
  
86
  #if BM_LEG_LEFT & BM_LEG_MODEL_IS_TLEM
87
  #include "LeftLegTDDrivers.any"
88
  #else
89
  #endif
90
  
91
  
92
  #endif
93
  
94
  
95
  //Loads from the Mannequin file.
96
  AnyFolder MannequinLoads = {
97
    AnyFolder &hm = Main.Model.BodyModel;  // For easy reference
98
    AnyFolder &mql = Main.Model.Mannequin.Load;
99
    
100
    AnyFolder Right = {
101
      AnyFolder &rhm = .hm.Right;
102
      AnyFolder &locmql = .mql.Right;
103
    };  // Right
104
    
105
    AnyFolder Left = {
106
      AnyFolder &lhm = .hm.Left;
107
      AnyFolder &locmql = .mql.Left;
108
    };  // Left
109
  };
110
111
  
112
};//Drivers