vicon
Public Member Functions | Protected Attributes | List of all members
vicon::ViconUncertainty< _EigenMatrixType > Class Template Reference

#include <ViconUncertainty.hpp>

Public Member Functions

 ViconUncertainty (size_t dimension=0)
 
void push (const _EigenMatrixType &value)
 
_EigenMatrixType getMean ()
 
_EigenMatrixType getVariance ()
 
_EigenMatrixType getStdDev ()
 
size_t size ()
 
size_t capacity ()
 

Protected Attributes

size_t dimension
 
boost::circular_buffer< _EigenMatrixType > data
 

Detailed Description

template<typename _EigenMatrixType>
class vicon::ViconUncertainty< _EigenMatrixType >

Definition at line 12 of file ViconUncertainty.hpp.

Constructor & Destructor Documentation

◆ ViconUncertainty()

template<typename _EigenMatrixType >
vicon::ViconUncertainty< _EigenMatrixType >::ViconUncertainty ( size_t  dimension = 0)
inline

Definition at line 20 of file ViconUncertainty.hpp.

21  {
22  this->dimension = dimension;
23  data = boost::circular_buffer< _EigenMatrixType >(this->dimension);
24  }
boost::circular_buffer< _EigenMatrixType > data

Member Function Documentation

◆ capacity()

template<typename _EigenMatrixType >
size_t vicon::ViconUncertainty< _EigenMatrixType >::capacity ( )
inline

Definition at line 81 of file ViconUncertainty.hpp.

82  {
83  return data.capacity();
84  }
boost::circular_buffer< _EigenMatrixType > data

◆ getMean()

template<typename _EigenMatrixType >
_EigenMatrixType vicon::ViconUncertainty< _EigenMatrixType >::getMean ( )
inline

Definition at line 36 of file ViconUncertainty.hpp.

37  {
38  _EigenMatrixType sum;
39  sum.setZero();
40 
41  if (this->dimension > 0)
42  {
43  for(register unsigned int i=0; i<data.size(); ++i)
44  {
45  sum += data[i];
46  }
47  }
48  return sum/data.size();
49  }
boost::circular_buffer< _EigenMatrixType > data

◆ getStdDev()

template<typename _EigenMatrixType >
_EigenMatrixType vicon::ViconUncertainty< _EigenMatrixType >::getStdDev ( )
inline

Definition at line 68 of file ViconUncertainty.hpp.

69  {
70  _EigenMatrixType variance = getVariance();
71  Eigen::LLT< _EigenMatrixType > lltOfVar (variance);
72 
73  return variance.matrixL();
74  }
_EigenMatrixType getVariance()

◆ getVariance()

template<typename _EigenMatrixType >
_EigenMatrixType vicon::ViconUncertainty< _EigenMatrixType >::getVariance ( )
inline

Definition at line 51 of file ViconUncertainty.hpp.

52  {
53  _EigenMatrixType mean = getMean();
54  _EigenMatrixType temp;
55  temp.setZero();
56 
57  if (this->dimension > 0)
58  {
59  for(register unsigned int i=0; i<data.size(); ++i)
60  {
61  temp += (mean - data[i]) * (mean - data[i]);
62  }
63 
64  }
65  return temp/data.size();
66  }
boost::circular_buffer< _EigenMatrixType > data
_EigenMatrixType getMean()

◆ push()

template<typename _EigenMatrixType >
void vicon::ViconUncertainty< _EigenMatrixType >::push ( const _EigenMatrixType &  value)
inline

Definition at line 27 of file ViconUncertainty.hpp.

28  {
29  if (this->dimension > 0)
30  {
31  data.push_front(value);
32  }
33  }
boost::circular_buffer< _EigenMatrixType > data

◆ size()

template<typename _EigenMatrixType >
size_t vicon::ViconUncertainty< _EigenMatrixType >::size ( )
inline

Definition at line 76 of file ViconUncertainty.hpp.

77  {
78  return data.size();
79  }
boost::circular_buffer< _EigenMatrixType > data

Member Data Documentation

◆ data

template<typename _EigenMatrixType >
boost::circular_buffer< _EigenMatrixType > vicon::ViconUncertainty< _EigenMatrixType >::data
protected

Definition at line 16 of file ViconUncertainty.hpp.

◆ dimension

template<typename _EigenMatrixType >
size_t vicon::ViconUncertainty< _EigenMatrixType >::dimension
protected

Definition at line 15 of file ViconUncertainty.hpp.


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