base_unary_edge.h
Go to the documentation of this file.
1 // g2o - General Graph Optimization
2 // Copyright (C) 2011 R. Kuemmerle, G. Grisetti, H. Strasdat, 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_BASE_UNARY_EDGE_H
28 #define G2O_BASE_UNARY_EDGE_H
29 
30 #include <iostream>
31 #include <cassert>
32 #include <limits>
33 
34 #include "base_edge.h"
35 #include "robust_kernel.h"
36 #include "../../config.h"
37 
38 namespace g2o {
39 
40  using namespace Eigen;
41 
42  template <int D, typename E, typename VertexXi>
43  class BaseUnaryEdge : public BaseEdge<D,E>
44  {
45  public:
46  static const int Dimension = BaseEdge<D, E>::Dimension;
48  typedef VertexXi VertexXiType;
49  typedef typename Matrix<double, D, VertexXiType::Dimension>::AlignedMapType JacobianXiOplusType;
52 
53  BaseUnaryEdge() : BaseEdge<D,E>(),
54  _jacobianOplusXi(0, D, VertexXiType::Dimension)
55  {
56  _vertices.resize(1);
57  }
58 
59  virtual void resize(size_t size);
60 
61  virtual bool allVerticesFixed() const;
62 
63  virtual void linearizeOplus(JacobianWorkspace& jacobianWorkspace);
64 
69  virtual void linearizeOplus();
70 
72  const JacobianXiOplusType& jacobianOplusXi() const { return _jacobianOplusXi;}
73 
74  virtual void constructQuadraticForm();
75 
76  virtual void initialEstimate(const OptimizableGraph::VertexSet& from, OptimizableGraph::Vertex* to);
77 
78  virtual void mapHessianMemory(double*, int, int, bool) {assert(0 && "BaseUnaryEdge does not map memory of the Hessian");}
79 
82 
83  protected:
89 
90  JacobianXiOplusType _jacobianOplusXi;
91 
92  public:
93  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
94  };
95 
96 #include "base_unary_edge.hpp"
97 
98 } // end namespace g2o
99 
100 #endif
BaseEdge< D, E >::ErrorVector ErrorVector
Matrix< double, D, VertexXiType::Dimension >::AlignedMapType JacobianXiOplusType
const JacobianXiOplusType & jacobianOplusXi() const
returns the result of the linearization in the manifold space for the node xi
std::set< Vertex * > VertexSet
Definition: hyper_graph.h:91
JacobianXiOplusType _jacobianOplusXi
BaseEdge< D, E >::InformationType InformationType
Matrix< double, D, 1 > ErrorVector
Definition: base_edge.h:48
BaseEdge< D, E >::Measurement Measurement
A general case Vertex for optimization.
virtual void resize(size_t size)
Definition: hyper_graph.cpp:50
virtual void mapHessianMemory(double *, int, int, bool)
provide memory workspace for computing the Jacobians
Matrix< double, D, D > InformationType
Definition: base_edge.h:49


orb_slam2_ros
Author(s):
autogenerated on Wed Apr 21 2021 02:53:05