clear all
close all
clc

data = csvread('Results/recorded_reaction.csv');

time = data(:,1);
time = time/100000;
reaction_force = data(:,4);

robot_weight = 4.434; %[kg]
gravity_acceleration = 9.807; %[m/s^2] 

figure('position', [80 80 400 300], 'color', [1 1 1])
plot(time, reaction_force, 'b', 'LineWidth',0.5);
hold on
plot([time(1),time(end)],[robot_weight*gravity_acceleration robot_weight*gravity_acceleration], 'r--', 'LineWidth',0.5);

grid on
axis ([0 60 41 46])

legend('Reaction Force', 'Calculated Weight')

AxisFontName = 'Helvetica';
AxisFontSize = 8;

set(gca, 'XTick', 0:5:60, 'YTick', 41:0.25:46, 'FontName', AxisFontName, 'FontSize', AxisFontSize)

title('Ground Reaction Force Variation', 'Fontsize', AxisFontSize, 'FontName', AxisFontName)
xlabel('Time [s]', 'Fontsize', AxisFontSize, 'FontName', AxisFontName)
ylabel('Force [N]', 'Fontsize', AxisFontSize, 'FontName', AxisFontName)

export_fig reaction_force -pdf -transparent
