g2o
parameter_se3_offset.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_OFFSET_PARAMETERS_H_
28 #define G2O_DEPRECATED_VERTEX_SE3_OFFSET_PARAMETERS_H_
29 
32 
35 #include "g2o/core/cache.h"
36 
37 #include <Eigen/Geometry>
38 
39 namespace g2o {
40 namespace deprecated {
41 
42 
43  class VertexSE3;
44 
49  {
50  public:
53 
54  virtual bool read(std::istream& is);
55  virtual bool write(std::ostream& os) const;
56 
61  void setOffset(const SE3Quat& offset_ = SE3Quat());
62 
64  const SE3Quat& offset() const { return _offset;}
65 
67  const Eigen::Isometry3d& offsetMatrix() const { return _offsetMatrix;}
68 
70  const Eigen::Isometry3d& inverseOffsetMatrix() const { return _inverseOffsetMatrix;}
71 
72  protected:
74  Eigen::Isometry3d _offsetMatrix;
75  Eigen::Isometry3d _inverseOffsetMatrix;
76  };
77 
82  public:
85  virtual void updateImpl();
86 
87  const ParameterSE3Offset* offsetParam() const { return _offsetParam;}
88  void setOffsetParam(ParameterSE3Offset* offsetParam);
89 
90  const SE3Quat& w2n() const {return _se3_w2n;}
91  const SE3Quat& n2w() const {return _se3_n2w;}
92 
93  const Eigen::Isometry3d& w2nMatrix() const { return _w2n;}
94  const Eigen::Isometry3d& n2wMatrix() const { return _n2w;}
95  const Eigen::Isometry3d& w2lMatrix() const { return _w2l;}
96 
97  protected:
101 
102  Eigen::Isometry3d _w2n;
103  Eigen::Isometry3d _w2l;
104  Eigen::Isometry3d _n2w;
105 
106  protected:
107  virtual bool resolveDependancies();
108  };
109 
110 
111 #ifdef G2O_HAVE_OPENGL
112  class G2O_DEPRECATED_TYPES_SLAM3D_API CacheSE3OffsetDrawAction: public DrawAction{
113  public:
114  CacheSE3OffsetDrawAction();
115  virtual HyperGraphElementAction* operator()(HyperGraph::HyperGraphElement* element,
117  protected:
118  virtual bool refreshPropertyPtrs(HyperGraphElementAction::Parameters* params_);
119  FloatProperty* _cubeSide;
120  };
121 #endif
122 
123 }
124 }
125 
126 #endif
caching the offset related to a vertex
const SE3Quat & offset() const
return the offset as SE3Quat
const Eigen::Isometry3d & inverseOffsetMatrix() const
rotation of the inverse offset as 3x3 rotation matrix
Abstract action that operates on a graph entity.
ParameterSE3Offset * _offsetParam
the parameter connected to the cache
const Eigen::Isometry3d & n2wMatrix() const
const Eigen::Isometry3d & w2nMatrix() const
#define G2O_DEPRECATED_TYPES_SLAM3D_API
Eigen::Isometry3d _w2l
world to local
const Eigen::Isometry3d & offsetMatrix() const
rotation of the offset as 3x3 rotation matrix
Eigen::Isometry3d _n2w
sensor to world
const Eigen::Isometry3d & w2lMatrix() const
Eigen::Isometry3d _w2n
world to sensor transform
const ParameterSE3Offset * offsetParam() const