You are on page 1of 1

%% FIRST FLIGHT

x_coor = [gps1.lon];
y_coor = [gps1.lat];
z_coor = [gps2.h];
x_coor = 6371*(x_coor-x_coor(1))*(pi/180);
y_coor = 6371*(y_coor-y_coor(1))*(pi/180);
t_coor = [gps1.timestamp];
%{
pointer = t_ini<t_coor;
x_coor = x_coor(pointer);
y_coor = y_coor(pointer);
z_coor = z_coor(pointer);
t_coor = t_coor(pointer);
%}
figure;
I = imread('MAPA_1.jpeg');
J = imresize(I,2);
h = image(J);
hold on;
uistack(h,'bottom')

for i=2:length(t_coor)-1
plot(100*x_coor(1:i)+2325,-100*y_coor(1:i)+1000,'g');
head = scatter(100*x_coor(i)+2325,-100*y_coor(i)+1000,...
'filled','MarkerFaceColor','r','MarkerEdgeColor','b');
F(i) = getframe(gcf);
pause((t_coor(i+1)-t_coor(i))/1000);
delete(head);
end

video = VideoWriter('GPS.avi','Uncompressed AVI');


open(video)
writeVideo(video,F)
close(video)

You might also like