g2o
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 More...
 
virtual bool write (std::ostream &os) const
 write the vertex to a stream More...
 
virtual void setToOriginImpl ()
 sets the node to the origin (used in the multilevel stuff) More...
 
virtual void oplusImpl (const double *update_)
 
Vector2D cam_map (const Vector2D &v) const
 
- Public Member Functions inherited from g2o::BaseVertex< 7, Sim3 >
 BaseVertex ()
 
virtual const double & hessian (int i, int j) const
 get the element from the hessian matrix More...
 
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 More...
 
virtual double & b (int i)
 
Eigen::Matrix< double, D, 1, Eigen::ColMajor > & b ()
 return right hand side b of the constructed linear system More...
 
const Eigen::Matrix< double, D, 1, Eigen::ColMajor > & b () const
 
virtual double * bData ()
 return a pointer to the b vector associated with this vertex More...
 
virtual void clearQuadraticForm ()
 
virtual double solveDirect (double lambda=0)
 
HessianBlockTypeA ()
 return the hessian block associated with the vertex More...
 
const HessianBlockTypeA () const
 
virtual void push ()
 backup the position of the vertex to a stack More...
 
virtual void pop ()
 restore the position of the vertex by retrieving the position from the stack More...
 
virtual void discardTop ()
 pop the last element from the stack, without restoring the current estimate More...
 
virtual int stackSize () const
 return the stack size More...
 
const EstimateTypeestimate () const
 return the current estimate of the vertex More...
 
void setEstimate (const EstimateType &et)
 set the estimate for the vertex also calls updateCache() More...
 
- Public Member Functions inherited from g2o::OptimizableGraph::Vertex
 Vertex ()
 
virtual Vertexclone () const
 returns a deep copy of the current vertex More...
 
virtual ~Vertex ()
 
void setToOrigin ()
 sets the node to the origin (used in the multilevel stuff) More...
 
bool setEstimateData (const double *estimate)
 
bool setEstimateData (const std::vector< double > &estimate)
 
virtual bool getEstimateData (double *estimate) const
 
virtual bool getEstimateData (std::vector< double > &estimate) const
 
virtual int estimateDimension () const
 
bool setMinimalEstimateData (const double *estimate)
 
bool setMinimalEstimateData (const std::vector< double > &estimate)
 
virtual bool getMinimalEstimateData (double *estimate) const
 
virtual bool getMinimalEstimateData (std::vector< double > &estimate) const
 
virtual int minimalEstimateDimension () const
 
void oplus (const double *v)
 
int hessianIndex () const
 temporary index of this node in the parameter vector obtained from linearization More...
 
int G2O_ATTRIBUTE_DEPRECATED (tempIndex() const)
 
void setHessianIndex (int ti)
 set the temporary index of the vertex in the parameter blocks More...
 
void G2O_ATTRIBUTE_DEPRECATED (setTempIndex(int ti))
 
bool fixed () const
 true => this node is fixed during the optimization More...
 
void setFixed (bool fixed)
 true => this node should be considered fixed during the optimization More...
 
bool marginalized () const
 true => this node is marginalized out during the optimization More...
 
void setMarginalized (bool marginalized)
 true => this node should be marginalized out during the optimization More...
 
int dimension () const
 dimension of the estimated state belonging to this node More...
 
virtual void setId (int id)
 sets the id of the node in the graph be sure that the graph keeps consistent after changing the id More...
 
void setColInHessian (int c)
 set the row of this vertex in the Hessian More...
 
int colInHessian () const
 get the row of this vertex in the Hessian More...
 
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 More...
 
int id () const
 returns the id More...
 
const EdgeSetedges () const
 returns the set of hyper-edges that are leaving/entering in this vertex More...
 
EdgeSetedges ()
 returns the set of hyper-edges that are leaving/entering in this vertex More...
 
virtual HyperGraphElementType elementType () const
 
- Public Member Functions inherited from g2o::HyperGraph::HyperGraphElement
virtual ~HyperGraphElement ()
 
HyperGraphElementclone () const
 
- Public Member Functions inherited from g2o::HyperGraph::DataContainer
 DataContainer ()
 
virtual ~DataContainer ()
 
const DatauserData () const
 the user data associated with this vertex More...
 
DatauserData ()
 
void setUserData (Data *obs)
 
void addUserData (Data *obs)
 

Public Attributes

 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 
Vector2D _principle_point
 
Vector2D _focal_length
 
bool _fix_scale
 

Additional Inherited Members

- Public Types inherited from g2o::BaseVertex< 7, Sim3 >
typedef Sim3 EstimateType
 
typedef std::stack< EstimateType, std::vector< EstimateType, Eigen::aligned_allocator< EstimateType > > > BackupStackType
 
typedef Eigen::Map< Eigen::Matrix< double, D, D, Eigen::ColMajor >, Eigen::Matrix< double, D, D, Eigen::ColMajor >::Flags &Eigen::AlignedBit?Eigen::Aligned:Eigen::Unaligned > HessianBlockType
 
- Static Public Attributes inherited from g2o::BaseVertex< 7, Sim3 >
static const int Dimension
 dimension of the estimate (minimal) in the manifold space More...
 
- 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.

Definition at line 43 of file types_seven_dof_expmap.h.

Constructor & Destructor Documentation

g2o::VertexSim3Expmap::VertexSim3Expmap ( )

Definition at line 42 of file types_seven_dof_expmap.cpp.

References _fix_scale, _focal_length, g2o::OptimizableGraph::Vertex::_marginalized, and _principle_point.

42  : BaseVertex<7, Sim3>()
43  {
44  _marginalized=false;
45  _fix_scale = false;
46  _principle_point[0] = 0;
47  _principle_point[1] = 0;
48  _focal_length[0] = 1;
49  _focal_length[1] = 1;
50  }

Member Function Documentation

Vector2D g2o::VertexSim3Expmap::cam_map ( const Vector2D v) const
inline

Definition at line 69 of file types_seven_dof_expmap.h.

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

70  {
71  Vector2D res;
72  res[0] = v[0]*_focal_length[0] + _principle_point[0];
73  res[1] = v[1]*_focal_length[1] + _principle_point[1];
74  return res;
75  }
Eigen::Matrix< double, 2, 1, Eigen::ColMajor > Vector2D
Definition: eigen_types.h:45
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 55 of file types_seven_dof_expmap.h.

References _fix_scale, g2o::BaseVertex< 7, Sim3 >::estimate(), and g2o::BaseVertex< 7, Sim3 >::setEstimate().

56  {
57  Eigen::Map<Vector7d> update(const_cast<double*>(update_));
58 
59  if (_fix_scale)
60  update[6] = 0;
61 
62  Sim3 s(update);
63  setEstimate(s*estimate());
64  }
stuff to open files and other unsorted components Sim3
void setEstimate(const EstimateType &et)
set the estimate for the vertex also calls updateCache()
Definition: base_vertex.h:101
const EstimateType & estimate() const
return the current estimate of the vertex
Definition: base_vertex.h:99
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 59 of file types_seven_dof_expmap.cpp.

References Sim3.

60  {
61  Vector7d cam2world;
62  for (int i=0; i<6; i++){
63  is >> cam2world[i];
64  }
65  is >> cam2world[6];
66 // if (! is) {
67 // // if the scale is not specified we set it to 1;
68 // std::cerr << "!s";
69 // cam2world[6]=0.;
70 // }
71 
72  for (int i=0; i<2; i++)
73  {
74  is >> _focal_length[i];
75  }
76  for (int i=0; i<2; i++)
77  {
78  is >> _principle_point[i];
79  }
80 
81  setEstimate(Sim3(cam2world).inverse());
82  return true;
83  }
Eigen::Matrix< double, 7, 1 > Vector7d
Definition: sim3.h:35
stuff to open files and other unsorted components Sim3
void setEstimate(const EstimateType &et)
set the estimate for the vertex also calls updateCache()
Definition: base_vertex.h:101
virtual void g2o::VertexSim3Expmap::setToOriginImpl ( )
inlinevirtual

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

Implements g2o::OptimizableGraph::Vertex.

Definition at line 51 of file types_seven_dof_expmap.h.

References g2o::BaseVertex< 7, Sim3 >::_estimate, and Sim3.

51  {
52  _estimate = Sim3();
53  }
stuff to open files and other unsorted components Sim3
bool g2o::VertexSim3Expmap::write ( std::ostream &  os) const
virtual

write the vertex to a stream

Implements g2o::OptimizableGraph::Vertex.

Definition at line 85 of file types_seven_dof_expmap.cpp.

References g2o::Sim3::log().

86  {
87  Sim3 cam2world(estimate().inverse());
88  Vector7d lv=cam2world.log();
89  for (int i=0; i<7; i++){
90  os << lv[i] << " ";
91  }
92  for (int i=0; i<2; i++)
93  {
94  os << _focal_length[i] << " ";
95  }
96  for (int i=0; i<2; i++)
97  {
98  os << _principle_point[i] << " ";
99  }
100  return os.good();
101  }
Eigen::Matrix< double, 7, 1 > Vector7d
Definition: sim3.h:35
stuff to open files and other unsorted components Sim3
const EstimateType & estimate() const
return the current estimate of the vertex
Definition: base_vertex.h:99

Member Data Documentation

bool g2o::VertexSim3Expmap::_fix_scale

Definition at line 77 of file types_seven_dof_expmap.h.

Referenced by oplusImpl(), and VertexSim3Expmap().

Vector2D g2o::VertexSim3Expmap::_focal_length

Definition at line 67 of file types_seven_dof_expmap.h.

Referenced by VertexSim3Expmap().

Vector2D g2o::VertexSim3Expmap::_principle_point

Definition at line 66 of file types_seven_dof_expmap.h.

Referenced by VertexSim3Expmap().

g2o::VertexSim3Expmap::EIGEN_MAKE_ALIGNED_OPERATOR_NEW

Definition at line 46 of file types_seven_dof_expmap.h.


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