ecl_statistics Documentation

ecl_statistics

Common statistical structures and algorithms for control systems.

Embedded Control Library

    This group mostly contains classes relevant to the probabilistics of mobile robot slam.

    Include the following at the top of any translation unit that requires the ecl
    probabilistic tools.

Compiling & Linking

    Include the following at the top of any translation unit which
    requires this library:

    @code
    #include <ecl/statistics.hpp>

    // Statistics Classes
    using ecl::CovarianceEllipsoid;
    using ecl::CovarianceEllipsoid2f; // also 2d, 3f, 3d typedef variants
    @endcode

    You will also need to link to <i>-lecl_statistics</i>.

Usage

Covariance Ellipsoids

mplemented by the template class CovarianceEllipsoid - this takes two template parameters. The first is the float type used (usually float/double) and the second, the dimension of the ellipsoid to be determined.

Specialisations are enabled for 2 and 3 dimensional types only as we haven't had a need to develop a general implementation.

== Typedefs ==

Typedefs exist for the template class in the eigen style:

{{{ #!cplusplus using ecl::CovarianceEllipsoid2f; using ecl::CovarianceEllipsoid2d; using ecl::CovarianceEllipsoid3f; using ecl::CovarianceEllipsoid3d; }}}

== Usage ==

You typically feed the covariance ellipsoid with a positive definite symmetric matrix (eigen matrix). Take care entering the positive definite symmetric matrix - the class does not yet do checking to make sure it is positive definite symmetric.

You can either input the matrix via the constructor - in which case it will automatically calculate the ellipsoid properties, or pass it in later via the compute() method:

M << 3.0, 1.0, 1.0, 5.0; // must be a positive definite, symmetric matrix
// OR
ellipse.compute(M);
M << 3.0, 1.0, 1.0, 5.0;
// ellipse minor and major axis lengths
const Vector2d& lengths = ellipse.lengths();
double eigen_value_0 = lengths[0]*lengths[0];
// angle between x-axis and major axis of the ellipse
double angle = ellipse.rotation();
// values of the intercepts of the ellipse with x and y axes
const Vector2d& intercepts = ellipse.intercepts();
// the ellipse axes/covariance eigenvectors as column vectors in a matrix
const Matrix2d& axes = ellipse.axes();

The 3d version is similar, but will only calculate intercepts and axes respectively. Note that the axes are sorted (to ensure a right-handed co-ordinate system) and normalised.

double sigmaX(0.1);
double sigmaY(0.5);
double sigmaT(0.3);
P << sigmaX*sigmaX, 0, 0, 0, sigmaY*sigmaY, 0, 0, 0, sigmaT*sigmaT;
const Vector3d& lengths = ellipse.lengths();
double eigen_value_0 = lengths[0]*lengths[0];
const Matrix3d& axes = ellipse.axes();

Unit Tests

    - src/test/covariance_ellipsoids.cpp

ChangeLog

    - <b>Jan 10</b> : 3d ellipses via the ecl::CovarianceEllipsoid<double,3> solver.
    - <b>Nov 09</b> : 2d ellipses via the ecl::CovarianceEllipsoid<double,2> solver.
ecl::CovarianceEllipsoid2d
CovarianceEllipsoid< double, 2 > CovarianceEllipsoid2d
Convenience typedef for 2d covariance ellipsoids.
Definition: covariance_ellipsoid.hpp:526
Matrix2d
Matrix2< double > Matrix2d
Matrix3d
Matrix3< double > Matrix3d
Vector3d
Vector3< double > Vector3d
Vector2d
Vector2< double > Vector2d
ecl::CovarianceEllipsoid3d
CovarianceEllipsoid< double, 3 > CovarianceEllipsoid3d
Convenience typedef for 3d covariance ellipsoids.
Definition: covariance_ellipsoid.hpp:543
ecl::CovarianceEllipsoid< double, 2 >::compute
void compute(const ecl::linear_algebra::Matrix2d &M)
Computes the covariance ellipsoid for the specified matrix.
Definition: covariance_ellipsoid.cpp:146


ecl_statistics
Author(s): Daniel Stonier
autogenerated on Wed Mar 2 2022 00:16:31