g2o
vertex_se3_quat.h
Go to the documentation of this file.
1 // g2o - General Graph Optimization
2 // Copyright (C) 2011 R. Kuemmerle, G. Grisetti, W. Burgard
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright notice,
10 // this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above copyright
12 // notice, this list of conditions and the following disclaimer in the
13 // documentation and/or other materials provided with the distribution.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
16 // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
18 // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
21 // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 
27 #ifndef G2O_DEPRECATED_VERTEX_SE3_QUAT_
28 #define G2O_DEPRECATED_VERTEX_SE3_QUAT_
29 
30 #include "g2o/config.h"
31 #include "g2o/core/base_vertex.h"
35 
36 namespace g2o {
37 namespace deprecated {
38 
39 
46 {
47  public:
49  VertexSE3();
50 
51  virtual void setToOriginImpl() {
52  _estimate = SE3Quat();
53  }
54 
55  virtual bool read(std::istream& is);
56  virtual bool write(std::ostream& os) const;
57 
58 
59  virtual bool setEstimateDataImpl(const double* est){
60  Eigen::Map<const Vector7d> v(est);
61  _estimate.fromVector(v);
62  return true;
63  }
64 
65  virtual bool getEstimateData(double* est) const{
66  Eigen::Map<Vector7d> v(est);
67  v=_estimate.toVector();
68  return true;
69  }
70 
71  virtual int estimateDimension() const {
72  return 7;
73  }
74 
75  virtual bool setMinimalEstimateDataImpl(const double* est){
76  Eigen::Map<const Vector6d> v(est);
77  _estimate.fromMinimalVector(v);
78  return true;
79  }
80 
81  virtual bool getMinimalEstimateData(double* est) const{
82  Eigen::Map<Vector6d> v(est);
83  v = _estimate.toMinimalVector();
84  return true;
85  }
86 
87  virtual int minimalEstimateDimension() const {
88  return 6;
89  }
90 
91  virtual void oplusImpl(const double* update)
92  {
93  Eigen::Map<const Vector6d> v(update);
94  SE3Quat increment(v);
95  _estimate *= increment;
96  }
97 };
98 
100  public:
102  virtual HyperGraphElementAction* operator()(HyperGraph::HyperGraphElement* element,
104  };
105 
106 #ifdef G2O_HAVE_OPENGL
107  class G2O_DEPRECATED_TYPES_SLAM3D_API VertexSE3DrawAction: public DrawAction{
108  public:
109  VertexSE3DrawAction();
110  virtual HyperGraphElementAction* operator()(HyperGraph::HyperGraphElement* element,
112  HyperGraphElementAction* _cacheDrawActions;
113  protected:
114  virtual bool refreshPropertyPtrs(HyperGraphElementAction::Parameters* params_);
115  FloatProperty* _triangleX, *_triangleY;
116  };
117 #endif
118 
119 } // end namespace
120 } // end namespace
121 
122 #endif
virtual bool setEstimateDataImpl(const double *est)
Abstract action that operates on a graph entity.
virtual int estimateDimension() const
virtual bool setMinimalEstimateDataImpl(const double *est)
Templatized BaseVertex.
Definition: base_vertex.h:50
#define G2O_DEPRECATED_TYPES_SLAM3D_API
virtual void oplusImpl(const double *update)
virtual void setToOriginImpl()
sets the node to the origin (used in the multilevel stuff)
3D pose Vertex, (x,y,z,qw,qx,qy,qz) the parameterization for the increments constructed is a 6d vecto...
virtual bool getEstimateData(double *est) const
virtual int minimalEstimateDimension() const
virtual bool getMinimalEstimateData(double *est) const