%
% PURPOSE: Plot horizontal plane data.
%
% LOG:     22 Feb 2021 rsm.
%
lstr={};
lrDatPtr=[];
lrUsblPtr=[];

co = [0 0 1;
      0 0.5 0;
      1 0 0;
      0 0.75 0.75;
      0.75 0 0.75;
      0.75 0.75 0;
      0.25 0.25 0.25];
set(groot,'defaultAxesColorOrder',co)
%global titleStr;
titleStr = [' Data Set: ', replace(DirName2,'_','-'), ' / ', replace(filepath,'_','-')];
if exist( 'position' ) ~= 1
  MonitorPositions = get(0,'MonitorPositions');
  position = MonitorPositions(end,:);
  npposition(1:2) = position(1:2) + round([position(3)*.02 position(4)*.04]);
  npposition(3:4) = round([position(3)*.95 position(4)*.90]);
  position = npposition;
end
if exist( 'lrVelFigPtr' ) ~= 1
  lrVelFigPtr= figure;
  set( lrVelFigPtr, 'Name', 'LR Velocity Plane', 'DeleteFcn', 'clear lrVelFigPtr' );
  set(gcf,'position',position)
  set(gcf,'colormap',jet);
  if(exist('fontsize1')) 
    lrNavFontsize=fontsize1;
  else
    lrNavFontsize=20;
  end
  lrNavFontweight='normal';
  set(gca,'fontsize',lrNavFontsize,'fontweigh',lrNavFontweight)
  set(gcf,'defaultaxesfontsize',lrNavFontsize,'defaulttextfontsize', ...
      lrNavFontsize)
  lrNavAxesPtr = gca;
else
 figure(lrVelFigPtr);
end

vehicleDataAvail = 0;
%
% Check to see if we've got vehicle data.  If so, plot it.
if( exist( 'data' ) && isfield( data, 'depth') )
  vehicleDataAvail = 1;
  fprintf('Plotting vehicle data.\n');

  subplot(3,1,1)
  plot(data.platform_velocity_wrt_ground.time, ...
       data.platform_velocity_wrt_ground.value(1,:));
  hold on
  grid on
  ylabel('m/s')
  dynamicDateTicks

  
  subplot(3,1,2)
  plot(data.platform_velocity_wrt_ground.time, ...
       data.platform_velocity_wrt_ground.value(2,:));
  hold on
  grid on
  ylabel('m/s')
  dynamicDateTicks

  
  subplot(3,1,3)
  plot(data.platform_velocity_wrt_ground.time, ...
       data.platform_velocity_wrt_ground.value(3,:));
  hold on
  grid on
  ylabel('m/s')
  dynamicDateTicks


  linkaxes(get(gcf,'children'),'x')


else
  fprintf('No data found.  Assuming orignal vehicle data (not replay) is in struct ''data''.\n');
  return
end














