function timeGeo=read_timeGeo_file(file_,ref_nr,cnt_id) % % Read the timeGeo file and return the data in a struct fn=fullfile(file_.folder,file_.name); con=fileread(fn); data=str2num(con); timeGeo.path=file_.folder; [~,timeGeo.id,~]=fileparts(file_.name); timeGeo.ref_nr=ref_nr; timeGeo.cnt_id=cnt_id; timeGeo.perc=data(:,1); timeGeo.time=data(:,2); timeGeo.lat=data(:,3); timeGeo.lon=data(:,4); timeGeo.altitude=data(:,5); timeGeo.yaw=data(:,6); timeGeo.speed=data(:,7); timeGeo.angv_x=data(:,8); timeGeo.angv_y=data(:,9); timeGeo.angv_z=data(:,10); rota=find(abs(timeGeo.angv_z)>0.1); notrota=setdiff(1:size(data,1),rota); r=strsplit(file_.name,"_"); timeGeo.range=str2num(r{6})/10; [timeGeo.LaA,timeGeo.LoA,... timeGeo.LaB,timeGeo.LoB]=get_circumference3(timeGeo.lat,... timeGeo.lon,... timeGeo.yaw,... timeGeo.altitude,... timeGeo.range); %[LaA,LoA,LaB,LoB]=get_circumference_rota(timeGeo.lat,... % timeGeo.lon,... % timeGeo.yaw,... % timeGeo.altitude,... % timeGeo.range,... % rota); points=[[timeGeo.LaA,timeGeo.LaB(end:-1:1)]',... [timeGeo.LoA,timeGeo.LoB(end:-1:1)]']; timeGeo.hull=convhull(points); cv=points([timeGeo.hull],:); timeGeo.aabb=[min(cv),max(cv)]; timeGeo.latc=mean(cv(:,1)); timeGeo.lonc=mean(cv(:,2)); timeGeo.yawc=mean(data(notrota,6)); timeGeo.path_id=-1; timeGeo.rota=rota; end %[LaA,LoA,LaB,LoB]=get_circumference_rota(timeGeo.lat,... % timeGeo.lon,... % timeGeo.yaw,... % timeGeo.altitude,... % timeGeo.range,... % rota); %points=[[LaA,LaB(end:-1:1)]',[LoA,LoB(end:-1:1)]']; %timeGeo.hull=convhull(points); %cv=points([timeGeo.hull],:); %timeGeo.aabb=[min(cv),max(cv)]; %timeGeo.latc=mean(cv(:,1)); %timeGeo.lonc=mean(cv(:,2)); %timeGeo.yawc=mean(data(notrota,6)); %timeGeo.path_id=-1; %timeGeo.rota=rota;