%% Limpar dados existentes
clc;
clear all;
close all;

% Iniciar ficheiro

file_f = importdata('/home/carpinteiro/workingcopies/lar4/src/sensors/optoelectric/data/Fanuc.txt');
file_s = importdata('/home/carpinteiro/workingcopies/lar4/src/sensors/optoelectric/data/Angulo.txt');

file_f(:,1)=file_f(:,1)-file_f(1,1);
file_s(:,1)=file_s(:,1)-file_s(1,1);
% plots

figure('position',[100 50 600 600],'color',[1 1 1])
plot(file_f(:,1),file_f(:,2),'b');
hold on
plot(file_s(:,1),file_s(:,2),'r*-');
    grid on
   % axis square
    xlabel('Tempo (s)');
    ylabel('Angulo (o)');
    title('Valores do Pitch Fanuc vs Sensores');
    export_fig('Pitch.pdf','-pdf')
    
    
figure('position',[100 50 600 600],'color',[1 1 1])
plot(file_f(:,1),file_f(:,3),'b');
hold on
plot(file_s(:,1),file_s(:,3),'r*-');
    grid on
   % axis square
    xlabel('Tempo (s)');
    ylabel('Angulo (o)');
    title('Valores do Roll Fanuc vs Sensores');
    export_fig('Roll.pdf','-pdf')