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

caching the offset related to a vertex More...

#include <parameter_se2_offset.h>

Inheritance diagram for g2o::CacheSE2Offset:
Collaboration diagram for g2o::CacheSE2Offset:

Public Member Functions

 CacheSE2Offset ()
virtual void updateImpl ()
 redefine this to do the update
const ParameterSE2Offset * offsetParam () const
void setOffsetParam (ParameterSE2Offset *offsetParam)
const SE2 & w2n () const
const SE2 & n2w () const
const Isometry2 & w2nMatrix () const
const Isometry2 & n2wMatrix () const
const Isometry2 & w2lMatrix () const
const Matrix2 RpInverseRInverseMatrix () const
const Matrix2 RpInverseRInversePrimeMatrix () const
Public Member Functions inherited from g2o::Cache
 Cache (CacheContainer *container_=0, const ParameterVector &parameters_=ParameterVector())
CacheKey key () const
OptimizableGraph::Vertex * vertex ()
OptimizableGraph * graph ()
CacheContainer * container ()
ParameterVector & parameters ()
void update ()
virtual HyperGraph::HyperGraphElementType elementType () const
Public Member Functions inherited from g2o::HyperGraph::HyperGraphElement
virtual ~HyperGraphElement ()

Public Attributes

 EIGEN_MAKE_ALIGNED_OPERATOR_NEW

Protected Member Functions

virtual bool resolveDependencies ()
Protected Member Functions inherited from g2o::Cache
Cache * installDependency (const std::string &type_, const std::vector< int > &parameterIndices)

Protected Attributes

ParameterSE2Offset * _offsetParam
 the parameter connected to the cache
SE2 _se2_w2n
SE2 _se2_n2w
Isometry2 _w2n
 world to sensor transform
Isometry2 _w2l
 world to local
Isometry2 _n2w
 sensor to world
Matrix2 _RpInverse_RInverse
Matrix2 _RpInverse_RInversePrime
Protected Attributes inherited from g2o::Cache
bool _updateNeeded
ParameterVector _parameters
std::vector< Cache * > _parentCaches
CacheContainer * _container

Detailed Description

caching the offset related to a vertex

Definition at line 72 of file parameter_se2_offset.h.

Constructor & Destructor Documentation

◆ CacheSE2Offset()

g2o::CacheSE2Offset::CacheSE2Offset ( )

Definition at line 58 of file parameter_se2_offset.cpp.

58: Cache(), _offsetParam(0) {}
ParameterSE2Offset * _offsetParam
the parameter connected to the cache
Cache(CacheContainer *container_=0, const ParameterVector &parameters_=ParameterVector())
Definition cache.cpp:44

References _offsetParam, and g2o::Cache::Cache().

Member Function Documentation

◆ n2w()

const SE2 & g2o::CacheSE2Offset::n2w ( ) const
inline

Definition at line 82 of file parameter_se2_offset.h.

References _se2_n2w.

◆ n2wMatrix()

const Isometry2 & g2o::CacheSE2Offset::n2wMatrix ( ) const
inline

Definition at line 85 of file parameter_se2_offset.h.

85{ return _n2w; }
Isometry2 _n2w
sensor to world

References _n2w.

◆ offsetParam()

const ParameterSE2Offset * g2o::CacheSE2Offset::offsetParam ( ) const
inline

Definition at line 78 of file parameter_se2_offset.h.

78{ return _offsetParam; }

References _offsetParam.

Referenced by setOffsetParam().

◆ resolveDependencies()

bool g2o::CacheSE2Offset::resolveDependencies ( )
protectedvirtual

Function to be called from a cache that has dependencies. It just invokes a sequence of installDependency(). Although the caches returned are stored in the _parentCache vector, it is better that you redefine your own cache member variables, for better readability

Reimplemented from g2o::Cache.

Definition at line 60 of file parameter_se2_offset.cpp.

60 {
61 _offsetParam = dynamic_cast<ParameterSE2Offset*>(_parameters[0]);
62 return _offsetParam != 0;
63}
ParameterVector _parameters
Definition cache.h:103

References _offsetParam, and g2o::Cache::_parameters.

◆ RpInverseRInverseMatrix()

const Matrix2 g2o::CacheSE2Offset::RpInverseRInverseMatrix ( ) const
inline

Definition at line 88 of file parameter_se2_offset.h.

References _RpInverse_RInverse.

◆ RpInverseRInversePrimeMatrix()

const Matrix2 g2o::CacheSE2Offset::RpInverseRInversePrimeMatrix ( ) const
inline

Definition at line 89 of file parameter_se2_offset.h.

89 {
91 }

References _RpInverse_RInversePrime.

◆ setOffsetParam()

void g2o::CacheSE2Offset::setOffsetParam ( ParameterSE2Offset * offsetParam)

Definition at line 90 of file parameter_se2_offset.cpp.

90 {
92}
const ParameterSE2Offset * offsetParam() const

References _offsetParam, and offsetParam().

◆ updateImpl()

void g2o::CacheSE2Offset::updateImpl ( )
virtual

redefine this to do the update

Implements g2o::Cache.

Definition at line 65 of file parameter_se2_offset.cpp.

65 {
66 const VertexSE2* v = static_cast<const VertexSE2*>(vertex());
67 _se2_n2w = v->estimate() * _offsetParam->offset();
68
69 _n2w = _se2_n2w.rotation().toRotationMatrix();
70 _n2w.translation() = _se2_n2w.translation();
71
72 _se2_w2n = _se2_n2w.inverse();
73 _w2n = _se2_w2n.rotation().toRotationMatrix();
74 _w2n.translation() = _se2_w2n.translation();
75
76 SE2 w2l = v->estimate().inverse();
77 _w2l = w2l.rotation().toRotationMatrix();
78 _w2l.translation() = w2l.translation();
79
80 double alpha = v->estimate().rotation().angle();
81 double c = std::cos(alpha), s = std::sin(alpha);
82 Matrix2 RInversePrime;
83 RInversePrime << -s, c, -c, -s;
85 _offsetParam->offset().rotation().toRotationMatrix().transpose() *
86 RInversePrime;
87 _RpInverse_RInverse = w2l.rotation();
88}
Isometry2 _w2n
world to sensor transform
Isometry2 _w2l
world to local
OptimizableGraph::Vertex * vertex()
Definition cache.cpp:57
MatrixN< 2 > Matrix2
Definition eigen_types.h:71

References _n2w, _offsetParam, _RpInverse_RInverse, _RpInverse_RInversePrime, _se2_n2w, _se2_w2n, _w2l, _w2n, g2o::BaseVertex< D, T >::estimate(), g2o::SE2::inverse(), g2o::SE2::rotation(), g2o::SE2::translation(), and g2o::Cache::vertex().

◆ w2lMatrix()

const Isometry2 & g2o::CacheSE2Offset::w2lMatrix ( ) const
inline

Definition at line 86 of file parameter_se2_offset.h.

86{ return _w2l; }

References _w2l.

◆ w2n()

const SE2 & g2o::CacheSE2Offset::w2n ( ) const
inline

Definition at line 81 of file parameter_se2_offset.h.

81{ return _se2_w2n; }

References _se2_w2n.

◆ w2nMatrix()

const Isometry2 & g2o::CacheSE2Offset::w2nMatrix ( ) const
inline

Definition at line 84 of file parameter_se2_offset.h.

84{ return _w2n; }

References _w2n.

Member Data Documentation

◆ _n2w

Isometry2 g2o::CacheSE2Offset::_n2w
protected

sensor to world

Definition at line 100 of file parameter_se2_offset.h.

Referenced by n2wMatrix(), and updateImpl().

◆ _offsetParam

ParameterSE2Offset* g2o::CacheSE2Offset::_offsetParam
protected

the parameter connected to the cache

Definition at line 94 of file parameter_se2_offset.h.

Referenced by CacheSE2Offset(), offsetParam(), resolveDependencies(), setOffsetParam(), and updateImpl().

◆ _RpInverse_RInverse

Matrix2 g2o::CacheSE2Offset::_RpInverse_RInverse
protected

Definition at line 101 of file parameter_se2_offset.h.

Referenced by RpInverseRInverseMatrix(), and updateImpl().

◆ _RpInverse_RInversePrime

Matrix2 g2o::CacheSE2Offset::_RpInverse_RInversePrime
protected

Definition at line 102 of file parameter_se2_offset.h.

Referenced by RpInverseRInversePrimeMatrix(), and updateImpl().

◆ _se2_n2w

SE2 g2o::CacheSE2Offset::_se2_n2w
protected

Definition at line 96 of file parameter_se2_offset.h.

Referenced by n2w(), and updateImpl().

◆ _se2_w2n

SE2 g2o::CacheSE2Offset::_se2_w2n
protected

Definition at line 95 of file parameter_se2_offset.h.

Referenced by updateImpl(), and w2n().

◆ _w2l

Isometry2 g2o::CacheSE2Offset::_w2l
protected

world to local

Definition at line 99 of file parameter_se2_offset.h.

Referenced by updateImpl(), and w2lMatrix().

◆ _w2n

Isometry2 g2o::CacheSE2Offset::_w2n
protected

world to sensor transform

Definition at line 98 of file parameter_se2_offset.h.

Referenced by updateImpl(), and w2nMatrix().

◆ EIGEN_MAKE_ALIGNED_OPERATOR_NEW

g2o::CacheSE2Offset::EIGEN_MAKE_ALIGNED_OPERATOR_NEW

Definition at line 74 of file parameter_se2_offset.h.


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