g2o
Loading...
Searching...
No Matches
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

using myVector2fVector = std::vector< Vector2F >
 

Public Member Functions

 VertexEllipse ()
 
 ~VertexEllipse ()
 
virtual bool write (std::ostream &os) const
 write the data to a stream
 
virtual bool read (std::istream &is)
 read the data from a stream
 
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 ()
 

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
 
double _loggerTimestamp
 timestamp when the measurement was recorded
 
std::string _tag
 string tag (FLASER, ROBOTLASER, ODOM..) of the line in the log
 
std::string _hostname
 name of the computer/robot generating the data
 
- 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

◆ myVector2fVector

Definition at line 41 of file vertex_ellipse.h.

Constructor & Destructor Documentation

◆ VertexEllipse()

g2o::VertexEllipse::VertexEllipse ( )

Definition at line 45 of file vertex_ellipse.cpp.

46 : RobotData(),
47 _covariance(Matrix3F::Zero()),
48 _UMatrix(Matrix2F::Zero()),
49 _singularValues(Vector2F::Zero()) {}

◆ ~VertexEllipse()

g2o::VertexEllipse::~VertexEllipse ( )

Definition at line 51 of file vertex_ellipse.cpp.

51{}

Member Function Documentation

◆ _updateSVD()

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

Definition at line 53 of file vertex_ellipse.cpp.

53 {
54 Eigen::SelfAdjointEigenSolver<Matrix2F> eigenSolver(
55 _covariance.block<2, 2>(0, 0));
56 _UMatrix = eigenSolver.eigenvectors();
57 _singularValues = eigenSolver.eigenvalues();
58}

References _covariance, _singularValues, and _UMatrix.

Referenced by read().

◆ addMatchingVertex()

void g2o::VertexEllipse::addMatchingVertex ( float  x,
float  y 
)
inline

Definition at line 60 of file vertex_ellipse.h.

60 {
61 Vector2F v(x, y);
62 _matchingVertices.push_back(v);
63 }
myVector2fVector _matchingVertices
Eigen::Matrix< float, 2, 1, Eigen::ColMajor > Vector2F
Definition eigen_types.h:43

Referenced by read().

◆ addMatchingVertexID()

void g2o::VertexEllipse::addMatchingVertexID ( int  id)
inline

Definition at line 68 of file vertex_ellipse.h.

68{ _matchingVerticesIDs.push_back(id); }
std::vector< int > _matchingVerticesIDs

◆ clearMatchingVertices()

void g2o::VertexEllipse::clearMatchingVertices ( )
inline

Definition at line 65 of file vertex_ellipse.h.

65{ _matchingVertices.clear(); }

◆ clearMatchingVerticesIDs()

void g2o::VertexEllipse::clearMatchingVerticesIDs ( )
inline

Definition at line 69 of file vertex_ellipse.h.

69{ _matchingVerticesIDs.clear(); }

◆ covariance()

const Matrix3F & g2o::VertexEllipse::covariance ( )
inline

Definition at line 51 of file vertex_ellipse.h.

51{ return _covariance; }

◆ matchingVertices()

const myVector2fVector & g2o::VertexEllipse::matchingVertices ( )
inline

Definition at line 59 of file vertex_ellipse.h.

59{ return _matchingVertices; }

◆ matchingVerticesIDs()

const std::vector< int > & g2o::VertexEllipse::matchingVerticesIDs ( )
inline

Definition at line 67 of file vertex_ellipse.h.

67{ return _matchingVerticesIDs; }

◆ read()

bool g2o::VertexEllipse::read ( std::istream &  is)
virtual

read the data from a stream

Implements g2o::HyperGraph::Data.

Definition at line 60 of file vertex_ellipse.cpp.

60 {
61 float cxx, cxy, cxt, cyy, cyt, ctt;
62 is >> cxx >> cxy >> cxt >> cyy >> cyt >> ctt;
63 _covariance(0, 0) = cxx;
64 _covariance(0, 1) = cxy;
65 _covariance(0, 2) = cxt;
66 _covariance(1, 0) = cxy;
67 _covariance(1, 1) = cyy;
68 _covariance(1, 2) = cyt;
69 _covariance(2, 0) = cxt;
70 _covariance(2, 1) = cyt;
71 _covariance(2, 2) = ctt;
72
73 _updateSVD();
74
75 int size;
76 is >> size;
77 for (int i = 0; i < size; i++) {
78 float x, y;
79 is >> x >> y;
81 }
82
83 return true;
84}
void _updateSVD() const
void addMatchingVertex(float x, float y)

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

◆ setCovariance()

void g2o::VertexEllipse::setCovariance ( Matrix3F c)
inline

Definition at line 52 of file vertex_ellipse.h.

52 {
53 _covariance = c;
54 _updateSVD();
55 }

◆ singularValues()

const Vector2F & g2o::VertexEllipse::singularValues ( )
inline

Definition at line 57 of file vertex_ellipse.h.

57{ return _singularValues; }

◆ U()

const Matrix2F & g2o::VertexEllipse::U ( )
inline

Definition at line 56 of file vertex_ellipse.h.

56{ return _UMatrix; }

◆ write()

bool g2o::VertexEllipse::write ( std::ostream &  os) const
virtual

write the data to a stream

Implements g2o::HyperGraph::Data.

Definition at line 86 of file vertex_ellipse.cpp.

86 {
87 os << _covariance(0, 0) << " " << _covariance(0, 1) << " "
88 << _covariance(0, 2) << " " << _covariance(1, 1) << " "
89 << _covariance(1, 2) << " " << _covariance(2, 2) << " ";
90
91 os << _matchingVertices.size() << " ";
92 for (size_t i = 0; i < _matchingVertices.size(); i++) {
93 os << _matchingVertices[i].x() << " " << _matchingVertices[i].y() << " ";
94 }
95
96 return os.good();
97}

References _covariance, and _matchingVertices.

Member Data Documentation

◆ _covariance

Matrix3F g2o::VertexEllipse::_covariance
protected

Definition at line 73 of file vertex_ellipse.h.

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

◆ _matchingVertices

myVector2fVector g2o::VertexEllipse::_matchingVertices
protected

Definition at line 77 of file vertex_ellipse.h.

Referenced by write().

◆ _matchingVerticesIDs

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

Definition at line 76 of file vertex_ellipse.h.

◆ _singularValues

Vector2F g2o::VertexEllipse::_singularValues
mutableprotected

Definition at line 75 of file vertex_ellipse.h.

Referenced by _updateSVD().

◆ _UMatrix

Matrix2F g2o::VertexEllipse::_UMatrix
mutableprotected

Definition at line 74 of file vertex_ellipse.h.

Referenced by _updateSVD().

◆ EIGEN_MAKE_ALIGNED_OPERATOR_NEW

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: