%-------------------------------------------------------------------------%
% Copyright (c) 2019 Modenese L. %
% Author: Luca Modenese %
% email: l.modenese@imperial.ac.uk %
% ----------------------------------------------------------------------- %
% Load Library
import org.opensim.modeling.*;
% verification
osimModel_name = '../_test_data/MFD_tests/testModel.osim';
IK_mot_file = '../_test_data/MFD_tests/testKinematics_file.mot';
results_directory = '../_test_data/MFD_tests';
bodyOfInterest_name = 'MovingBody';
bodyExpressResultsIn_name = [];
effective_attachm = 'false';
print_attachm = 'true';
vis_on = 'true';
N_frame_test = 5;
% validated_results_folder = '../_test_data/MFD_tests/validated_res';
res_anatAttach_local = getMuscleForceDirection(osimModel_name,...
IK_mot_file,...
results_directory,...
bodyOfInterest_name,...
bodyExpressResultsIn_name,...
effective_attachm,...
print_attachm,...
vis_on,...
N_frame_test);
% res_effectAttach_local = getMuscleForceDirection(osimModel_name,...
% IK_mot_file,...
% results_directory,...
% bodyOfInterest_name,...
% bodyExpressResultsIn_name,...
% 'true',...
% print_attachm,...
% vis_on,...
% []);
%
% res_effectAttach_ground = getMuscleForceDirection(osimModel_name,...
% IK_mot_file,...
% results_directory,...
% bodyOfInterest_name,...
% 'ground',...
% 'true',...
% print_attachm,...
% vis_on,...
% []);
%
% res_anatAttach_ground = getMuscleForceDirection(osimModel_name,...
% IK_mot_file,...
% results_directory,...
% bodyOfInterest_name,...
% 'ground',...
% 'false',...
% print_attachm,...
% vis_on,...
% []);
% res_anatAttach_local
% res_anatAttach_ground
% res_effectAttach_ground
% res_effectAttach_local
%
% res_anatAttach_local_val = sto2Mat(fullfile(validated_results_folder,'LOCAL_ANATOM_MuscleForceDirection_vectors.sto'));
%
% res_anatAttach_ground.rowheaders
% res_effectAttach_ground
% res_effectAttach_local
%--------------------------------------------------------------------------
% %% test 1: simple arm26 model
% osimModel_name = '../_test_data/Arm26/arm26.osim';
% IK_mot_file = '../_test_data/Arm26/elbow_flexion.mot';
% results_directory = '../_test_data/Arm26';
% bodyOfInterest_name = 'r_humerus';
% bodyExpressResultsIn_name = [];
% effective_attachm = 'true';
% print_attachm = 'true';
% vis_on = 'true';
% N_frame_test = 5;
%
% muscleLinesOfActionStruct = getMuscleForceDirection(osimModel_name,...
% IK_mot_file,...
% results_directory,...
% bodyOfInterest_name,...
% bodyExpressResultsIn_name,...
% effective_attachm,...
% print_attachm,...
% vis_on,...
% N_frame_test);
%
%
%--------------------------------------------------------------------------
%% test 2: gait2392 model
osimModel_name = '../_test_data/gait2392/subject01.osim';
IK_mot_file = '../_test_data/gait2392/subject01_walk1_ik.mot';
results_directory = '../_test_data/gait2392';
bodyOfInterest_name = 'femur_r';
bodyExpressResultsIn_name = [];
effective_attachm = 'true';
print_attachm = 'true';
vis_on = 'true';
N_frame_test = 5;
muscleLinesOfActionStruct = getMuscleForceDirection(osimModel_name,...
IK_mot_file,...
results_directory,...
bodyOfInterest_name,...
bodyExpressResultsIn_name,...
effective_attachm,...
print_attachm,...
vis_on,...
N_frame_test);