Institut de Robòtica i Informàtica Industrial

get

PURPOSE ^

Get function for Gaussians.

SYNOPSIS ^

function out=get(G,field)

DESCRIPTION ^

 Get function for Gaussians.

 Returns the information associated with a Gaussian
 Possible queries are
      - dim: The dimensionality of the space where the Gaussian is defined
      - mean:  The mean vector.
      - covariance: The covariance matrix.
      - invCovariance: The inverse of the covariance matrix.
      - volume: The volume of the ellipsoid defined from the covariance matrix.
      - normalizationFactor: The normalization factor for a Gaussian (the constant
        that multiplies the exponential defining the Gaussian
        distribution).
      - ellipse: Returns a line representing the iso-countour of the
        ellipse defined from the mean and covariance at a 90% confidence
        value. For higher-dimensional Gaussians, we marginalize and only
        use the first 2 components of the Gaussians.

CROSS-REFERENCE INFORMATION ^

This function calls:
  • size Number of poses in a trajectory.
  • size Size of the state estimated in the filter
  • size Size (rows/columns) of an interval matrix.
  • size Number of parameters of the pose.
  • size Number of readings stored in the Sensor.
This function is called by:

SOURCE CODE ^

0001 function out=get(G,field)
0002 % Get function for Gaussians.
0003 %
0004 % Returns the information associated with a Gaussian
0005 % Possible queries are
0006 %      - dim: The dimensionality of the space where the Gaussian is defined
0007 %      - mean:  The mean vector.
0008 %      - covariance: The covariance matrix.
0009 %      - invCovariance: The inverse of the covariance matrix.
0010 %      - volume: The volume of the ellipsoid defined from the covariance matrix.
0011 %      - normalizationFactor: The normalization factor for a Gaussian (the constant
0012 %        that multiplies the exponential defining the Gaussian
0013 %        distribution).
0014 %      - ellipse: Returns a line representing the iso-countour of the
0015 %        ellipse defined from the mean and covariance at a 90% confidence
0016 %        value. For higher-dimensional Gaussians, we marginalize and only
0017 %        use the first 2 components of the Gaussians.
0018 
0019   switch field
0020     case 'dim'
0021       out=G.dim;
0022     case 'mean'
0023       out=G.m;
0024     case 'covariance'
0025       out=G.S;
0026     case 'invCovariance'
0027       out=G.iS;
0028     case 'volume'
0029       out=G.d;
0030     case 'normalizationFactor'
0031       out=G.ct;
0032     case 'ellipse'
0033       S2d=G.S(1:2,1:2);
0034       % For 2 dim, a Xi squared distribution gives that the
0035       % 90% confidence level is obtained at 2.1459
0036       R=chol(S2d);
0037       y = 2.1459*[cos(0:0.1:2*pi);sin(0:0.1:2*pi)];
0038       el=R*y;
0039       out = [el el(:,1)]+repmat(G.m(1:2),1,size(el,2)+1);
0040       
0041     otherwise
0042       error('Unknow field in Gaussian get');
0043   end


Institut de Robòtica i Informàtica Industrial

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