treeoptimizer3.hh
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * This source code is part of the Tree-based Network Optimizer (TORO)
4  *
5  * TORO Copyright (c) 2007 Giorgio Grisetti, Cyrill Stachniss,
6  * Slawomir Grzonka, and Wolfram Burgard
7  *
8  * TORO is licences under the Common Creative License,
9  * Attribution-NonCommercial-ShareAlike 3.0
10  *
11  * You are free:
12  * - to Share - to copy, distribute and transmit the work
13  * - to Remix - to adapt the work
14  *
15  * Under the following conditions:
16  *
17  * - Attribution. You must attribute the work in the manner specified
18  * by the author or licensor (but not in any way that suggests that
19  * they endorse you or your use of the work).
20  *
21  * - Noncommercial. You may not use this work for commercial purposes.
22  *
23  * - Share Alike. If you alter, transform, or build upon this work,
24  * you may distribute the resulting work only under the same or
25  * similar license to this one.
26  *
27  * Any of the above conditions can be waived if you get permission
28  * from the copyright holder. Nothing in this license impairs or
29  * restricts the author's moral rights.
30  *
31  * TORO is distributed in the hope that it will be useful,
32  * but WITHOUT ANY WARRANTY; without even the implied
33  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
34  * PURPOSE.
35  **********************************************************************/
36 
44 #ifndef _TREEOPTIMIZER3_HH_
45 #define _TREEOPTIMIZER3_HH_
46 
47 #include "posegraph3.hh"
48 
49 namespace AISNavigation {
50 
53  typedef std::vector<Pose> PoseVector;
54 
57 
59  virtual ~TreeOptimizer3();
60 
63 
66 
68 
70 
72  void iterate(TreePoseGraph3::EdgeSet* eset=0, bool noPreconditioner=false);
73 
75  double error(double* mre=0, double* mte=0, double* are=0, double* ate=0, TreePoseGraph3::EdgeSet* eset=0) const;
76 
78  double angularError() const;
79 
81  double translationalError() const;
82 
84 
85  inline double getRotGain() const {return rotGain;}
86 
88  int iteration;
89 
90  double rpFraction;
91 
92 protected:
93 
96  Transformation getPose(Vertex*v, Vertex* top);
97 
100  Rotation getRotation(Vertex*v, Vertex* top);
101 
102  void recomputeTransformations(Vertex*v, Vertex* top);
103 
104  void recomputeParameters(Vertex*v, Vertex* top);
105 
106  void computePreconditioner();
107 
108  void propagateErrors(bool usePreconditioner=false);
109 
111  double error(const Edge* e) const;
112 
114  double loopError(const Edge* e) const;
115 
117  double loopRotationalError(const Edge* e) const;
118 
120  double translationalError(const Edge* e) const;
121 
123  double rotationalError(const Edge* e) const;
124 
125  double traslationalError(const Edge* e) const;
126 
128  double gamma[2];
129 
131  struct PM_t{
132  double v [2];
133  inline double& operator[](int i){return v[i];}
134  };
135  typedef std::vector< PM_t > PMVector;
136  PMVector M;
137 
139  int mpl;
140 
142  std::vector<double> maxRotationalErrors;
143 
145  std::vector<double> maxTranslationalErrors;
146  double rotGain, trasGain;
147 
150  virtual void onStepStart(Edge* e);
151 
154  virtual void onStepFinished(Edge* e);
155 
158  virtual void onIterationStart(int i);
159 
163  virtual void onIterationFinished(int iteration);
164 
167  virtual void onRestartBegin();
168 
170  virtual void onRestartDone();
171 
175  virtual bool isDone();
176 
177 };
178 
179 }; //namespace AISNavigation
180 
181 #endif
Defines the graph of 3D poses, with specific functionalities such as loading, saving, merging constraints, and etc.
std::vector< double > maxTranslationalErrors
virtual void onIterationFinished(int iteration)
void initializeOnlineOptimization(EdgeCompareMode mode=EVComparator< Edge * >::CompareLevel)
Rotation getRotation(Vertex *v, Vertex *top)
GLM_FUNC_DECL genType e()
double translationalError() const
A comparator class (struct) that compares the level of two vertices if edges.
Definition: posegraph.hh:62
Class that contains the core optimization algorithm.
Transformation getPose(Vertex *v, Vertex *top)
double traslationalError(const Edge *e) const
std::vector< double > maxRotationalErrors
The class (struct) that contains 2D graph related functions such as loading, saving, merging, etc.
Definition: posegraph3.hh:61
double error(double *mre=0, double *mte=0, double *are=0, double *ate=0, TreePoseGraph3::EdgeSet *eset=0) const
void propagateErrors(bool usePreconditioner=false)
void recomputeParameters(Vertex *v, Vertex *top)
virtual void onStepFinished(Edge *e)
virtual void onStepStart(Edge *e)
double loopError(const Edge *e) const
EVComparator< Edge * >::CompareMode EdgeCompareMode
Definition: posegraph.hh:118
virtual void onIterationStart(int i)
void recomputeTransformations(Vertex *v, Vertex *top)
double rotationalError(const Edge *e) const
std::vector< PM_t > PMVector
std::vector< Pose > PoseVector
void iterate(TreePoseGraph3::EdgeSet *eset=0, bool noPreconditioner=false)
void initializeOptimization(EdgeCompareMode mode=EVComparator< Edge * >::CompareLevel)
std::multiset< Edge *, EVComparator< Edge * > > EdgeSet
Definition: posegraph.hh:123
double loopRotationalError(const Edge *e) const


rtabmap
Author(s): Mathieu Labbe
autogenerated on Wed Jun 5 2019 22:43:40