getPURPOSEGeneric get function for filters.
SYNOPSISfunction out=get(F,field)
DESCRIPTIONGeneric get function for filters. Retives information from a filter. This basically returns the informations common to all filters. Possible fields to query are: - initialState: The Gaussian with the estimation of the initial pose of the robot. - nSteps: Simulation steps executed by the filter. - nStates: The number of poses in the trajectory estimated by the filter. In general we store one pose for each step but some filters (TRO filter) remove redundant poses. In this case we have less estates than steps. - dim: Dimensionality of the poses in the estimated trajectory. - covariances: Returns a cell array with the marginal covariances for each one of the poses stored in the filter. Note that different filters provide different covariance estimations. - crossCovariances: Retuns a cell array with the cross-covariances between all the poses stored in the filter and the current robot's pose. - loops: Cell array with all loops closed so far. - nLoops: The number of loops closed so far. CROSS-REFERENCE INFORMATIONThis function calls:
SOURCE CODE0001 function out=get(F,field) 0002 % Generic get function for filters. 0003 % 0004 % Retives information from a filter. This basically returns the 0005 % informations common to all filters. 0006 % 0007 % Possible fields to query are: 0008 % - initialState: The Gaussian with the estimation of the initial pose 0009 % of the robot. 0010 % - nSteps: Simulation steps executed by the filter. 0011 % - nStates: The number of poses in the trajectory estimated by the 0012 % filter. In general we store one pose for each step but some 0013 % filters (TRO filter) remove redundant poses. In this case 0014 % we have less estates than steps. 0015 % - dim: Dimensionality of the poses in the estimated trajectory. 0016 % - covariances: Returns a cell array with the marginal covariances for 0017 % each one of the poses stored in the filter. Note that different 0018 % filters provide different covariance estimations. 0019 % - crossCovariances: Retuns a cell array with the cross-covariances 0020 % between all the poses stored in the filter and the current 0021 % robot's pose. 0022 % - loops: Cell array with all loops closed so far. 0023 % - nLoops: The number of loops closed so far. 0024 0025 switch field 0026 case 'initialState' 0027 out=F.initEstimation; 0028 0029 case 'nStates' 0030 out=F.nStates; 0031 0032 case 'nSteps' 0033 out=F.nSteps; 0034 0035 case 'dim' 0036 out=F.dim; 0037 0038 case 'covariances' 0039 out=cell(1,F.nStates); 0040 for i=1:n 0041 out{i}=get(GetPoseEstimation(F,F.State2Step(F,i)),'covariance'); 0042 end 0043 0044 case 'crossCovariances' 0045 out=zeros(F.nStates*F.dim,F.dim); 0046 for i=1:n 0047 ind=(i-1)*dim+1:i*dim; 0048 out(ind)=GetCrossCovarianceWithPose(F,F.State2Step(F,i)); 0049 end 0050 0051 case 'loops' 0052 out=F.loops; 0053 0054 case 'nLoops' 0055 out=size(F.loops,2); 0056 0057 otherwise 0058 error('Unknown field in Filter get'); 0059 end |