Public Member Functions | Private Attributes
ecl::CovarianceEllipsoid< float, 2 > Class Template Reference

Specialisation of covariance ellipsoids in two dimensions. More...

#include <covariance_ellipsoid.hpp>

List of all members.

Public Member Functions

const
ecl::linear_algebra::Matrix2f & 
axes ()
 Returns the ellipse axes/covariance eigen vectors.
void compute (const ecl::linear_algebra::Matrix2f &M)
 Computes the covariance ellipsoid for the specified matrix.
 CovarianceEllipsoid ()
 Default constructor, use with compute().
 CovarianceEllipsoid (const ecl::linear_algebra::Matrix2f &M)
 Automatically generates ellipsoid information at construction.
ecl::linear_algebra::Vector2f intercepts ()
 Specifies the intercepts of the ellipse with the cartesian axes.
const
ecl::linear_algebra::Vector2f & 
lengths ()
 Returns the precomputed ellipsoid minor/major axis lengths.
double rotation ()
 Calculates the rotation of the ellipse.
virtual ~CovarianceEllipsoid ()

Private Attributes

ecl::linear_algebra::Matrix2f ellipse_axes
ecl::linear_algebra::Vector2f ellipse_lengths

Detailed Description

template<>
class ecl::CovarianceEllipsoid< float, 2 >

Specialisation of covariance ellipsoids in two dimensions.

This creates ellipsoids for 2x2 covariance matrices, i.e. the usual sort for mobile robot navigation. It uses lovely dirty c-style code to work out the underlying eigen properties rather than Eigen's solver - tends to be a bit faster in only two dimensions.

Usage:

This class is also more conveniently typedef'd as CovarianceEllipsoid2f.

You can either instantiate directly through the constructor or by hand via the compute() method. Recomputing is also possible without having to construct an entirely new instance.

 CovarianceEllipsoid2f ellipsoid(M); // OR
 CovarianceEllipsoid2f ellipsoid_hand;
 ellipsoid_hand.compute(M);

Once generated, the ellipse properties can easily be extracted.

 Vector2f lengths = ellipsoid.lengths(); // axis lengths.
 float angle = ellipsoid.rotation(); // angle of rotation to the major axis

There are a couple more methods that can be accessed for more detailed information about the ellipse, but the above two are usually sufficient for drawing your own ellipses.

See also:
CovarianceEllipsoid.

Definition at line 99 of file covariance_ellipsoid.hpp.


Constructor & Destructor Documentation

Default constructor, use with compute().

This constructor does not do anything - you must use it together with the compute() function. Sometimes useful when using this class with containers.

Definition at line 38 of file covariance_ellipsoid.cpp.

ecl::CovarianceEllipsoid< float, 2 >::CovarianceEllipsoid ( const ecl::linear_algebra::Matrix2f &  M)

Automatically generates ellipsoid information at construction.

Using the specified input covariance matrix, this constructor automatically generates (indirectly calls compute()) the full ellipse information, making it instantly ready for use.

Parameters:
M: the input covariance matrix (must be symmetric positive definite).

Definition at line 43 of file covariance_ellipsoid.cpp.

virtual ecl::CovarianceEllipsoid< float, 2 >::~CovarianceEllipsoid ( ) [inline, virtual]

Definition at line 120 of file covariance_ellipsoid.hpp.


Member Function Documentation

const ecl::linear_algebra::Matrix2f& ecl::CovarianceEllipsoid< float, 2 >::axes ( ) [inline]

Returns the ellipse axes/covariance eigen vectors.

This returns the ellipse axes (aka covariance eigen vectors) as columns of a matrix.

Returns:
Matrix2d : the set of eigenvectors as column vectors in a matrix.

Definition at line 148 of file covariance_ellipsoid.hpp.

void ecl::CovarianceEllipsoid< float, 2 >::compute ( const ecl::linear_algebra::Matrix2f &  M)

Computes the covariance ellipsoid for the specified matrix.

This can either be called indirectly via the constructor or directly via this function. In either case, it resets the object and generates/computes the resulting ellipse from the specified input covariance matrix.

Parameters:
M: the input covariance matrix (must be symmetric positive definite).

Definition at line 46 of file covariance_ellipsoid.cpp.

Vector2f ecl::CovarianceEllipsoid< float, 2 >::intercepts ( )

Specifies the intercepts of the ellipse with the cartesian axes.

This determines the distance from the origin to the ellipse boundary in the directions of the usual cartesian axes. Note that the intercepts here are given as a two dimensional vector and this is not the (x,y) pair of an intercept itself.

Rather this is both the x and y magnitudes for which the full set of four intercepts can be generated. These magnitudes are the distances from the centre of the ellipse to the boundary of the ellipse in both the x and y directions.

Returns:
Vector2d : x and y-axis intercept distances from the origin.

Definition at line 98 of file covariance_ellipsoid.cpp.

const ecl::linear_algebra::Vector2f& ecl::CovarianceEllipsoid< float, 2 >::lengths ( ) [inline]

Returns the precomputed ellipsoid minor/major axis lengths.

Returns the precomputed ellipsoid minor/major axis lengths.

Returns:
Vector2d : the minor/major axis lengths.

Definition at line 140 of file covariance_ellipsoid.hpp.

double ecl::CovarianceEllipsoid< float, 2 >::rotation ( )

Calculates the rotation of the ellipse.

This determines the angle between the x axis and the major axis of the ellipse.

Returns:
double : the rotation angle.

Definition at line 94 of file covariance_ellipsoid.cpp.


Member Data Documentation

ecl::linear_algebra::Matrix2f ecl::CovarianceEllipsoid< float, 2 >::ellipse_axes [private]

Definition at line 180 of file covariance_ellipsoid.hpp.

ecl::linear_algebra::Vector2f ecl::CovarianceEllipsoid< float, 2 >::ellipse_lengths [private]

Definition at line 179 of file covariance_ellipsoid.hpp.


The documentation for this class was generated from the following files:


ecl_statistics
Author(s): Daniel Stonier (d.stonier@gmail.com)
autogenerated on Thu Jan 2 2014 11:12:17