g2o
Loading...
Searching...
No Matches
g2o::VertexSE2 Class Reference

2D pose Vertex, (x,y,theta) More...

#include <vertex_se2.h>

Inheritance diagram for g2o::VertexSE2:
Collaboration diagram for g2o::VertexSE2:

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW VertexSE2 ()
virtual void setToOriginImpl ()
 sets the node to the origin (used in the multilevel stuff)
virtual void oplusImpl (const double *update)
virtual bool setEstimateDataImpl (const double *est)
virtual bool getEstimateData (double *est) const
virtual int estimateDimension () const
virtual bool setMinimalEstimateDataImpl (const double *est)
virtual bool getMinimalEstimateData (double *est) const
virtual int minimalEstimateDimension () const
virtual bool read (std::istream &is)
 read the vertex from a stream, i.e., the internal state of the vertex
virtual bool write (std::ostream &os) const
 write the vertex to a stream
Public Member Functions inherited from g2o::BaseVertex< 3, SE2 >
 BaseVertex ()
BaseVertex & operator= (const BaseVertex &)=delete
virtual const double & hessian (int i, int j) const
 get the element from the hessian matrix
virtual double hessianDeterminant () const
virtual double * hessianData ()
virtual void mapHessianMemory (double *d)
virtual int copyB (double *b_) const
virtual const double & b (int i) const
 get the b vector element
virtual double * bData ()
 return a pointer to the b vector associated with this vertex
virtual void clearQuadraticForm ()
virtual double solveDirect (double lambda=0)
HessianBlockType & A ()
 return the hessian block associated with the vertex
virtual void push ()
 backup the position of the vertex to a stack
virtual void pop ()
virtual void discardTop ()
virtual int stackSize () const
 return the stack size
const EstimateType & estimate () const
 return the current estimate of the vertex
void setEstimate (const EstimateType &et)
 set the estimate for the vertex also calls updateCache()
Public Member Functions inherited from g2o::OptimizableGraph::Vertex
 Vertex ()
virtual ~Vertex ()
void setToOrigin ()
 sets the node to the origin (used in the multilevel stuff)
virtual double & hessian (int i, int j)=0
virtual double & b (int i)=0
bool setEstimateData (const double *estimate)
bool setEstimateData (const std::vector< double > &estimate)
template<typename Derived>
bool setEstimateData (const Eigen::MatrixBase< Derived > &estimate)
virtual bool getEstimateData (std::vector< double > &estimate) const
template<typename Derived>
bool getEstimateData (Eigen::MatrixBase< Derived > &estimate) const
bool setMinimalEstimateData (const double *estimate)
bool setMinimalEstimateData (const std::vector< double > &estimate)
template<typename Derived>
bool setMinimalEstimateData (const Eigen::MatrixBase< Derived > &estimate)
virtual bool getMinimalEstimateData (std::vector< double > &estimate) const
template<typename Derived>
bool getMinimalEstimateData (Eigen::MatrixBase< Derived > &estimate) const
void oplus (const double *v)
int hessianIndex () const
int G2O_ATTRIBUTE_DEPRECATED (tempIndex() const)
void setHessianIndex (int ti)
 set the temporary index of the vertex in the parameter blocks
void G2O_ATTRIBUTE_DEPRECATED (setTempIndex(int ti))
bool fixed () const
 true => this node is fixed during the optimization
void setFixed (bool fixed)
 true => this node should be considered fixed during the optimization
bool marginalized () const
 true => this node is marginalized out during the optimization
void setMarginalized (bool marginalized)
 true => this node should be marginalized out during the optimization
int dimension () const
 dimension of the estimated state belonging to this node
virtual void setId (int id)
void setColInHessian (int c)
 set the row of this vertex in the Hessian
int colInHessian () const
 get the row of this vertex in the Hessian
const OptimizableGraph * graph () const
OptimizableGraph * graph ()
void lockQuadraticForm ()
void unlockQuadraticForm ()
virtual void updateCache ()
CacheContainer * cacheContainer ()
Public Member Functions inherited from g2o::HyperGraph::Vertex
 Vertex (int id=InvalidId)
 creates a vertex having an ID specified by the argument
int id () const
 returns the id
const EdgeSet & edges () const
 returns the set of hyper-edges that are leaving/entering in this vertex
EdgeSet & edges ()
 returns the set of hyper-edges that are leaving/entering in this vertex
virtual HyperGraphElementType elementType () const
Public Member Functions inherited from g2o::HyperGraph::HyperGraphElement
virtual ~HyperGraphElement ()
Public Member Functions inherited from g2o::HyperGraph::DataContainer
 DataContainer ()
virtual ~DataContainer ()
const Data * userData () const
 the user data associated with this vertex
Data * userData ()
void setUserData (Data *obs)
void addUserData (Data *obs)

Additional Inherited Members

Public Types inherited from g2o::BaseVertex< 3, SE2 >
using EstimateType
using BackupStackType
using HessianBlockType
Static Public Attributes inherited from g2o::BaseVertex< 3, SE2 >
static const int Dimension
 dimension of the estimate (minimal) in the manifold space
Protected Attributes inherited from g2o::BaseVertex< 3, SE2 >
HessianBlockType _hessian
Eigen::Matrix< double, D, 1, Eigen::ColMajor > _b
EstimateType _estimate
BackupStackType _backup
Protected Attributes inherited from g2o::OptimizableGraph::Vertex
OptimizableGraph * _graph
Data * _userData
int _hessianIndex
bool _fixed
bool _marginalized
int _dimension
int _colInHessian
OpenMPMutex _quadraticFormMutex
CacheContainer * _cacheContainer
Protected Attributes inherited from g2o::HyperGraph::Vertex
int _id
EdgeSet _edges
Protected Attributes inherited from g2o::HyperGraph::DataContainer
Data * _userData

Detailed Description

2D pose Vertex, (x,y,theta)

Definition at line 41 of file vertex_se2.h.

Constructor & Destructor Documentation

◆ VertexSE2()

g2o::VertexSE2::VertexSE2 ( )

Member Function Documentation

◆ estimateDimension()

virtual int g2o::VertexSE2::estimateDimension ( ) const
inlinevirtual

returns the dimension of the extended representation used by get/setEstimate(double*) -1 if it is not supported

Reimplemented from g2o::OptimizableGraph::Vertex.

Definition at line 67 of file vertex_se2.h.

67{ return 3; }

◆ getEstimateData()

virtual bool g2o::VertexSE2::getEstimateData ( double * estimate) const
inlinevirtual

writes the estimater to an array of double

Returns
true on success

Reimplemented from g2o::OptimizableGraph::Vertex.

Definition at line 61 of file vertex_se2.h.

61 {
62 Eigen::Map<Vector3> v(est);
63 v = _estimate.toVector();
64 return true;
65 }

References g2o::BaseVertex< 3, SE2 >::_estimate.

Referenced by getMinimalEstimateData().

◆ getMinimalEstimateData()

virtual bool g2o::VertexSE2::getMinimalEstimateData ( double * estimate) const
inlinevirtual

writes the estimate to an array of double

Returns
true on success

Reimplemented from g2o::OptimizableGraph::Vertex.

Definition at line 73 of file vertex_se2.h.

73 {
74 return getEstimateData(est);
75 }
virtual bool getEstimateData(double *est) const
Definition vertex_se2.h:61

References getEstimateData().

◆ minimalEstimateDimension()

virtual int g2o::VertexSE2::minimalEstimateDimension ( ) const
inlinevirtual

returns the dimension of the extended representation used by get/setEstimate(double*) -1 if it is not supported

Reimplemented from g2o::OptimizableGraph::Vertex.

Definition at line 77 of file vertex_se2.h.

77{ return 3; }

◆ oplusImpl()

virtual void g2o::VertexSE2::oplusImpl ( const double * v)
inlinevirtual

update the position of the node from the parameters in v. Implement in your class!

Implements g2o::OptimizableGraph::Vertex.

Reimplemented in g2o::OnlineVertexSE2.

Definition at line 48 of file vertex_se2.h.

48 {
49 Vector2 t = _estimate.translation();
50 t += Eigen::Map<const Vector2>(update);
51 double angle = normalize_theta(_estimate.rotation().angle() + update[2]);
52 _estimate.setTranslation(t);
53 _estimate.setRotation(Rotation2D(angle));
54 }
double normalize_theta(double theta)
Definition misc.h:103
VectorN< 2 > Vector2
Definition eigen_types.h:50
Eigen::Rotation2D< double > Rotation2D
Definition eigen_types.h:80

References g2o::BaseVertex< 3, SE2 >::_estimate, and g2o::normalize_theta().

Referenced by g2o::OnlineVertexSE2::oplusImpl().

◆ read()

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

read the vertex from a stream, i.e., the internal state of the vertex

Implements g2o::OptimizableGraph::Vertex.

Definition at line 40 of file vertex_se2.cpp.

40 {
41 Vector3 p;
42 bool state = internal::readVector(is, p);
43 setEstimate(p);
44 return state;
45}
void setEstimate(const EstimateType &et)
bool readVector(std::istream &is, Eigen::DenseBase< Derived > &b)
Definition io_helper.h:42
VectorN< 3 > Vector3
Definition eigen_types.h:51

References g2o::internal::readVector(), and g2o::BaseVertex< 3, SE2 >::setEstimate().

◆ setEstimateDataImpl()

virtual bool g2o::VertexSE2::setEstimateDataImpl ( const double * )
inlinevirtual

writes the estimater to an array of double

Returns
true on success

Reimplemented from g2o::OptimizableGraph::Vertex.

Definition at line 56 of file vertex_se2.h.

56 {
57 _estimate = SE2(est[0], est[1], est[2]);
58 return true;
59 }

References g2o::BaseVertex< 3, SE2 >::_estimate.

◆ setMinimalEstimateDataImpl()

virtual bool g2o::VertexSE2::setMinimalEstimateDataImpl ( const double * )
inlinevirtual

sets the initial estimate from an array of double

Returns
true on success

Reimplemented from g2o::OptimizableGraph::Vertex.

Definition at line 69 of file vertex_se2.h.

69 {
70 return setEstimateData(est);
71 }
bool setEstimateData(const double *estimate)

References g2o::OptimizableGraph::Vertex::setEstimateData().

◆ setToOriginImpl()

virtual void g2o::VertexSE2::setToOriginImpl ( )
inlinevirtual

sets the node to the origin (used in the multilevel stuff)

Implements g2o::OptimizableGraph::Vertex.

Definition at line 46 of file vertex_se2.h.

46{ _estimate = SE2(); }

References g2o::BaseVertex< 3, SE2 >::_estimate.

◆ write()

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

write the vertex to a stream

Implements g2o::OptimizableGraph::Vertex.

Definition at line 47 of file vertex_se2.cpp.

47 {
48 return internal::writeVector(os, estimate().toVector());
49}
const EstimateType & estimate() const
bool writeVector(std::ostream &os, const Eigen::DenseBase< Derived > &b)
Definition io_helper.h:36

References g2o::BaseVertex< 3, SE2 >::estimate(), and g2o::internal::writeVector().


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