Switch to unified view

a b/Tests/ShoulderTestModel/Main.any
1
2
#include "../libdef.any"
3
4
5
#ifndef MOVE_PELVIS
6
#define MOVE_PELVIS ON
7
#endif
8
9
Main = 
10
{
11
12
  // BodyModel configuration:
13
  #include "BodyModelConfiguration.any"
14
  
15
   
16
  // Include the Human model from AMMR
17
  #include "<ANYBODY_PATH_BODY>\HumanModel.any"
18
  
19
  // Define your models posture or movement
20
  #include "Mannequin.any"
21
  
22
  // Compose the model used by the study
23
  AnyFolder Model = 
24
  {  
25
    // Center of Mass (COM) position in the ground YZ plane
26
    // COM balance driver can be excluded with:
27
    // #define EXCLUDE_COM_BALANCE_DRIVERS
28
    AnyVector CenterOfMassXZ = {0,0};
29
    
30
    // Positioning of the right and left feet. 
31
    // Ground-foot constraints can be excluded with:
32
    // #define EXCLUDE_FOOT_CONSTRAINTS
33
    Environment.GlobalRef.RightFootPrint = {
34
      AnyVec3 HeelPosition = {-0.08, 0, 0.14};
35
      AnyVec3 ToeDirection = {1, 0, 0.1}; 
36
    };
37
    Environment.GlobalRef.LeftFootPrint = {
38
      AnyVec3 HeelPosition = {-0.08, 0, -0.14};
39
      AnyVec3 ToeDirection = {1, 0, -0.1}; 
40
    };
41
    
42
    // Include the body part of the Human model
43
    AnyFolder &BodyModel = .HumanModel.BodyModel;
44
    
45
    // Include the default mannequin drivers
46
    AnyFolder &DefaultMannequinDrivers = .HumanModel.DefaultMannequinDrivers;
47
    
48
    // Environment files are used to include objects surrounding human,
49
    // e.g. global reference frame
50
    #include "Environment.any"   
51
    
52
    AnyFolder ModelEnvironmentConnection = 
53
    {
54
      //Move Pelvis to test if this will break kin
55
//      AnyKinEqSimpleDriver PelvisMover ={
56
//        AnyKinMeasure &ref=.Main.HumanModel.BodyModel.Interface.Trunk.PelvisPosX.lin;
57
//        DriverPos ={0,0,0};
58
//        #if MOVE_PELVIS == ON
59
//        DriverVel ={-10,0,0};
60
//        #else
61
//        DriverVel ={0,0,0};
62
//        #endif
63
//        Reaction.Type = {On,On,On};
64
//      };
65
      
66
     AnyKinEqFourierDriver PelvisMover =      {
67
        Type = CosSin;
68
        Freq = 1.2;    
69
        #if MOVE_PELVIS == ON
70
        A = {{0, 1.5 },{0, 0},{0, 0 }};
71
        B = {{0, 0},{0, 0},{0, 1.5}};       
72
        #else
73
        A = {{0, 0 },{0, 0 },{0, 0 }};
74
        B =  {{0, 0},{0, 0},{0, 0}};       
75
        #endif
76
        Reaction.Type={On,On,On};
77
        AnyKinMeasure &ref=.Main.HumanModel.BodyModel.Interface.Trunk.PelvisPosX.lin;
78
      };
79
      
80
      
81
      
82
      
83
      
84
      
85
      
86
      //Move Pelvis to test if this will break kin
87
      AnyKinEqSimpleDriver PelvisMoverRot ={
88
        AnyKinMeasure &ref=.Main.HumanModel.BodyModel.Interface.Trunk.PelvisRotX.rot;
89
        DriverPos ={0,0,0};
90
        #if MOVE_PELVIS == ON
91
        DriverVel ={0, 3*pi, 0};
92
        #else
93
        DriverVel ={0,0,0};
94
        #endif
95
        Reaction.Type = {On,On,On};
96
      };
97
  
98
    };
99
  };
100
  
101
  AnyBodyStudy Study =
102
  {
103
    AnyFolder &Model = .Model;  
104
    
105
    Gravity={0.0, -9.81, 0.0};
106
    nStep = 200;
107
    tStart=0;
108
    tEnd=4;
109
    // Overdeterminate solver is needed while using the 
110
    // soft default mannequin drivers.
111
    Kinematics.SolverType = KinSolDeterminate;
112
    InitialConditions.SolverType = Kinematics.SolverType;
113
    
114
    //Include the next line to have a camera in the model
115
    // Note: to generate videos FFMPEG must be available on the
116
    // system.
117
    //#include "Model/VideoCamera.any"
118
    
119
    
120
    AnyFolder JointAndDrivers ={
121
      
122
      AnyFolder Right ={
123
      
124
      AnyKinEqSimpleDriver  PlaneOfElevation ={
125
        AnyKinMeasure &rtef=.Main.HumanModel.BodyModel.Interface.Right.ThoraxHumerus.PlaneOfElevation;
126
        DriverPos ={-20*pi/180};
127
        DriverVel ={130*pi/180}/20;
128
        Reaction.Type={Off};
129
      };
130
      
131
      
132
      AnyKinEqSimpleDriver  AxialRot ={
133
        AnyKinMeasure &ref=  Main.HumanModel.BodyModel.Interface.Right.ThoraxHumerus.InternalAxialRotation;
134
        DriverPos ={0*pi/180};
135
        DriverVel ={0};
136
        CType={Soft};
137
        Reaction.Type={Off};
138
      };
139
      
140
      
141
      
142
      
143
      AnyKinEqFourierDriver Elevation = 
144
      {
145
        Type = CosSin;
146
        Freq = 0.5;    
147
        A ={{80, 0 }}*pi/180;
148
        B = {{0, (70)}}*pi/180;
149
        Reaction.Type={Off};
150
        
151
        
152
        AnyKinMeasure &rtef=.Main.HumanModel.BodyModel.Interface.Right.ThoraxHumerus.Elevation;
153
      };
154
      
155
    };
156
      
157
    
158
    
159
    
160
    
161
     AnyFolder Left ={
162
      
163
      AnyKinEqSimpleDriver  PlaneOfElevation ={
164
        AnyKinMeasure &rtef=.Main.HumanModel.BodyModel.Interface.Left.ThoraxHumerus.PlaneOfElevation;
165
        DriverPos =Main.Study.JointAndDrivers.Right.PlaneOfElevation.DriverPos;
166
        DriverVel =Main.Study.JointAndDrivers.Right.PlaneOfElevation.DriverVel;
167
        Reaction.Type={Off};
168
      };
169
      
170
      
171
      AnyKinEqSimpleDriver  AxialRot ={
172
        AnyKinMeasure &ref=  Main.HumanModel.BodyModel.Interface.Left.ThoraxHumerus.InternalAxialRotation;
173
        DriverPos =Main.Study.JointAndDrivers.Right.AxialRot.DriverPos;
174
        DriverVel =Main.Study.JointAndDrivers.Right.AxialRot.DriverVel;
175
        CType={Soft};
176
        Reaction.Type={Off};
177
178
      };
179
      
180
      
181
      
182
      
183
      AnyKinEqFourierDriver Elevation = 
184
      {
185
        Type = CosSin;
186
        Freq =  Main.Study.JointAndDrivers.Right.Elevation.Freq;
187
        A =  Main.Study.JointAndDrivers.Right.Elevation.A;
188
        B =  Main.Study.JointAndDrivers.Right.Elevation.B;
189
        Reaction.Type={Off};
190
        AnyKinMeasure &rtef=.Main.HumanModel.BodyModel.Interface.Left.ThoraxHumerus.Elevation;
191
      };
192
      
193
    };
194
      
195
    };
196
197
    
198
   
199
};
200
201
202
203
204
 AnyBodyStudy Study2 =
205
  {
206
    AnyFolder &Model = .Model;  
207
    
208
    Gravity={0.0, -9.81, 0.0};
209
    nStep = 50;
210
    tEnd=5;
211
    // Overdeterminate solver is needed while using the 
212
    // soft default mannequin drivers.
213
    Kinematics.SolverType = KinSolDeterminate;
214
    InitialConditions.SolverType = Kinematics.SolverType;
215
    
216
    //Include the next line to have a camera in the model
217
    // Note: to generate videos FFMPEG must be available on the
218
    // system.
219
    //#include "Model/VideoCamera.any"
220
    
221
    
222
    AnyFolder JointAndDrivers ={
223
      AnyFolder Right ={
224
       
225
     AnyKinEqFourierDriver PlaneOfElevation =      {
226
        Type = CosSin;
227
        Freq = 0.25;    
228
          A = {{25, -80 }}*pi/180;
229
          B = {{0, 0}}*pi/180;       
230
              Reaction.Type={Off};
231
232
      AnyKinMeasure &rtef=.Main.HumanModel.BodyModel.Interface.Right.ThoraxHumerus.PlaneOfElevation;
233
      };
234
      
235
      
236
      AnyKinEqSimpleDriver  AxialRot ={
237
        AnyKinMeasure &ref=  Main.HumanModel.BodyModel.Interface.Right.ThoraxHumerus.InternalAxialRotation;
238
        DriverPos ={0*pi/180};
239
        DriverVel ={0};
240
        CType={Soft};
241
             Reaction.Type={Off};
242
 };
243
      
244
      
245
      
246
      
247
      AnyKinEqFourierDriver Elevation = 
248
      {
249
        Type = CosSin;
250
        Freq = .25;    
251
        A = {{80, 0 }}*pi/180;
252
        B ={{0, (70)}}*pi/180;
253
              Reaction.Type={Off};
254
  
255
        
256
        AnyKinMeasure &rtef=.Main.HumanModel.BodyModel.Interface.Right.ThoraxHumerus.Elevation;
257
      };
258
      
259
      
260
      
261
    };
262
    
263
    
264
      AnyFolder Left ={
265
       
266
     AnyKinEqFourierDriver PlaneOfElevation =      {
267
        Type = CosSin;
268
        Freq = 0.25;    
269
          A ={{25, -80 }}*pi/180;
270
      B =  {{0, 0}}*pi/180;       
271
             Reaction.Type={Off};
272
 
273
      AnyKinMeasure &rtef=.Main.HumanModel.BodyModel.Interface.Left.ThoraxHumerus.PlaneOfElevation;
274
      };
275
      
276
      
277
      AnyKinEqSimpleDriver  AxialRot ={
278
        AnyKinMeasure &ref=  Main.HumanModel.BodyModel.Interface.Left.ThoraxHumerus.InternalAxialRotation;
279
        DriverPos ={0*pi/180};
280
        DriverVel ={0};
281
        CType={Soft};
282
            Reaction.Type={Off};
283
  };
284
      
285
      
286
      
287
      
288
      AnyKinEqFourierDriver Elevation = 
289
      {
290
        Type = CosSin;
291
        Freq = .25;    
292
        A = {{80, 0 }}*pi/180;
293
        B = {{0, (70)}}*pi/180;
294
        
295
              Reaction.Type={Off};
296
  
297
        AnyKinMeasure &rtef=.Main.HumanModel.BodyModel.Interface.Left.ThoraxHumerus.Elevation;
298
      };
299
      
300
      
301
      
302
    };
303
    
304
  };
305
    
306
    
307
       
308
309
};
310
311
312
}; //Main
313
314