treeoptimizer3.h
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.h"
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;
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
AISNavigation::TreeOptimizer3::propagateErrors
void propagateErrors(bool usePreconditioner=false)
Definition: treeoptimizer3_iteration.cpp:128
AISNavigation::TreeOptimizer3::maxRotationalErrors
std::vector< double > maxRotationalErrors
Definition: treeoptimizer3.h:142
AISNavigation::TreeOptimizer3::traslationalError
double traslationalError(const Edge *e) const
Definition: treeoptimizer3.cpp:188
AISNavigation::TreeOptimizer3::error
double error(double *mre=0, double *mte=0, double *are=0, double *ate=0, TreePoseGraph3::EdgeSet *eset=0) const
Definition: treeoptimizer3.cpp:250
AISNavigation::TreePoseGraph< Operations3D< double > >::EdgeCompareMode
EVComparator< Edge * >::CompareMode EdgeCompareMode
Definition: posegraph.h:118
AISNavigation::TreeOptimizer3::~TreeOptimizer3
virtual ~TreeOptimizer3()
Definition: treeoptimizer3.cpp:65
AISNavigation::TreeOptimizer3::rotGain
double rotGain
Definition: treeoptimizer3.h:146
AISNavigation::TreeOptimizer3::PoseVector
std::vector< Pose > PoseVector
Definition: treeoptimizer3.h:53
AISNavigation::TreeOptimizer3::angularError
double angularError() const
AISNavigation::TreeOptimizer3::translationalError
double translationalError() const
AISNavigation::TreePoseGraph< Operations3D< double > >::EdgeSet
std::multiset< Edge *, EVComparator< Edge * > > EdgeSet
Definition: posegraph.h:123
AISNavigation::TreeOptimizer3::getPose
Transformation getPose(Vertex *v, Vertex *top)
Definition: treeoptimizer3.cpp:146
AISNavigation::TreeOptimizer3::loopError
double loopError(const Edge *e) const
Definition: treeoptimizer3.cpp:215
AISNavigation::TreeOptimizer3
Class that contains the core optimization algorithm.
Definition: treeoptimizer3.h:52
AISNavigation::TreePoseGraph3
The class (struct) that contains 2D graph related functions such as loading, saving,...
Definition: posegraph3.h:61
AISNavigation::TreeOptimizer3::onStepStart
virtual void onStepStart(Edge *e)
Definition: treeoptimizer3.cpp:339
AISNavigation::TreeOptimizer3::PM_t::operator[]
double & operator[](int i)
Definition: treeoptimizer3.h:133
AISNavigation::TreeOptimizer3::onRestartBegin
virtual void onRestartBegin()
Definition: treeoptimizer3.cpp:354
AISNavigation::TreeOptimizer3::initializeOnlineOptimization
void initializeOnlineOptimization(EdgeCompareMode mode=EVComparator< Edge * >::CompareLevel)
Definition: treeoptimizer3.cpp:326
AISNavigation::TreeOptimizer3::restartOnDivergence
bool restartOnDivergence
Definition: treeoptimizer3.h:83
AISNavigation::TreeOptimizer3::PM_t::v
double v[2]
Definition: treeoptimizer3.h:132
AISNavigation::TreeOptimizer3::gamma
double gamma[2]
Definition: treeoptimizer3.h:128
AISNavigation::TreeOptimizer3::trasGain
double trasGain
Definition: treeoptimizer3.h:146
posegraph3.h
AISNavigation::TreeOptimizer3::iteration
int iteration
Definition: treeoptimizer3.h:88
AISNavigation::TreeOptimizer3::rpFraction
double rpFraction
Definition: treeoptimizer3.h:90
AISNavigation::TreeOptimizer3::onRestartDone
virtual void onRestartDone()
Definition: treeoptimizer3.cpp:355
AISNavigation::TreeOptimizer3::onIterationStart
virtual void onIterationStart(int i)
Definition: treeoptimizer3.cpp:346
AISNavigation::TreeOptimizer3::recomputeTransformations
void recomputeTransformations(Vertex *v, Vertex *top)
Definition: treeoptimizer3.cpp:130
AISNavigation::TreeOptimizer3::rotationalError
double rotationalError(const Edge *e) const
Definition: treeoptimizer3.cpp:201
AISNavigation::TreeOptimizer3::getRotation
Rotation getRotation(Vertex *v, Vertex *top)
Definition: treeoptimizer3.cpp:157
AISNavigation::TreeOptimizer3::TreeOptimizer3
TreeOptimizer3()
Definition: treeoptimizer3.cpp:57
AISNavigation::TreeOptimizer3::computePreconditioner
void computePreconditioner()
Definition: treeoptimizer3_iteration.cpp:86
AISNavigation::TreeOptimizer3::M
PMVector M
Definition: treeoptimizer3.h:136
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
AISNavigation::TreeOptimizer3::onIterationFinished
virtual void onIterationFinished(int iteration)
Definition: treeoptimizer3.cpp:350
AISNavigation::TreeOptimizer3::maxTranslationalErrors
std::vector< double > maxTranslationalErrors
Definition: treeoptimizer3.h:145
AISNavigation::TreeOptimizer3::isDone
virtual bool isDone()
Definition: treeoptimizer3.cpp:356
AISNavigation::TreeOptimizer3::PM_t
Definition: treeoptimizer3.h:131
AISNavigation::Quaternion
Definition: transformation3.h:140
AISNavigation::TreeOptimizer3::recomputeParameters
void recomputeParameters(Vertex *v, Vertex *top)
Definition: treeoptimizer3.cpp:138
AISNavigation::TreeOptimizer3::getRotGain
double getRotGain() const
Definition: treeoptimizer3.h:85
AISNavigation::TreeOptimizer3::loopRotationalError
double loopRotationalError(const Edge *e) const
Definition: treeoptimizer3.cpp:232
AISNavigation::TreeOptimizer3::mpl
int mpl
Definition: treeoptimizer3.h:139
AISNavigation::EVComparator
A comparator class (struct) that compares the level of two vertices if edges.
Definition: posegraph.h:62
AISNavigation::TreeOptimizer3::initializeOnlineIterations
void initializeOnlineIterations()
Definition: treeoptimizer3.cpp:314
AISNavigation
Definition: posegraph.h:57
AISNavigation::TreeOptimizer3::onStepFinished
virtual void onStepFinished(Edge *e)
Definition: treeoptimizer3.cpp:342
AISNavigation::TreeOptimizer3::iterate
void iterate(TreePoseGraph3::EdgeSet *eset=0, bool noPreconditioner=false)
Definition: treeoptimizer3.cpp:74
AISNavigation::TreeOptimizer3::PMVector
std::vector< PM_t > PMVector
Definition: treeoptimizer3.h:135
i
int i
AISNavigation::TreeOptimizer3::initializeTreeParameters
void initializeTreeParameters()
Definition: treeoptimizer3.cpp:68
AISNavigation::TreeOptimizer3::initializeOptimization
void initializeOptimization(EdgeCompareMode mode=EVComparator< Edge * >::CompareLevel)
Definition: treeoptimizer3.cpp:293
AISNavigation::Transformation3
Definition: transformation3.h:256


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:22