% Adjustments to r femur and tibia -> big changes in 
%

k0=read_motionFile('Results/subject01_walk1_RRA1_Kinematics_dudt.sto');
k1=read_motionFile('Results/adjusted1_subject01_walk1_RRA1_Kinematics_dudt.sto');
k2=read_motionFile('Results/adjusted2_subject01_walk1_RRA1_Kinematics_dudt.sto');
k3=read_motionFile('Results/adjusted3_subject01_walk1_RRA1_Kinematics_dudt.sto');

disp(sprintf('Adjusted1: max error %s', max_column_info(q0.labels, k1.data-k0.data)));
disp(sprintf('Adjusted2: max error %s', max_column_info(q0.labels, k2.data-k0.data)));
disp(sprintf('Adjusted3: max error %s', max_column_info(q0.labels, k3.data-k0.data)));


q0=read_motionFile('Results/subject01_walk1_RRA1_Actuation_Force.sto');
q1=read_motionFile('Results/adjusted1_subject01_walk1_RRA1_Actuation_Force.sto');
q2=read_motionFile('Results/adjusted2_subject01_walk1_RRA1_Actuation_Force.sto');
q3=read_motionFile('Results/adjusted3_subject01_walk1_RRA1_Actuation_Force.sto');

names = q1.labels(8:end);

for i=1:length(names)
    figure
    index = find_columns_by_label(q0.labels,names{i});
    cols = [q0.data(:,index) q1.data(:,index) q2.data(:,index) q3.data(:,index)];
    plot(q0.data(:,1), cols);
    legend('original','adj1','adj2','adj3');
    title(names{i});
%    hold on;
%    plot_columns(q1,names{i},'r');
%    plot_columns(q2,names{i},'g');
%    plot_columns(q3,names{i},'b');
%    legend
end
