g2o
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
g2o::VertexEllipse Class Reference

string ellipse to be attached to a vertex More...

#include <vertex_ellipse.h>

Inheritance diagram for g2o::VertexEllipse:
Inheritance graph
[legend]
Collaboration diagram for g2o::VertexEllipse:
Collaboration graph
[legend]

Public Types

typedef std::vector< Vector2F, Eigen::aligned_allocator< Vector2F > > myVector2fVector
 

Public Member Functions

 VertexEllipse ()
 
 ~VertexEllipse ()
 
virtual bool write (std::ostream &os) const
 write the data to a stream More...
 
virtual bool read (std::istream &is)
 read the data from a stream More...
 
const Matrix3Fcovariance ()
 
void setCovariance (Matrix3F &c)
 
const Matrix2FU ()
 
const Vector2FsingularValues ()
 
const myVector2fVectormatchingVertices ()
 
void addMatchingVertex (float x, float y)
 
void clearMatchingVertices ()
 
const std::vector< int > & matchingVerticesIDs ()
 
void addMatchingVertexID (int id)
 
void clearMatchingVerticesIDs ()
 
- Public Member Functions inherited from g2o::RobotData
 RobotData ()
 
virtual ~RobotData ()
 
double timestamp () const
 
void setTimestamp (double ts)
 
double loggerTimestamp () const
 
void setLoggerTimestamp (double ts)
 
const std::string & tag () const
 
void setTag (const std::string &tag)
 
const std::string & hostname () const
 
void setHostname (const std::string &hostname)
 
- Public Member Functions inherited from g2o::HyperGraph::Data
 Data ()
 
 ~Data ()
 
virtual HyperGraph::HyperGraphElementType elementType () const
 
const Datanext () const
 
Datanext ()
 
void setNext (Data *next_)
 
DataContainerdataContainer ()
 
const DataContainerdataContainer () const
 
void setDataContainer (DataContainer *dataContainer_)
 
- Public Member Functions inherited from g2o::HyperGraph::HyperGraphElement
virtual ~HyperGraphElement ()
 
HyperGraphElementclone () const
 

Public Attributes

 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 

Protected Member Functions

void _updateSVD () const
 

Protected Attributes

Matrix3F _covariance
 
Matrix2F _UMatrix
 
Vector2F _singularValues
 
std::vector< int > _matchingVerticesIDs
 
myVector2fVector _matchingVertices
 
- Protected Attributes inherited from g2o::RobotData
double _timestamp
 timestamp when the measurement was generated More...
 
double _loggerTimestamp
 timestamp when the measurement was recorded More...
 
std::string _tag
 string tag (FLASER, ROBOTLASER, ODOM..) of the line in the log More...
 
std::string _hostname
 name of the computer/robot generating the data More...
 
- Protected Attributes inherited from g2o::HyperGraph::Data
Data_next
 
DataContainer_dataContainer
 

Detailed Description

string ellipse to be attached to a vertex

Definition at line 39 of file vertex_ellipse.h.

Member Typedef Documentation

typedef std::vector<Vector2F, Eigen::aligned_allocator<Vector2F> > g2o::VertexEllipse::myVector2fVector

Definition at line 42 of file vertex_ellipse.h.

Constructor & Destructor Documentation

g2o::VertexEllipse::VertexEllipse ( )

Definition at line 45 of file vertex_ellipse.cpp.

References _covariance, _singularValues, and _UMatrix.

45  : RobotData()
46  {
47  _covariance = Matrix3F::Zero();
48  _UMatrix = Matrix2F::Zero();
49  _singularValues = Vector2F::Zero();
50  }
Vector2F _singularValues
g2o::VertexEllipse::~VertexEllipse ( )

Definition at line 52 of file vertex_ellipse.cpp.

53  {
54  }

Member Function Documentation

void g2o::VertexEllipse::_updateSVD ( ) const
protected

Definition at line 56 of file vertex_ellipse.cpp.

References _covariance, _singularValues, and _UMatrix.

Referenced by read().

56  {
57  Eigen::SelfAdjointEigenSolver<Matrix2F> eigenSolver(_covariance.block<2,2>(0,0));
58  _UMatrix = eigenSolver.eigenvectors();
59  _singularValues = eigenSolver.eigenvalues();
60 
61  }
Vector2F _singularValues
void g2o::VertexEllipse::addMatchingVertex ( float  x,
float  y 
)
inline

Definition at line 57 of file vertex_ellipse.h.

Referenced by read().

57  {
58  Vector2F v(x,y);
59  _matchingVertices.push_back(v);
60  }
myVector2fVector _matchingVertices
Eigen::Matrix< float, 2, 1, Eigen::ColMajor > Vector2F
Definition: eigen_types.h:40
void g2o::VertexEllipse::addMatchingVertexID ( int  id)
inline

Definition at line 65 of file vertex_ellipse.h.

65  {
66  _matchingVerticesIDs.push_back(id);
67  }
std::vector< int > _matchingVerticesIDs
void g2o::VertexEllipse::clearMatchingVertices ( )
inline

Definition at line 62 of file vertex_ellipse.h.

62 {_matchingVertices.clear();}
myVector2fVector _matchingVertices
void g2o::VertexEllipse::clearMatchingVerticesIDs ( )
inline

Definition at line 68 of file vertex_ellipse.h.

68 {_matchingVerticesIDs.clear();}
std::vector< int > _matchingVerticesIDs
const Matrix3F& g2o::VertexEllipse::covariance ( )
inline

Definition at line 51 of file vertex_ellipse.h.

Referenced by write().

51 {return _covariance;}
const myVector2fVector& g2o::VertexEllipse::matchingVertices ( )
inline

Definition at line 56 of file vertex_ellipse.h.

Referenced by write().

56 {return _matchingVertices;}
myVector2fVector _matchingVertices
const std::vector<int>& g2o::VertexEllipse::matchingVerticesIDs ( )
inline

Definition at line 64 of file vertex_ellipse.h.

64 {return _matchingVerticesIDs;}
std::vector< int > _matchingVerticesIDs
bool g2o::VertexEllipse::read ( std::istream &  is)
virtual

read the data from a stream

Implements g2o::HyperGraph::Data.

Definition at line 63 of file vertex_ellipse.cpp.

References _covariance, _updateSVD(), and addMatchingVertex().

64  {
65  float cxx, cxy, cxt, cyy, cyt, ctt;
66  is >> cxx >> cxy >> cxt >> cyy >> cyt >> ctt;
67  _covariance(0,0) = cxx;
68  _covariance(0,1) = cxy;
69  _covariance(0,2) = cxt;
70  _covariance(1,0) = cxy;
71  _covariance(1,1) = cyy;
72  _covariance(1,2) = cyt;
73  _covariance(2,0) = cxt;
74  _covariance(2,1) = cyt;
75  _covariance(2,2) = ctt;
76 
77  _updateSVD();
78 
79  int size;
80  is >> size;
81  for (int i =0; i<size; i++){
82  float x, y;
83  is >> x >> y;
84  addMatchingVertex(x,y);
85  }
86 
87  return true;
88  }
void _updateSVD() const
void addMatchingVertex(float x, float y)
void g2o::VertexEllipse::setCovariance ( Matrix3F c)
inline

Definition at line 52 of file vertex_ellipse.h.

52 { _covariance = c; _updateSVD();}
void _updateSVD() const
const Vector2F& g2o::VertexEllipse::singularValues ( )
inline

Definition at line 54 of file vertex_ellipse.h.

Referenced by write().

54 {return _singularValues;}
Vector2F _singularValues
const Matrix2F& g2o::VertexEllipse::U ( )
inline

Definition at line 53 of file vertex_ellipse.h.

Referenced by write().

53 {return _UMatrix;}
bool g2o::VertexEllipse::write ( std::ostream &  os) const
virtual

write the data to a stream

Implements g2o::HyperGraph::Data.

Definition at line 90 of file vertex_ellipse.cpp.

References _covariance, _matchingVertices, covariance(), M_PI, matchingVertices(), g2o::DrawAction::refreshPropertyPtrs(), singularValues(), and U().

91  {
92  os << _covariance(0,0) << " " << _covariance(0,1) << " " << _covariance(0,2) << " "
93  << _covariance(1,1) << " " << _covariance(1,2) << " " << _covariance(2,2) << " ";
94 
95  os << _matchingVertices.size() << " " ;
96  for (size_t i=0 ; i< _matchingVertices.size(); i++){
97  os << _matchingVertices[i].x() << " " << _matchingVertices[i].y() << " ";
98  }
99 
100  return os.good();
101  }
myVector2fVector _matchingVertices

Member Data Documentation

Matrix3F g2o::VertexEllipse::_covariance
protected

Definition at line 72 of file vertex_ellipse.h.

Referenced by _updateSVD(), read(), VertexEllipse(), and write().

myVector2fVector g2o::VertexEllipse::_matchingVertices
protected

Definition at line 76 of file vertex_ellipse.h.

Referenced by write().

std::vector<int> g2o::VertexEllipse::_matchingVerticesIDs
protected

Definition at line 75 of file vertex_ellipse.h.

Vector2F g2o::VertexEllipse::_singularValues
mutableprotected

Definition at line 74 of file vertex_ellipse.h.

Referenced by _updateSVD(), and VertexEllipse().

Matrix2F g2o::VertexEllipse::_UMatrix
mutableprotected

Definition at line 73 of file vertex_ellipse.h.

Referenced by _updateSVD(), and VertexEllipse().

g2o::VertexEllipse::EIGEN_MAKE_ALIGNED_OPERATOR_NEW

Definition at line 44 of file vertex_ellipse.h.


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