|
7 | 7 | import org.opensim.modeling.*; |
8 | 8 |
|
9 | 9 |
|
10 | | -osimModel_name = '../_test_data/Arm26/arm26.osim'; |
11 | | -IK_mot_file = '../_test_data/Arm26/elbow_flexion.mot'; |
12 | | -bodyOfInterest_name = 'r_humerus'; |
| 10 | +% verification |
| 11 | +osimModel_name = '../_test_data/MFD_tests/testModel.osim'; |
| 12 | +IK_mot_file = '../_test_data/MFD_tests/testKinematics_file.mot'; |
| 13 | +bodyOfInterest_name = 'MovingBody'; |
13 | 14 | bodyExpressResultsIn_name = []; |
14 | | -effective_attachm = 'true'; |
| 15 | +effective_attachm = 'false'; |
15 | 16 | test_input = []; |
| 17 | +vis_on = 'true'; |
16 | 18 |
|
17 | | -N_frame_test = 5; |
18 | | -muscleLinesOfActionStruct = muscleForceDirection_plugin(osimModel_name,... |
19 | | - IK_mot_file,... |
20 | | - bodyOfInterest_name,... |
21 | | - bodyExpressResultsIn_name,... |
22 | | - effective_attachm,... |
23 | | - 'true',... |
24 | | - []); |
25 | | - |
26 | | - |
27 | | - |
| 19 | +validated_results_folder = '../_test_data/MFD_tests/validated_res'; |
| 20 | + |
| 21 | +res_anatAttach_local = getMuscleForceDirection(osimModel_name,... |
| 22 | + IK_mot_file,... |
| 23 | + bodyOfInterest_name,... |
| 24 | + bodyExpressResultsIn_name,... |
| 25 | + 'false',... |
| 26 | + vis_on,... |
| 27 | + []); |
| 28 | + |
| 29 | +% res_effectAttach_local = getMuscleForceDirection(osimModel_name,... |
| 30 | +% IK_mot_file,... |
| 31 | +% bodyOfInterest_name,... |
| 32 | +% bodyExpressResultsIn_name,... |
| 33 | +% 'true',... |
| 34 | +% vis_on,... |
| 35 | +% []); |
| 36 | +% |
| 37 | +% res_effectAttach_ground = getMuscleForceDirection(osimModel_name,... |
| 38 | +% IK_mot_file,... |
| 39 | +% bodyOfInterest_name,... |
| 40 | +% 'ground',... |
| 41 | +% 'true',... |
| 42 | +% vis_on,... |
| 43 | +% []); |
| 44 | +% |
| 45 | +% res_anatAttach_ground = getMuscleForceDirection(osimModel_name,... |
| 46 | +% IK_mot_file,... |
| 47 | +% bodyOfInterest_name,... |
| 48 | +% 'ground',... |
| 49 | +% 'false',... |
| 50 | +% vis_on,... |
| 51 | +% []); |
| 52 | + |
| 53 | + |
| 54 | +res_anatAttach_local |
| 55 | +res_anatAttach_ground |
| 56 | +res_effectAttach_ground |
| 57 | +res_effectAttach_local |
| 58 | + |
| 59 | +res_anatAttach_local_val = sto2Mat(fullfile(validated_results_folder,'LOCAL_ANATOM_MuscleForceDirection_vectors.sto')); |
| 60 | + |
| 61 | +res_anatAttach_ground.rowheaders |
| 62 | +res_effectAttach_ground |
| 63 | +res_effectAttach_local |
| 64 | +%-------------------------------------------------------------------------- |
| 65 | +% %% test 1: simple arm26 model |
| 66 | +% osimModel_name = '../_test_data/Arm26/arm26.osim'; |
| 67 | +% IK_mot_file = '../_test_data/Arm26/elbow_flexion.mot'; |
| 68 | +% bodyOfInterest_name = 'r_humerus'; |
| 69 | +% bodyExpressResultsIn_name = []; |
| 70 | +% effective_attachm = 'true'; |
| 71 | +% test_input = []; |
| 72 | +% |
| 73 | +% |
| 74 | +% N_frame_test = 5; |
| 75 | +% muscleLinesOfActionStruct = getMuscleForceDirection(osimModel_name,... |
| 76 | +% IK_mot_file,... |
| 77 | +% bodyOfInterest_name,... |
| 78 | +% bodyExpressResultsIn_name,... |
| 79 | +% effective_attachm,... |
| 80 | +% 'true',... |
| 81 | +% []); |
| 82 | +% |
| 83 | +% |
| 84 | +%-------------------------------------------------------------------------- |
| 85 | +% %% test 2: gait2392 model |
| 86 | +% |
28 | 87 | % osimModel_name = '../_test_data/gait2392/subject01.osim'; |
29 | 88 | % IK_mot_file = '../_test_data/gait2392/subject01_walk1_ik.mot'; |
30 | 89 | % bodyOfInterest_name = 'femur_r'; |
|
33 | 92 | % test_input = []; |
34 | 93 | % |
35 | 94 | % N_frame_test = 5; |
36 | | -% muscleLinesOfActionStruct = muscleForceDirection_plugin(osimModel_name,... |
| 95 | +% muscleLinesOfActionStruct = getMuscleForceDirection(osimModel_name,... |
37 | 96 | % IK_mot_file,... |
38 | 97 | % bodyOfInterest_name,... |
39 | 98 | % bodyExpressResultsIn_name,... |
|
0 commit comments