g2o
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
g2o::VertexSim3Expmap Class Reference

Sim3 Vertex, (x,y,z,qw,qx,qy,qz) the parameterization for the increments constructed is a 7d vector (x,y,z,qx,qy,qz) (note that we leave out the w part of the quaternion. More...

#include <types_seven_dof_expmap.h>

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

Public Member Functions

 VertexSim3Expmap ()
 
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
 
virtual void setToOriginImpl ()
 sets the node to the origin (used in the multilevel stuff)
 
virtual void oplusImpl (const double *update_)
 
Vector2 cam_map1 (const Vector2 &v) const
 
Vector2 cam_map2 (const Vector2 &v) const
 
- Public Member Functions inherited from g2o::BaseVertex< 7, Sim3 >
 BaseVertex ()
 
 BaseVertex (const BaseVertex &)=delete
 
BaseVertexoperator= (const BaseVertex &)=delete
 
virtual const double & hessian (int i, int j) const
 get the element from the hessian matrix
 
virtual double & hessian (int i, int j)
 
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 & b (int i)
 
Eigen::Matrix< double, D, 1, Eigen::ColMajor > & b ()
 return right hand side b of the constructed linear system
 
const Eigen::Matrix< double, D, 1, Eigen::ColMajor > & b () const
 
virtual double * bData ()
 return a pointer to the b vector associated with this vertex
 
virtual void clearQuadraticForm ()
 
virtual double solveDirect (double lambda=0)
 
HessianBlockTypeA ()
 return the hessian block associated with the vertex
 
const HessianBlockTypeA () const
 
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 EstimateTypeestimate () 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)
 
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 (double *estimate) const
 
virtual bool getEstimateData (std::vector< double > &estimate) const
 
template<typename Derived >
bool getEstimateData (Eigen::MatrixBase< Derived > &estimate) const
 
virtual int estimateDimension () 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 (double *estimate) const
 
virtual bool getMinimalEstimateData (std::vector< double > &estimate) const
 
template<typename Derived >
bool getMinimalEstimateData (Eigen::MatrixBase< Derived > &estimate) const
 
virtual int minimalEstimateDimension () 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 OptimizableGraphgraph () const
 
OptimizableGraphgraph ()
 
void lockQuadraticForm ()
 
void unlockQuadraticForm ()
 
virtual void updateCache ()
 
CacheContainercacheContainer ()
 
- 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 EdgeSetedges () const
 returns the set of hyper-edges that are leaving/entering in this vertex
 
EdgeSetedges ()
 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 DatauserData () const
 the user data associated with this vertex
 
DatauserData ()
 
void setUserData (Data *obs)
 
void addUserData (Data *obs)
 

Public Attributes

 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 
Vector2 _principle_point1
 
Vector2 _principle_point2
 
Vector2 _focal_length1
 
Vector2 _focal_length2
 
bool _fix_scale
 

Additional Inherited Members

- Public Types inherited from g2o::BaseVertex< 7, Sim3 >
using EstimateType = Sim3
 
using BackupStackType = std::stack< EstimateType, std::vector< EstimateType > >
 
using HessianBlockType = Eigen::Map< Eigen::Matrix< double, D, D, Eigen::ColMajor >, Eigen::Matrix< double, D, D, Eigen::ColMajor >::Flags &Eigen::PacketAccessBit ? Eigen::Aligned :Eigen::Unaligned >
 
- Static Public Attributes inherited from g2o::BaseVertex< 7, Sim3 >
static const int Dimension
 dimension of the estimate (minimal) in the manifold space
 
- Protected Member Functions inherited from g2o::OptimizableGraph::Vertex
virtual bool setEstimateDataImpl (const double *)
 
virtual bool setMinimalEstimateDataImpl (const double *)
 
- Protected Attributes inherited from g2o::BaseVertex< 7, Sim3 >
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

Sim3 Vertex, (x,y,z,qw,qx,qy,qz) the parameterization for the increments constructed is a 7d vector (x,y,z,qx,qy,qz) (note that we leave out the w part of the quaternion.

Will represent relative transformation between two cameras

Definition at line 60 of file types_seven_dof_expmap.h.

Constructor & Destructor Documentation

◆ VertexSim3Expmap()

g2o::VertexSim3Expmap::VertexSim3Expmap ( )

Member Function Documentation

◆ cam_map1()

Vector2 g2o::VertexSim3Expmap::cam_map1 ( const Vector2 v) const
inline

Definition at line 81 of file types_seven_dof_expmap.h.

81 {
82 Vector2 res;
83 res[0] = v[0] * _focal_length1[0] + _principle_point1[0];
84 res[1] = v[1] * _focal_length1[1] + _principle_point1[1];
85 return res;
86 }
VectorN< 2 > Vector2
Definition eigen_types.h:50

Referenced by g2o::EdgeSim3ProjectXYZ::computeError().

◆ cam_map2()

Vector2 g2o::VertexSim3Expmap::cam_map2 ( const Vector2 v) const
inline

Definition at line 88 of file types_seven_dof_expmap.h.

88 {
89 Vector2 res;
90 res[0] = v[0] * _focal_length2[0] + _principle_point2[0];
91 res[1] = v[1] * _focal_length2[1] + _principle_point2[1];
92 return res;
93 }

Referenced by g2o::EdgeInverseSim3ProjectXYZ::computeError().

◆ oplusImpl()

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

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

Implements g2o::OptimizableGraph::Vertex.

Definition at line 69 of file types_seven_dof_expmap.h.

69 {
70 Eigen::Map<Vector7> update(const_cast<double*>(update_));
71
72 if (_fix_scale) update[6] = 0;
73
74 Sim3 s(update);
75 setEstimate(s * estimate());
76 }
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()

◆ read()

bool g2o::VertexSim3Expmap::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 61 of file types_seven_dof_expmap.cpp.

61 {
62 Vector7 cam2world;
63 bool state = true;
64 state &= internal::readVector(is, cam2world);
67 setEstimate(Sim3(cam2world).inverse());
68 return state;
69}
bool readVector(std::istream &is, Eigen::DenseBase< Derived > &b)
Definition io_helper.h:42
VectorN< 7 > Vector7
Definition eigen_types.h:54

References _focal_length1, _principle_point1, g2o::internal::readVector(), and g2o::BaseVertex< 7, Sim3 >::setEstimate().

◆ setToOriginImpl()

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

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

Implements g2o::OptimizableGraph::Vertex.

Definition at line 67 of file types_seven_dof_expmap.h.

67{ _estimate = Sim3(); }

◆ write()

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

write the vertex to a stream

Implements g2o::OptimizableGraph::Vertex.

Definition at line 71 of file types_seven_dof_expmap.cpp.

71 {
72 Sim3 cam2world(estimate().inverse());
73 Vector7 lv = cam2world.log();
77 return os.good();
78}
bool writeVector(std::ostream &os, const Eigen::DenseBase< Derived > &b)
Definition io_helper.h:36

References _focal_length1, _principle_point1, g2o::BaseVertex< 7, Sim3 >::estimate(), g2o::Sim3::log(), and g2o::internal::writeVector().

Member Data Documentation

◆ _fix_scale

bool g2o::VertexSim3Expmap::_fix_scale

Definition at line 95 of file types_seven_dof_expmap.h.

Referenced by VertexSim3Expmap().

◆ _focal_length1

Vector2 g2o::VertexSim3Expmap::_focal_length1

Definition at line 79 of file types_seven_dof_expmap.h.

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

◆ _focal_length2

Vector2 g2o::VertexSim3Expmap::_focal_length2

Definition at line 79 of file types_seven_dof_expmap.h.

Referenced by VertexSim3Expmap().

◆ _principle_point1

Vector2 g2o::VertexSim3Expmap::_principle_point1

Definition at line 78 of file types_seven_dof_expmap.h.

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

◆ _principle_point2

Vector2 g2o::VertexSim3Expmap::_principle_point2

Definition at line 78 of file types_seven_dof_expmap.h.

Referenced by VertexSim3Expmap().

◆ EIGEN_MAKE_ALIGNED_OPERATOR_NEW

g2o::VertexSim3Expmap::EIGEN_MAKE_ALIGNED_OPERATOR_NEW

Definition at line 62 of file types_seven_dof_expmap.h.


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