Switch to unified view

a b/Application/Examples/THA-KneeBendDemo/Model/Mannequin.any
1
2
3
// This is to switch On or Off the MannequinDrivers. It is a quick way to drive any joint of the body 
4
// with pre-existing drivers. They are based on the FreePosture drivers, 
5
// so they are driving directly the joint angles and are really independent from each other. Also
6
// all DOF can be driven separatly.
7
// 0 switch the driver Off and 1 switch it On.
8
// The input value for each driver is the joint angles and velocities defined below in the Mannequin folder.
9
// Notice that even if it is possible to drive fully the model with those drivers, we originaly thinked them
10
// as alternative or debug drivers.
11
// *********************************************************************************************************
12
13
// Global switch:
14
// - if turned to 1 the drivers will be activated according to their individual statut.
15
// - if turned to 0 all drivers will desactivated (regardless to their individual statut).
16
#define GLOBAL_DRIVER_SWITCH 0
17
18
// Drivers for attaching the pelvis to the global reference system
19
#define PELVIS_POS_X_DRIVER 1
20
#define PELVIS_POS_Y_DRIVER 1
21
#define PELVIS_POS_Z_DRIVER 1
22
23
#define PELVIS_ROT_Z_DRIVER 1
24
#define PELVIS_ROT_Y_DRIVER 1
25
#define PELVIS_ROT_X_DRIVER 1
26
27
28
// Drivers for the spine
29
#define NECK_DRIVER 1
30
31
#define PELVIS_THORAX_LATERAL_BENDING_DRIVER 1
32
#define PELVIS_THORAX_ROTATION_DRIVER 1
33
#define PELVIS_THORAX_EXTENSION_DRIVER 1
34
35
36
// Drivers for the right arm
37
#define STERNO_CLAVICULAR_RIGHT_DRIVER 1
38
39
#define GLENOHUMERAL_ABDUCTION_RIGHT_DRIVER 1
40
#define GLENOHUMERAL_FLEXION_RIGHT_DRIVER 1
41
#define GLENOHUMERAL_EXTERNAL_ROTATION_RIGHT_DRIVER 1
42
43
#define ELBOW_FLEXION_RIGHT_DRIVER 1
44
#define ELBOW_PRONATION_RIGHT_DRIVER 1
45
46
#define WRIST_FLEXION_RIGHT_DRIVER 1
47
#define WRIST_ABDUCTION_RIGHT_DRIVER 1
48
49
50
// Drivers for the left arm
51
#define STERNO_CLAVICULAR_LEFT_DRIVER 1
52
53
#define GLENOHUMERAL_ABDUCTION_LEFT_DRIVER 1
54
#define GLENOHUMERAL_FLEXION_LEFT_DRIVER 1
55
#define GLENOHUMERAL_EXTERNAL_ROTATION_LEFT_DRIVER 1
56
57
#define ELBOW_FLEXION_LEFT_DRIVER 1
58
#define ELBOW_PRONATION_LEFT_DRIVER 1
59
60
#define WRIST_FLEXION_LEFT_DRIVER 1
61
#define WRIST_ABDUCTION_LEFT_DRIVER 1
62
63
64
// Drivers for the right leg
65
#define HIP_FLEXION_RIGHT_DRIVER 1
66
#define HIP_EXTERNAL_ROTATION_RIGHT_DRIVER 1
67
#define HIP_ABDUCTION_RIGHT_DRIVER 1
68
69
#define KNEE_FLEXION_RIGHT_DRIVER 1
70
71
#define ANKLE_FLEXION_RIGHT_DRIVER 1
72
#define ANKLE_EVERSION_RIGHT_DRIVER 0
73
#define ANKLE_SUBTALAR_EVERSION_RIGHT_DRIVER 1
74
75
76
// Drivers for the Left leg
77
#define HIP_FLEXION_LEFT_DRIVER 1
78
#define HIP_EXTERNAL_ROTATION_LEFT_DRIVER 1
79
#define HIP_ABDUCTION_LEFT_DRIVER 1
80
81
#define KNEE_FLEXION_LEFT_DRIVER 1
82
83
#define ANKLE_FLEXION_LEFT_DRIVER 1
84
#define ANKLE_EVERSION_LEFT_DRIVER 0
85
#define ANKLE_SUBTALAR_EVERSION_LEFT_DRIVER 1
86
87
88
89
90
91
// Those variable control the initial position of the body.
92
// They are also the input values for the MannequinDrivers if switched On above.
93
// ****************************************************************************
94
95
96
Main.HumanModel.Mannequin = {
97
  
98
  Posture = {
99
    //This controls the position of the pelvi wrt. to the global reference frame
100
    PelvisPosX=0.046;
101
    PelvisPosY=1.16;
102
    PelvisPosZ=0;
103
    
104
    //This controls the rotation of the pelvis wrt. to the global reference frame
105
    PelvisRotX=0;
106
    PelvisRotY=0;
107
    PelvisRotZ=0;
108
    
109
    // These variables control the rotation of the thorax wrt the
110
    // pelvis    
111
    PelvisThoraxExtension=0; 
112
    PelvisThoraxLateralBending=0;  
113
    PelvisThoraxRotation=0;        
114
    
115
    NeckExtension=0; 
116
    NeckLateralBending=0; 
117
    NeckRotation=0; 
118
    
119
    Right = {
120
      //Arm 
121
      SternoClavicularProtraction=-23;   //This value is not used for initial position
122
      SternoClavicularElevation=11.5;    //This value is not used for initial position
123
      
124
      GlenohumeralFlexion =-0; 
125
      GlenohumeralAbduction = 10; 
126
      GlenohumeralExternalRotation = 0; 
127
      
128
      ElbowFlexion = 0.01; 
129
      ElbowPronation = -20.0;
130
      
131
      WristFlexion =0;
132
      WristAbduction =0;
133
      
134
      //Hand
135
      Finger1 ={
136
        CMCDeviation=-20;
137
        CMCFlexion=20;
138
        MCPFlexion= 20;
139
        MCPDeviation=0;
140
        DIPFlexion=20;
141
      };
142
      
143
      Finger2 ={
144
        MCPFlexion=20;
145
        PIPFlexion=20;
146
        DIPFlexion=20;
147
      };
148
      
149
      Finger3 ={
150
        MCPFlexion=20;
151
        PIPFlexion=20;
152
        DIPFlexion=20;
153
      };
154
      
155
      Finger4 ={
156
        MCPFlexion=20;
157
        PIPFlexion=20;
158
        DIPFlexion=20;
159
      };
160
      
161
      Finger5 ={
162
        MCPFlexion=20;
163
        PIPFlexion=20;
164
        DIPFlexion=20;
165
      };
166
      
167
      //Leg
168
      HipFlexion = 0.0; 
169
      HipAbduction = 5.0; 
170
      HipExternalRotation = 0.0;
171
      
172
      KneeFlexion = 0.0; 
173
      
174
      AnklePlantarFlexion =0.0; 
175
      SubTalarEversion =0.0; 
176
    };
177
    
178
    Left = {
179
      //all values are set to be equal to the right side values 
180
      //feel free to change this!
181
      
182
      //Arm
183
      SternoClavicularProtraction=.Right.SternoClavicularProtraction;
184
      SternoClavicularElevation=.Right.SternoClavicularElevation;
185
      
186
      GlenohumeralFlexion = .Right.GlenohumeralFlexion ; 
187
      GlenohumeralAbduction =.Right.GlenohumeralAbduction ;
188
      GlenohumeralExternalRotation =.Right.GlenohumeralExternalRotation ;
189
      
190
      ElbowFlexion = .Right.ElbowFlexion; 
191
      ElbowPronation = .Right.ElbowPronation;       
192
      WristFlexion =.Right.WristFlexion;
193
      WristAbduction =.Right.WristAbduction;
194
      
195
      //Hand
196
      Finger1 ={
197
        CMCDeviation= ..Right.Finger1.CMCDeviation;
198
        CMCFlexion= ..Right.Finger1.CMCFlexion;
199
        MCPFlexion= ..Right.Finger1.MCPFlexion;
200
        MCPDeviation= ..Right.Finger1.MCPDeviation;
201
        DIPFlexion= ..Right.Finger1.DIPFlexion;
202
      };
203
      
204
      Finger2 ={
205
        MCPFlexion= ..Right.Finger2.MCPFlexion;
206
        PIPFlexion= ..Right.Finger2.PIPFlexion;
207
        DIPFlexion= ..Right.Finger2.DIPFlexion;
208
      };
209
      
210
      Finger3 ={
211
        MCPFlexion= ..Right.Finger3.MCPFlexion;
212
        PIPFlexion= ..Right.Finger3.PIPFlexion;
213
        DIPFlexion= ..Right.Finger3.DIPFlexion;
214
      };
215
      
216
      Finger4 ={
217
        MCPFlexion= ..Right.Finger4.MCPFlexion;
218
        PIPFlexion= ..Right.Finger4.PIPFlexion;
219
        DIPFlexion= ..Right.Finger4.DIPFlexion;
220
      };
221
      
222
      Finger5 ={
223
        MCPFlexion= ..Right.Finger5.MCPFlexion;
224
        PIPFlexion= ..Right.Finger5.PIPFlexion;
225
        DIPFlexion= ..Right.Finger5.DIPFlexion;
226
      };
227
      
228
      //Leg     
229
      HipFlexion =.Right.HipFlexion;  
230
      HipAbduction =.Right.HipAbduction;
231
      HipExternalRotation = .Right.HipExternalRotation;
232
      KneeFlexion = .Right.KneeFlexion;       
233
      AnklePlantarFlexion = .Right.AnklePlantarFlexion ;
234
      SubTalarEversion =.Right.SubTalarEversion; 
235
    };
236
  };
237
  
238
  PostureVel={  
239
    //This controls the position of the pelvi wrt. to the global reference frame
240
    PelvisPosX=0;
241
    PelvisPosY=0;
242
    PelvisPosZ=0;
243
    
244
    //This controls the rotation of the pelvis wrt. to the global reference frame
245
    PelvisRotX=0;
246
    PelvisRotY=0;
247
    PelvisRotZ=0;
248
    
249
    // These variables control the rotation of the thorax wrt the
250
    // pelvis    
251
    PelvisThoraxExtension=0; 
252
    PelvisThoraxLateralBending=0;  
253
    PelvisThoraxRotation=0;        
254
    
255
    NeckExtension=0; 
256
    NeckLateralBending=0; 
257
    NeckRotation=0; 
258
    
259
    Right = {
260
      //Arm 
261
      SternoClavicularProtraction=0;   //This value is not used for initial position
262
      SternoClavicularElevation=0;    //This value is not used for initial position
263
      
264
      GlenohumeralFlexion =0; 
265
      GlenohumeralAbduction = 0; 
266
      GlenohumeralExternalRotation = 0; 
267
      
268
      ElbowFlexion = 0.0;
269
      ElbowPronation = 0.0;
270
      
271
      WristFlexion =0;
272
      WristAbduction =0;
273
      
274
      //Leg
275
      HipFlexion = 7.0; 
276
      HipAbduction = 0.0; 
277
      HipExternalRotation = 0.0;
278
      
279
      KneeFlexion = 7.0; 
280
      
281
      AnklePlantarFlexion =0.0; 
282
      SubTalarEversion =0.0; 
283
    };
284
    
285
    Left = {
286
      //all values are set to be equal to the right side values 
287
      //feel free to change this!
288
      
289
      //Arm
290
      SternoClavicularProtraction=.Right.SternoClavicularProtraction;
291
      SternoClavicularElevation=.Right.SternoClavicularElevation;
292
      
293
      GlenohumeralFlexion = .Right.GlenohumeralFlexion ; 
294
      GlenohumeralAbduction =.Right.GlenohumeralAbduction ;
295
      GlenohumeralExternalRotation =.Right.GlenohumeralExternalRotation ;
296
      
297
      ElbowFlexion = .Right.ElbowFlexion; 
298
      ElbowPronation = .Right.ElbowPronation;       
299
      WristFlexion =.Right.WristFlexion;
300
      WristAbduction =.Right.WristAbduction;
301
      
302
      //Leg     
303
      HipFlexion =.Right.HipFlexion;  
304
      HipAbduction =.Right.HipAbduction;
305
      HipExternalRotation = .Right.HipExternalRotation;
306
      KneeFlexion = .Right.KneeFlexion;       
307
      AnklePlantarFlexion = .Right.AnklePlantarFlexion ;
308
      SubTalarEversion =.Right.SubTalarEversion; 
309
    };
310
  };
311
  
312
  AnyFolder Load = {
313
    AnyVec3 TopVertebra = {0.000, 0.000, 0.000};
314
    
315
    AnyFolder Right = {
316
      AnyVec3 Shoulder  = {0.000, 0.000, 0.000};
317
      AnyVec3 Elbow     = {0.000, 0.000, 0.000};
318
      AnyVec3 Hand      = {0.000, 0.000, 0.000};
319
      AnyVec3 Hip       = {0.000, 0.000, 0.000};
320
      AnyVec3 Knee      = {0.000, 0.000, 0.000};
321
      AnyVec3 Ankle     = {0.000, 0.000, 0.000};
322
    };
323
    AnyFolder Left = {
324
      AnyVec3 Shoulder  = {0.000, 0.000, 0.000};
325
      AnyVec3 Elbow     = {0.000, 0.000, 0.000};
326
      AnyVec3 Hand      = {0.000, 0.000, 0.000};
327
      AnyVec3 Hip       = {0.000, 0.000, 0.000};
328
      AnyVec3 Knee      = {0.000, 0.000, 0.000};
329
      AnyVec3 Ankle     = {0.000, 0.000, 0.000};
330
    };
331
  };  // Loads
332
};
333
334
335