|
a |
|
b/Tests/Symmetry/DynamicTest/Model/MuscleSymmetryCheck.any |
|
|
1 |
AnyFolder SymmetryCheck= { |
|
|
2 |
|
|
|
3 |
#if (BM_ARM_RIGHT != OFF) & (BM_ARM_LEFT != OFF) |
|
|
4 |
|
|
|
5 |
|
|
|
6 |
AnyFolder Arm ={ |
|
|
7 |
|
|
|
8 |
AnyFolder Kinematics ={ |
|
|
9 |
|
|
|
10 |
AnyFolder Right ={ |
|
|
11 |
AnyObjectPtrArray RefFrames = ObjSearchRecursive("Main.HumanModel.BodyModel.Right.ShoulderArm", "r","AnyFloat", 10); |
|
|
12 |
//this is a trick to make the ouput of the search posvar not const |
|
|
13 |
AnyFloat PointsXY = (Obj2Num(RefFrames))* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
14 |
//look at the Comparison.Max_ListComparison to detect which point no is causing non zero values... |
|
|
15 |
//use the line below to find out which point is the trouble maker by typing in the number... |
|
|
16 |
AnyString PointName = CompleteNameOf(RefFrames[1]); |
|
|
17 |
|
|
|
18 |
}; |
|
|
19 |
|
|
|
20 |
AnyFolder Left ={ |
|
|
21 |
//this is the way it is supposed to be... but the Obj2Num returns consts... for the moment |
|
|
22 |
AnyObjectPtrArray RefFrames = ObjSearchRecursive("Main.HumanModel.BodyModel.Left.ShoulderArm", "r","AnyFloat", 10); |
|
|
23 |
//the model is symmetric on Z this trick allows us to check all nodes regardless if they are place on thorax or pelvis |
|
|
24 |
AnyFloat PointsXY= (Obj2Num(RefFrames))* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
25 |
|
|
|
26 |
}; |
|
|
27 |
|
|
|
28 |
AnyFolder Comparison ={ |
|
|
29 |
AnyFloat r_Diff =.Right.PointsXY-.Left.PointsXY; |
|
|
30 |
AnyFloat Max_r_Diff = max(abs(r_Diff)); |
|
|
31 |
}; |
|
|
32 |
|
|
|
33 |
}; |
|
|
34 |
|
|
|
35 |
AnyFolder Inertia ={ |
|
|
36 |
|
|
|
37 |
AnyFolder Right ={ |
|
|
38 |
|
|
|
39 |
AnyKinCoM CoMAll ={ |
|
|
40 |
AnyFolder &ref= Main.HumanModel.BodyModel.Right.ShoulderArm; |
|
|
41 |
}; |
|
|
42 |
AnyKinCoM Clavicula ={ AnySeg &ref= Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Clavicula; }; |
|
|
43 |
AnyKinCoM Scapula={ AnySeg &ref= Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Scapula; }; |
|
|
44 |
AnyKinCoM Humerus={ AnySeg &ref= Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Humerus; }; |
|
|
45 |
AnyKinCoM Ulna={ AnySeg &ref= Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Ulna; }; |
|
|
46 |
AnyKinCoM Radius={ AnySeg &ref= Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Radius; }; |
|
|
47 |
// AnyKinCoM WristJointSeg={ AnySeg &ref= Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.WristJointSeg; }; |
|
|
48 |
AnyKinCoM Hand={ AnySeg &ref= Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Hand; }; |
|
|
49 |
// AnyKinCoM Glove={ AnySeg &ref= Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Glove; }; |
|
|
50 |
|
|
|
51 |
}; |
|
|
52 |
|
|
|
53 |
AnyFolder Left ={ |
|
|
54 |
|
|
|
55 |
AnyKinCoM CoMAll ={ |
|
|
56 |
AnyFolder &ref= Main.HumanModel.BodyModel.Left.ShoulderArm; |
|
|
57 |
}; |
|
|
58 |
|
|
|
59 |
AnyKinCoM Clavicula ={ AnySeg &ref= Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.Clavicula; }; |
|
|
60 |
AnyKinCoM Scapula={ AnySeg &ref= Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.Scapula; }; |
|
|
61 |
AnyKinCoM Humerus={ AnySeg &ref= Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.Humerus; }; |
|
|
62 |
AnyKinCoM Ulna={ AnySeg &ref= Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.Ulna; }; |
|
|
63 |
AnyKinCoM Radius={ AnySeg &ref= Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.Radius; }; |
|
|
64 |
AnyKinCoM Hand={ AnySeg &ref= Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.Hand; }; |
|
|
65 |
}; |
|
|
66 |
|
|
|
67 |
AnyFolder Comparison ={ |
|
|
68 |
AnyFloat CoMDif =(.Right.CoMAll.Pos-.Left.CoMAll.Pos)* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
69 |
AnyFloat Clavicula =(.Right.Clavicula.Pos-.Left.Clavicula.Pos)* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
70 |
AnyFloat Scapula=(.Right.Scapula.Pos-.Left.Scapula.Pos)* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
71 |
AnyFloat Humerus=(.Right.Humerus.Pos-.Left.Humerus.Pos)* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
72 |
AnyFloat Ulna=(.Right.Ulna.Pos-.Left.Ulna.Pos)* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
73 |
AnyFloat Radius=(.Right.Radius.Pos-.Left.Radius.Pos)* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
74 |
AnyFloat Hand=(.Right.Hand.Pos-.Left.Hand.Pos)* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
75 |
}; |
|
|
76 |
}; |
|
|
77 |
|
|
|
78 |
AnyFolder JntMuscle ={ |
|
|
79 |
AnyFolder Right ={ |
|
|
80 |
AnyObjectPtrArray JointTorquePtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Right.ShoulderArm.JointMuscles", "Fout","AnyValue", 10); |
|
|
81 |
AnyFloat JointTorque = Obj2Num(JointTorquePtr); |
|
|
82 |
}; |
|
|
83 |
AnyFolder Left ={ |
|
|
84 |
AnyObjectPtrArray JointTorquePtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Left.ShoulderArm.JointMuscles", "Fout","AnyValue", 10); |
|
|
85 |
AnyFloat JointTorque = Obj2Num(JointTorquePtr); |
|
|
86 |
|
|
|
87 |
//1 run the model |
|
|
88 |
//2 Look at the Max_listComparison |
|
|
89 |
//3 indentify if a muscle is sticking out... ie has larger values than kin tolerance ... |
|
|
90 |
//4 if so use the two lines below to identify the name of it... (replace 55) |
|
|
91 |
//5 This can be used to find a name of a specific item in sf |
|
|
92 |
|
|
|
93 |
// AnyString TorqueName = CompleteNameOf(JointTorquePtr[3]); |
|
|
94 |
|
|
|
95 |
|
|
|
96 |
}; |
|
|
97 |
|
|
|
98 |
AnyFolder Comparison ={ |
|
|
99 |
AnyFloat JointTorqueDiff =.Right.JointTorque-.Left.JointTorque; |
|
|
100 |
}; |
|
|
101 |
}; |
|
|
102 |
|
|
|
103 |
|
|
|
104 |
AnyFolder Muscle ={ |
|
|
105 |
AnyFolder Right ={ |
|
|
106 |
AnyObjectPtrArray LmtPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Right.ShoulderArm", "Lmt","AnyValue", 10); |
|
|
107 |
AnyFloat Lmt = Obj2Num(LmtPtr); |
|
|
108 |
|
|
|
109 |
AnyObjectPtrArray LmtDotPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Right.ShoulderArm", "LmtDot","AnyValue", 10); |
|
|
110 |
AnyFloat LmtDot = Obj2Num(LmtDotPtr); |
|
|
111 |
|
|
|
112 |
AnyObjectPtrArray StrengthPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Right.ShoulderArm", "Strength","AnyValue", 10); |
|
|
113 |
AnyFloat Strength = Obj2Num(StrengthPtr); |
|
|
114 |
|
|
|
115 |
AnyObjectPtrArray FtPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Right.ShoulderArm", "Ft","AnyValue", 10); |
|
|
116 |
AnyFloat Ft = Obj2Num(FtPtr); |
|
|
117 |
|
|
|
118 |
AnyObjectPtrArray SP_PointsPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Right.ShoulderArm", "P","AnyValue", 10); |
|
|
119 |
// AnyFloat SP_Points = Obj2Num(SP_PointsPtr[34]); |
|
|
120 |
|
|
|
121 |
}; |
|
|
122 |
AnyFolder Left ={ |
|
|
123 |
AnyObjectPtrArray LmtPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Left.ShoulderArm", "Lmt","AnyValue", 10); |
|
|
124 |
AnyFloat Lmt = Obj2Num(LmtPtr); |
|
|
125 |
|
|
|
126 |
AnyObjectPtrArray LmtDotPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Left.ShoulderArm", "LmtDot","AnyValue", 10); |
|
|
127 |
AnyFloat LmtDot = Obj2Num(LmtDotPtr); |
|
|
128 |
|
|
|
129 |
AnyObjectPtrArray StrengthPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Left.ShoulderArm", "Strength","AnyValue", 10); |
|
|
130 |
AnyFloat Strength = Obj2Num(StrengthPtr); |
|
|
131 |
|
|
|
132 |
AnyObjectPtrArray FtPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Left.ShoulderArm", "Ft","AnyValue", 10); |
|
|
133 |
AnyFloat Ft = Obj2Num(FtPtr); //Instructions: |
|
|
134 |
|
|
|
135 |
|
|
|
136 |
AnyObjectPtrArray SP_PointsPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Left.ShoulderArm", "P","AnyValue", 10); |
|
|
137 |
|
|
|
138 |
// AnyFloat SP_Points = Obj2Num(SP_PointsPtr[34]); |
|
|
139 |
|
|
|
140 |
//1 run the model |
|
|
141 |
//2 Look at the Max_listComparison |
|
|
142 |
//3 indentify if a muscle is sticking out... ie has larger values than kin tolerance ... |
|
|
143 |
//4 if so use the two lines below to identify the name of it... (replace 55) |
|
|
144 |
//5 This can be used to find a name of a specific item in sf |
|
|
145 |
AnyObjectPtrArray MusclesNames = ObjSearchRecursive("Main.HumanModel.BodyModel.Left.ShoulderArm","*", "AnyMuscle",10); |
|
|
146 |
AnyString MusclesName = NameOf(MusclesNames[34]); |
|
|
147 |
|
|
|
148 |
}; |
|
|
149 |
|
|
|
150 |
AnyFolder Comparison ={ |
|
|
151 |
AnyFloat LmtDif =.Right.Lmt-.Left.Lmt; |
|
|
152 |
AnyVar MaxLmtDiff= max(LmtDif); |
|
|
153 |
|
|
|
154 |
AnyFloat LmtDotDif =.Right.LmtDot-.Left.LmtDot; |
|
|
155 |
AnyVar MaxLmtDotDiff= max(LmtDotDif); |
|
|
156 |
AnyFloat StrengthDif =.Right.Strength-.Left.Strength; |
|
|
157 |
AnyFloat FtDif =.Right.Ft-.Left.Ft; |
|
|
158 |
|
|
|
159 |
AnyString MaxFtDifName = CompleteNameOf(.Right.FtPtr[argmax(FtDif)]); |
|
|
160 |
AnyFloat MaxFtDifValues = {.Right.Ft[argmax(FtDif)], .Left.Ft[argmax(FtDif)]}; |
|
|
161 |
|
|
|
162 |
AnyVar MaxFtDif= max(FtDif); |
|
|
163 |
// AnyFloat SP_Points =(.Right.SP_Points-.Left.SP_Points)* {{1,0,0},{0,1,0},{0,0,0}} ; |
|
|
164 |
|
|
|
165 |
}; |
|
|
166 |
}; |
|
|
167 |
}; |
|
|
168 |
#endif |
|
|
169 |
|
|
|
170 |
#if (BM_LEG_RIGHT != OFF) & (BM_LEG_LEFT != OFF) |
|
|
171 |
AnyFolder Leg ={ |
|
|
172 |
|
|
|
173 |
AnyFolder Kinematics ={ |
|
|
174 |
|
|
|
175 |
AnyFolder Right ={ |
|
|
176 |
AnyObjectPtrArray RefFrames = ObjSearchRecursive("Main.HumanModel.BodyModel.Right.Leg", "r","AnyFloat", 10); |
|
|
177 |
//this is a trick to make the ouput of the search posvar not const |
|
|
178 |
AnyFloat PointsXY = (Obj2Num(RefFrames))* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
179 |
//look at the Comparison.Max_ListComparison to detect which point no is causing non zero values... |
|
|
180 |
//use the line below to find out which point is the trouble maker by typing in the number... |
|
|
181 |
AnyString PointName = CompleteNameOf(RefFrames[1]); |
|
|
182 |
|
|
|
183 |
}; |
|
|
184 |
|
|
|
185 |
AnyFolder Left ={ |
|
|
186 |
//this is the way it is supposed to be... but the Obj2Num returns consts... for the moment |
|
|
187 |
AnyObjectPtrArray RefFrames = ObjSearchRecursive("Main.HumanModel.BodyModel.Left.Leg", "r","AnyFloat", 10); |
|
|
188 |
//the model is symmetric on Z this trick allows us to check all nodes regardless if they are place on thorax or pelvis |
|
|
189 |
AnyFloat PointsXY= (Obj2Num(RefFrames))* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
190 |
|
|
|
191 |
}; |
|
|
192 |
|
|
|
193 |
AnyFolder Comparison ={ |
|
|
194 |
AnyFloat r_Diff =.Right.PointsXY-.Left.PointsXY; |
|
|
195 |
AnyFloat Max_r_Diff = max(abs(r_Diff)); |
|
|
196 |
}; |
|
|
197 |
|
|
|
198 |
}; |
|
|
199 |
|
|
|
200 |
AnyFolder Inertia ={ |
|
|
201 |
|
|
|
202 |
AnyFolder Right ={ |
|
|
203 |
|
|
|
204 |
AnyKinCoM CoMAll ={ |
|
|
205 |
AnyFolder &ref= Main.HumanModel.BodyModel.Right.Leg; |
|
|
206 |
}; |
|
|
207 |
AnyKinCoM Thigh ={ AnySeg &ref= Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh; }; |
|
|
208 |
AnyKinCoM Shank={ AnySeg &ref= Main.HumanModel.BodyModel.Right.Leg.Seg.Shank; }; |
|
|
209 |
AnyKinCoM Talus={ AnySeg &ref= Main.HumanModel.BodyModel.Right.Leg.Seg.Talus; }; |
|
|
210 |
AnyKinCoM Foot={ AnySeg &ref= Main.HumanModel.BodyModel.Right.Leg.Seg.Foot; }; |
|
|
211 |
|
|
|
212 |
}; |
|
|
213 |
|
|
|
214 |
AnyFolder Left ={ |
|
|
215 |
|
|
|
216 |
AnyKinCoM CoMAll ={ |
|
|
217 |
AnyFolder &ref= Main.HumanModel.BodyModel.Left.Leg; |
|
|
218 |
}; |
|
|
219 |
|
|
|
220 |
AnyKinCoM Thigh ={ AnySeg &ref= Main.HumanModel.BodyModel.Left.Leg.Seg.Thigh; }; |
|
|
221 |
AnyKinCoM Shank={ AnySeg &ref= Main.HumanModel.BodyModel.Left.Leg.Seg.Shank; }; |
|
|
222 |
AnyKinCoM Talus={ AnySeg &ref= Main.HumanModel.BodyModel.Left.Leg.Seg.Talus; }; |
|
|
223 |
AnyKinCoM Foot={ AnySeg &ref= Main.HumanModel.BodyModel.Left.Leg.Seg.Foot; }; |
|
|
224 |
}; |
|
|
225 |
|
|
|
226 |
AnyFolder Comparison ={ |
|
|
227 |
AnyFloat CoMDif =(.Right.CoMAll.Pos-.Left.CoMAll.Pos)* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
228 |
AnyFloat Thigh =(.Right.Thigh.Pos-.Left.Thigh.Pos)* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
229 |
AnyFloat Shank=(.Right.Shank.Pos-.Left.Shank.Pos)* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
230 |
AnyFloat Talus=(.Right.Talus.Pos-.Left.Talus.Pos)* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
231 |
AnyFloat Foot=(.Right.Foot.Pos-.Left.Foot.Pos)* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
232 |
}; |
|
|
233 |
}; |
|
|
234 |
|
|
|
235 |
AnyFolder JntMuscle ={ |
|
|
236 |
AnyFolder Right ={ |
|
|
237 |
AnyObjectPtrArray JointTorquePtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Right.Leg.JointMuscles", "Fout","AnyValue", 10); |
|
|
238 |
AnyFloat JointTorque = Obj2Num(JointTorquePtr); |
|
|
239 |
}; |
|
|
240 |
AnyFolder Left ={ |
|
|
241 |
AnyObjectPtrArray JointTorquePtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Left.Leg.JointMuscles", "Fout","AnyValue", 10); |
|
|
242 |
AnyFloat JointTorque = Obj2Num(JointTorquePtr); |
|
|
243 |
|
|
|
244 |
//1 run the model |
|
|
245 |
//2 Look at the Max_listComparison |
|
|
246 |
//3 indentify if a muscle is sticking out... ie has larger values than kin tolerance ... |
|
|
247 |
//4 if so use the two lines below to identify the name of it... (replace 55) |
|
|
248 |
//5 This can be used to find a name of a specific item in sf |
|
|
249 |
|
|
|
250 |
// AnyString TorqueName = CompleteNameOf(JointTorquePtr[3]); |
|
|
251 |
|
|
|
252 |
|
|
|
253 |
}; |
|
|
254 |
|
|
|
255 |
AnyFolder Comparison ={ |
|
|
256 |
AnyFloat JointTorqueDiff =.Right.JointTorque-.Left.JointTorque; |
|
|
257 |
}; |
|
|
258 |
}; |
|
|
259 |
|
|
|
260 |
|
|
|
261 |
AnyFolder Muscle ={ |
|
|
262 |
AnyFolder Right ={ |
|
|
263 |
AnyObjectPtrArray LmtPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Right.Leg", "Lmt","AnyValue", 10); |
|
|
264 |
AnyFloat Lmt = Obj2Num(LmtPtr); |
|
|
265 |
|
|
|
266 |
AnyObjectPtrArray LmtDotPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Right.Leg", "LmtDot","AnyValue", 10); |
|
|
267 |
AnyFloat LmtDot = Obj2Num(LmtDotPtr); |
|
|
268 |
|
|
|
269 |
AnyObjectPtrArray StrengthPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Right.Leg", "Strength","AnyValue", 10); |
|
|
270 |
AnyFloat Strength = Obj2Num(StrengthPtr); |
|
|
271 |
|
|
|
272 |
AnyObjectPtrArray FtPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Right.Leg", "Ft","AnyValue", 10); |
|
|
273 |
AnyFloat Ft = Obj2Num(FtPtr); |
|
|
274 |
|
|
|
275 |
|
|
|
276 |
}; |
|
|
277 |
AnyFolder Left ={ |
|
|
278 |
AnyObjectPtrArray LmtPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Left.Leg", "Lmt","AnyValue", 10); |
|
|
279 |
AnyFloat Lmt = Obj2Num(LmtPtr); |
|
|
280 |
|
|
|
281 |
AnyObjectPtrArray LmtDotPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Left.Leg", "LmtDot","AnyValue", 10); |
|
|
282 |
AnyFloat LmtDot = Obj2Num(LmtDotPtr); |
|
|
283 |
|
|
|
284 |
AnyObjectPtrArray StrengthPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Left.Leg", "Strength","AnyValue", 10); |
|
|
285 |
AnyFloat Strength = Obj2Num(StrengthPtr); |
|
|
286 |
|
|
|
287 |
AnyObjectPtrArray FtPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Left.Leg", "Ft","AnyValue", 10); |
|
|
288 |
AnyFloat Ft = Obj2Num(FtPtr); //Instructions: |
|
|
289 |
|
|
|
290 |
//1 run the model |
|
|
291 |
//2 Look at the Max_listComparison |
|
|
292 |
//3 indentify if a muscle is sticking out... ie has larger values than kin tolerance ... |
|
|
293 |
//4 if so use the two lines below to identify the name of it... (replace 55) |
|
|
294 |
//5 This can be used to find a name of a specific item in sf |
|
|
295 |
AnyObjectPtrArray MusclesNames = ObjSearchRecursive("Main.HumanModel.BodyModel.Left.Leg","*", "AnyMuscle",10); |
|
|
296 |
// AnyString MusclesName = NameOf(MusclesNames[36]); |
|
|
297 |
|
|
|
298 |
|
|
|
299 |
}; |
|
|
300 |
|
|
|
301 |
AnyFolder Comparison ={ |
|
|
302 |
AnyFloat LmtDif =.Right.Lmt-.Left.Lmt; |
|
|
303 |
AnyVar MaxLmtDiff= max(LmtDif); |
|
|
304 |
|
|
|
305 |
AnyFloat LmtDotDif =.Right.LmtDot-.Left.LmtDot; |
|
|
306 |
AnyVar MaxLmtDotDiff= max(LmtDotDif); |
|
|
307 |
AnyFloat StrengthDif =.Right.Strength-.Left.Strength; |
|
|
308 |
|
|
|
309 |
AnyFloat FtDif =.Right.Ft-.Left.Ft; |
|
|
310 |
|
|
|
311 |
AnyVar MaxFtDif= max(FtDif); |
|
|
312 |
|
|
|
313 |
}; |
|
|
314 |
}; |
|
|
315 |
|
|
|
316 |
|
|
|
317 |
|
|
|
318 |
|
|
|
319 |
}; |
|
|
320 |
#endif |
|
|
321 |
|
|
|
322 |
AnyFolder Trunk ={ |
|
|
323 |
|
|
|
324 |
AnyFolder Kinematics ={ |
|
|
325 |
|
|
|
326 |
AnyFolder Right ={ |
|
|
327 |
AnyObjectPtrArray RefFrames = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk", "*NodeR.r","AnyFloat", 10); |
|
|
328 |
//this is a trick to make the ouput of the search posvar not const |
|
|
329 |
AnyFloat PointsXY = (Obj2Num(RefFrames))* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
330 |
//look at the Comparison.Max_ListComparison to detect which point no is causing non zero values... |
|
|
331 |
//use the line below to find out which point is the trouble maker by typing in the number... |
|
|
332 |
AnyString PointName = CompleteNameOf(RefFrames[1]); |
|
|
333 |
|
|
|
334 |
}; |
|
|
335 |
|
|
|
336 |
AnyFolder Left ={ |
|
|
337 |
//this is the way it is supposed to be... but the Obj2Num returns consts... for the moment |
|
|
338 |
AnyObjectPtrArray RefFrames = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk", "*NodeL.r","AnyFloat", 10); |
|
|
339 |
//the model is symmetric on Z this trick allows us to check all nodes regardless if they are place on thorax or pelvis |
|
|
340 |
AnyFloat PointsXY= (Obj2Num(RefFrames))* {{1,0,0},{0,1,0},{0,0,0}}; |
|
|
341 |
|
|
|
342 |
}; |
|
|
343 |
|
|
|
344 |
AnyFolder Comparison ={ |
|
|
345 |
AnyFloat r_Diff =.Right.PointsXY-.Left.PointsXY; |
|
|
346 |
AnyFloat Max_r_Diff = max(abs(r_Diff)); |
|
|
347 |
|
|
|
348 |
}; |
|
|
349 |
|
|
|
350 |
}; |
|
|
351 |
|
|
|
352 |
AnyFolder Inertia ={ |
|
|
353 |
|
|
|
354 |
|
|
|
355 |
|
|
|
356 |
AnyKinCoM CoMAll ={ |
|
|
357 |
AnyFolder &ref= Main.HumanModel.BodyModel.Trunk; |
|
|
358 |
}; |
|
|
359 |
|
|
|
360 |
|
|
|
361 |
}; |
|
|
362 |
|
|
|
363 |
#if BM_TRUNK_LUMBAR_MUSCLES != OFF |
|
|
364 |
|
|
|
365 |
AnyFolder MuscleLumbar ={ |
|
|
366 |
AnyFolder Right ={ |
|
|
367 |
|
|
|
368 |
AnyObjectPtrArray LmtPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk.MusclesSpineRight", "Lmt","AnyValue", 10); |
|
|
369 |
AnyFloat Lmt = Obj2Num(LmtPtr); |
|
|
370 |
|
|
|
371 |
AnyObjectPtrArray LmtDotPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk.MusclesSpineRight", "LmtDot","AnyValue", 10); |
|
|
372 |
AnyFloat LmtDot = Obj2Num(LmtDotPtr); |
|
|
373 |
|
|
|
374 |
AnyObjectPtrArray StrengthPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk.MusclesSpineRight", "Strength","AnyValue", 10); |
|
|
375 |
AnyFloat Strength = Obj2Num(StrengthPtr); |
|
|
376 |
|
|
|
377 |
AnyObjectPtrArray FtPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk.MusclesSpineRight", "Ft","AnyValue", 10); |
|
|
378 |
AnyFloat Ft = Obj2Num(FtPtr); |
|
|
379 |
|
|
|
380 |
}; |
|
|
381 |
AnyFolder Left ={ |
|
|
382 |
AnyObjectPtrArray LmtPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk.MusclesSpineLeft", "Lmt","AnyValue", 10); |
|
|
383 |
AnyFloat Lmt = Obj2Num(LmtPtr); |
|
|
384 |
|
|
|
385 |
AnyObjectPtrArray LmtDotPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk.MusclesSpineLeft", "LmtDot","AnyValue", 10); |
|
|
386 |
AnyFloat LmtDot = Obj2Num(LmtDotPtr); |
|
|
387 |
|
|
|
388 |
AnyObjectPtrArray StrengthPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk.MusclesSpineLeft", "Strength","AnyValue", 10); |
|
|
389 |
AnyFloat Strength = Obj2Num(StrengthPtr); |
|
|
390 |
|
|
|
391 |
AnyObjectPtrArray FtPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk.MusclesSpineLeft", "Ft","AnyValue", 10); |
|
|
392 |
AnyFloat Ft = Obj2Num(FtPtr); |
|
|
393 |
}; |
|
|
394 |
|
|
|
395 |
AnyFolder Comparison ={ |
|
|
396 |
AnyFloat LmtDif =.Right.Lmt-.Left.Lmt; |
|
|
397 |
AnyVar MaxLmtDiff= max(LmtDif); |
|
|
398 |
|
|
|
399 |
AnyFloat LmtDotDif =.Right.LmtDot-.Left.LmtDot; |
|
|
400 |
AnyVar MaxLmtDotDiff= max(LmtDotDif); |
|
|
401 |
AnyFloat StrengthDif =.Right.Strength-.Left.Strength; |
|
|
402 |
AnyFloat FtDif =.Right.Ft-.Left.Ft; |
|
|
403 |
|
|
|
404 |
AnyString MaxFtDifName = CompleteNameOf(.Right.FtPtr[argmax(FtDif)]); |
|
|
405 |
AnyFloat MaxFtDifValues = {.Right.Ft[argmax(FtDif)], .Left.Ft[argmax(FtDif)]}; |
|
|
406 |
AnyVar MaxFtDif= max(FtDif); |
|
|
407 |
}; |
|
|
408 |
}; |
|
|
409 |
#endif |
|
|
410 |
|
|
|
411 |
|
|
|
412 |
#if BM_TRUNK_CERVICAL_MUSCLES != OFF |
|
|
413 |
|
|
|
414 |
AnyFolder MuscleCervical ={ |
|
|
415 |
AnyFolder Right ={ |
|
|
416 |
|
|
|
417 |
AnyObjectPtrArray LmtPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk.MusclesCervicalSpineRight", "Lmt","AnyValue", 10); |
|
|
418 |
AnyFloat Lmt = Obj2Num(LmtPtr); |
|
|
419 |
|
|
|
420 |
AnyObjectPtrArray LmtDotPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk.MusclesCervicalSpineRight", "LmtDot","AnyValue", 10); |
|
|
421 |
AnyFloat LmtDot = Obj2Num(LmtDotPtr); |
|
|
422 |
|
|
|
423 |
AnyObjectPtrArray StrengthPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk.MusclesCervicalSpineRight", "Strength","AnyValue", 10); |
|
|
424 |
AnyFloat Strength = Obj2Num(StrengthPtr); |
|
|
425 |
|
|
|
426 |
AnyObjectPtrArray FtPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk.MusclesCervicalSpineRight", "Ft","AnyValue", 10); |
|
|
427 |
AnyFloat Ft = Obj2Num(FtPtr); |
|
|
428 |
|
|
|
429 |
}; |
|
|
430 |
AnyFolder Left ={ |
|
|
431 |
AnyObjectPtrArray LmtPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk.MusclesCervicalSpineLeft", "Lmt","AnyValue", 10); |
|
|
432 |
AnyFloat Lmt = Obj2Num(LmtPtr); |
|
|
433 |
|
|
|
434 |
AnyObjectPtrArray LmtDotPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk.MusclesCervicalSpineLeft", "LmtDot","AnyValue", 10); |
|
|
435 |
AnyFloat LmtDot = Obj2Num(LmtDotPtr); |
|
|
436 |
|
|
|
437 |
AnyObjectPtrArray StrengthPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk.MusclesCervicalSpineLeft", "Strength","AnyValue", 10); |
|
|
438 |
AnyFloat Strength = Obj2Num(StrengthPtr); |
|
|
439 |
|
|
|
440 |
AnyObjectPtrArray FtPtr = ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk.MusclesCervicalSpineLeft", "Ft","AnyValue", 10); |
|
|
441 |
AnyFloat Ft = Obj2Num(FtPtr); |
|
|
442 |
}; |
|
|
443 |
|
|
|
444 |
AnyFolder Comparison ={ |
|
|
445 |
AnyFloat LmtDif =.Right.Lmt-.Left.Lmt; |
|
|
446 |
AnyVar MaxLmtDiff= max(LmtDif); |
|
|
447 |
|
|
|
448 |
AnyFloat LmtDotDif =.Right.LmtDot-.Left.LmtDot; |
|
|
449 |
AnyVar MaxLmtDotDiff= max(LmtDotDif); |
|
|
450 |
AnyFloat StrengthDif =.Right.Strength-.Left.Strength; |
|
|
451 |
AnyFloat FtDif =.Right.Ft-.Left.Ft; |
|
|
452 |
AnyVar MaxFtDif= max(FtDif); |
|
|
453 |
}; |
|
|
454 |
}; |
|
|
455 |
#endif |
|
|
456 |
|
|
|
457 |
}; |
|
|
458 |
}; |
|
|
459 |
|
|
|
460 |
|