base_multi_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_MULTI_EDGE_H
28 #define G2O_BASE_MULTI_EDGE_H
29 
30 #include <iostream>
31 #include <iomanip>
32 #include <limits>
33 
34 #include <Eigen/StdVector>
35 
36 #include "base_edge.h"
37 #include "robust_kernel.h"
38 #include "../../config.h"
39 
40 namespace g2o {
41 
42  using namespace Eigen;
43 
50  template <int D, typename E>
51  class BaseMultiEdge : public BaseEdge<D,E>
52  {
53  public:
57  struct HessianHelper {
58  Eigen::Map<MatrixXd> matrix;
59  bool transposed;
60  HessianHelper() : matrix(0, 0, 0), transposed(false) {}
61  };
62 
63  public:
64  static const int Dimension = BaseEdge<D,E>::Dimension;
66  typedef MatrixXd::MapType JacobianType;
69  typedef Eigen::Map<MatrixXd, MatrixXd::Flags & AlignedBit ? Aligned : Unaligned > HessianBlockType;
70 
72  {
73  }
74 
75  virtual void linearizeOplus(JacobianWorkspace& jacobianWorkspace);
76 
81  virtual void linearizeOplus();
82 
83  virtual void resize(size_t size);
84 
85  virtual bool allVerticesFixed() const;
86 
87  virtual void constructQuadraticForm() ;
88 
89  virtual void mapHessianMemory(double* d, int i, int j, bool rowMajor);
90 
92 
93  protected:
99 
100  std::vector<HessianHelper> _hessian;
101  std::vector<JacobianType, aligned_allocator<JacobianType> > _jacobianOplus;
102 
103  void computeQuadraticForm(const InformationType& omega, const ErrorVector& weightedError);
104 
105  public:
106  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
107  };
108 
109 #include "base_multi_edge.hpp"
110 
111 } // end namespace g2o
112 
113 #endif
d
bool transposed
the block has to be transposed
std::vector< HessianHelper > _hessian
std::vector< JacobianType, aligned_allocator< JacobianType > > _jacobianOplus
jacobians of the edge (w.r.t. oplus)
MatrixXd::MapType JacobianType
BaseEdge< D, E >::Measurement Measurement
Matrix< double, D, 1 > ErrorVector
Definition: base_edge.h:48
BaseEdge< D, E >::ErrorVector ErrorVector
base class to represent an edge connecting an arbitrary number of nodes
Eigen::Map< MatrixXd > matrix
the mapped memory
helper for mapping the Hessian memory of the upper triangular block
BaseEdge< D, E >::InformationType InformationType
Eigen::Map< MatrixXd, MatrixXd::Flags &AlignedBit?Aligned:Unaligned > HessianBlockType
provide memory workspace for computing the Jacobians
Matrix< double, D, D > InformationType
Definition: base_edge.h:49


orb_slam2_with_maps_odom
Author(s): teng zhang
autogenerated on Fri Sep 25 2020 03:24:47