Institut de Robòtica i Informàtica Industrial

PlotFilter

PURPOSE ^

(Re)plots a filter.

SYNOPSIS ^

function pf=PlotFilter(F,Parameters,varargin)

DESCRIPTION ^

 (Re)plots a filter.

 The information plotted is a trajectory and the estimation of the last
 robot's pose (in the form of an uncertainty ellipse around the robot's 
 pose)

 If only the filter F is given as parameter, the figure is cleared before
 plotting the filter information.
  
 If an additional paramter is given, it must be a plot structure as that
 returned by InitFilterPlot and then the plot is done on a already
 existing figure.

 See also InitFilterPlot.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function pf=PlotFilter(F,Parameters,varargin)
0002 % (Re)plots a filter.
0003 %
0004 % The information plotted is a trajectory and the estimation of the last
0005 % robot's pose (in the form of an uncertainty ellipse around the robot's
0006 % pose)
0007 %
0008 % If only the filter F is given as parameter, the figure is cleared before
0009 % plotting the filter information.
0010 %
0011 % If an additional paramter is given, it must be a plot structure as that
0012 % returned by InitFilterPlot and then the plot is done on a already
0013 % existing figure.
0014 %
0015 % See also InitFilterPlot.
0016 
0017   % varargin is used to set whether or not to plot on the top of an
0018   % existing figure.
0019 
0020   if (nargin==2)
0021     pf=InitFilterPlot(F,Parameters);
0022   else
0023     pf=varargin{1};
0024   end
0025   
0026   % display the loop closures
0027   for i=1:F.nLoops
0028     loop=F.loops{i};
0029     m1=GetPoseMean(F,loop.p1);
0030     m2=GetPoseMean(F,loop.p2);
0031     l=line([m1(1) m2(1)],[m1(2) m2(2)],'color',[0 0.75 0],'marker','none','markersize',6,'linewidth',3);
0032     uistack(l,'bottom');
0033   end
0034   
0035   % Plot from the 2nd state to the last one
0036   for state=2:F.nStates
0037     pf=UpdateFilterPlot(F,F.State2Step(state),pf,false);
0038   end
0039     
0040   % show everything
0041   drawnow;
0042


Institut de Robòtica i Informàtica Industrial

Generated on Fri 24-Jul-2009 12:32:50 by m2html © 2003