Browse Source

Merge pull request #90 from georgehines/matlab-log-import

version/toolbox compatibility
master
Paul Riseborough 9 years ago
parent
commit
61b919754d
  1. 22
      matlab/analysis/estimatorLogViewer.m
  2. 6
      matlab/analysis/usageSamples.m

22
matlab/analysis/estimatorLogViewer.m

@ -25,8 +25,8 @@ axesConfig = {'Units','Normalized','Position',[.05,.1,.65,.85],'NextPlot','add'} @@ -25,8 +25,8 @@ axesConfig = {'Units','Normalized','Position',[.05,.1,.65,.85],'NextPlot','add'}
BGconfig = {'Units','Normalized','Position',[.75,.1,.2,.85]};
TBconfig = {'Style','Checkbox','Units','Normalized','Position',[.75,0,.2,.1],'String','Show variance'};
statesAxes = axes(statesTab,axesConfig{:},'XLabel',text('string','Time (sec)'));
innovsAxes = axes(innovsTab,axesConfig{:},'XLabel',text('string','Time (sec)'));
statesAxes = axes('Parent',statesTab,axesConfig{:},'XLabel',text('string','Time (sec)'));
innovsAxes = axes('Parent',innovsTab,axesConfig{:},'XLabel',text('string','Time (sec)'));
statesBG = uibuttongroup(statesTab,BGconfig{:});
innovsBG = uibuttongroup(innovsTab,BGconfig{:});
@ -105,18 +105,20 @@ else @@ -105,18 +105,20 @@ else
centerLineTime = centerLineTimeFull(centerLineTimeFull >= startTime & centerLineTimeFull <= endTime);
centerLineData = centerLineDataFull(centerLineTimeFull >= startTime & centerLineTimeFull <= endTime);
plotDataT = sqrt(interp1(plotTimeFull,plotDataFull,centerLineTime));
plotTime = linspace(startTime,endTime,250);
plotData = sqrt(interp1(plotTimeFull,plotDataFull,plotTime));
centerLineData = interp1(centerLineTime,centerLineData,plotTime);
plotTime = downsample(centerLineTime,round(numel(plotDataT)/350),0);
% plotTime = downsample(centerLineTime,round(numel(plotDataT)/350),0);
if strcmp('IV',varNames{k}(end-1:end))
plotDataL = downsample(-plotDataT,round(numel(plotDataT)/350),0);
plotDataU = downsample(plotDataT,round(numel(plotDataT)/350),0);
plotDataL = -plotData;
plotDataU = plotData;
else
plotDataL = downsample(centerLineData-plotDataT,round(numel(plotDataT)/350),0);
plotDataU = downsample(centerLineData+plotDataT,round(numel(plotDataT)/350),0);
plotDataL = centerLineData-plotData;
plotDataU = centerLineData+plotData;
end
p = patch(axes,[plotTime,fliplr(plotTime)],[plotDataL,fliplr(plotDataU)],lines(k).Color);
set(p,'EdgeColor','none','FaceAlpha',.3,'UserData',stateNames{k});
p = patch([plotTime,fliplr(plotTime)],[plotDataL,fliplr(plotDataU)],lines(k).Color);
set(p,'Parent',axes,'EdgeColor','none','FaceAlpha',.3,'UserData',stateNames{k});
end
end
end

6
matlab/analysis/usageSamples.m

@ -8,3 +8,9 @@ attitudeData = importPX4log(fname,{'ATT'}); @@ -8,3 +8,9 @@ attitudeData = importPX4log(fname,{'ATT'});
%% estimator messages
estimatorData = importPX4log(fname,{'EST0','EST1','EST2','EST3','EST4','EST5','EST6'});
%% to save
save ift estimatorData;
%% to run viewer
estimatorLogViewer('ift.mat');
Loading…
Cancel
Save