posegraph3.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 
43 #ifndef _POSEGRAPH3_HH_
44 #define _POSEGRAPH3_HH_
45 
46 #include <iostream>
47 #include <vector>
48 #include "posegraph.h"
49 #include "transformation3.h"
50 
51 typedef unsigned int uint;
52 #ifndef M_PI
53  #define M_PI 3.14159265359
54 #endif
55 
56 namespace AISNavigation {
57 
58 
61 struct TreePoseGraph3: public TreePoseGraph<Operations3D<double> >{
63 
70 
71 
76  bool load( const char* filename, bool overrideCovariances=false, bool twoDimensions=false);
77 
79  bool loadEquivalences( const char* filename);
80 
82  bool save( const char* filename);
83 
85  bool saveGnuplot( const char* filename);
86 
88  void printDepth( std::ostream& os );
89 
91  void printWidth( std::ostream& os );
92 
94  void printEdgesStat( std::ostream& os);
95 
97  void initializeOnTree();
98 
101 
102  virtual void initializeFromParentEdge(Vertex* v);
103 
105  virtual void revertEdgeInfo(Edge* e);
106 
110  virtual void collapseEdge(Edge* e);
111 
114 
115 protected:
116 
119  inline void perform(TreePoseGraph3::Vertex* v){
120  if (!v->parent){
121  v->parameters=TreePoseGraph3::Transformation(0.,0.,0.,0.,0.,0.);
122  return;
123  }
124  v->parameters=v->parent->transformation.inv()*v->transformation;
125  }
126  };
127 
130  inline void perform(TreePoseGraph3::Vertex* v){
131  if (!v->parent){
132  return;
133  }
134  v->transformation=v->parent->transformation*v->parameters;
135  }
136  };
137 
138 };
139 
140 
141 }; //namespace AISNavigation
142 #endif
143 
144 
145 
AISNavigation::TreePoseGraph3::ParameterPropagator::perform
void perform(TreePoseGraph3::Vertex *v)
Definition: posegraph3.h:119
AISNavigation::TreePoseGraph3::load
bool load(const char *filename, bool overrideCovariances=false, bool twoDimensions=false)
Definition: posegraph3.cpp:58
AISNavigation::TreePoseGraph3::printDepth
void printDepth(std::ostream &os)
Definition: posegraph3.cpp:249
AISNavigation::TreePoseGraph3::Translation
Ops::TranslationType Translation
Definition: posegraph3.h:66
AISNavigation::TreePoseGraph3::revertEdgeInfo
virtual void revertEdgeInfo(Edge *e)
Definition: posegraph3.cpp:292
AISNavigation::TreePoseGraph3::loadEquivalences
bool loadEquivalences(const char *filename)
Definition: posegraph3.cpp:152
AISNavigation::TreePoseGraph3
The class (struct) that contains 2D graph related functions such as loading, saving,...
Definition: posegraph3.h:61
AISNavigation::TreePoseGraph3::ParameterPropagator
A class (struct) to compute the parameterization of the vertex v.
Definition: posegraph3.h:118
AISNavigation::Pose3
Definition: transformation3.h:108
posegraph.h
AISNavigation::TreePoseGraph3::CovarianceMatrix
Ops::CovarianceType CovarianceMatrix
Definition: posegraph3.h:68
AISNavigation::TreePoseGraph3::verboseLevel
int verboseLevel
Definition: posegraph3.h:113
AISNavigation::TreePoseGraph3::save
bool save(const char *filename)
Definition: posegraph3.cpp:208
AISNavigation::TreePoseGraph3::Rotation
Ops::RotationType Rotation
Definition: posegraph3.h:65
AISNavigation::TreePoseGraph
The template class for representing an abstract tree without specifing the dimensionality of the exac...
Definition: posegraph.h:91
AISNavigation::TreePoseGraph3::saveGnuplot
bool saveGnuplot(const char *filename)
Definition: posegraph3.cpp:185
AISNavigation::TreePoseGraph3::Pose
Ops::PoseType Pose
Definition: posegraph3.h:64
AISNavigation::TreePoseGraph3::printEdgesStat
void printEdgesStat(std::ostream &os)
Definition: posegraph3.cpp:282
AISNavigation::TreePoseGraph3::initializeOnTree
void initializeOnTree()
Definition: posegraph3.cpp:276
uint
unsigned int uint
Definition: posegraph3.h:51
AISNavigation::TreePoseGraph3::printWidth
void printWidth(std::ostream &os)
Definition: posegraph3.cpp:254
AISNavigation::TreePoseGraph3::TransformationPropagator
A class (struct) to compute the parameterization of the vertex v.
Definition: posegraph3.h:129
AISNavigation::TreePoseGraph3::TransformationPropagator::perform
void perform(TreePoseGraph3::Vertex *v)
Definition: posegraph3.h:130
AISNavigation::TreePoseGraph3::collapseEdge
virtual void collapseEdge(Edge *e)
Definition: posegraph3.cpp:306
transformation3.h
AISNavigation::TreePoseGraph3::initializeFromParentEdge
virtual void initializeFromParentEdge(Vertex *v)
Definition: posegraph3.cpp:298
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
AISNavigation::TreePoseGraph3::recomputeAllTransformations
void recomputeAllTransformations()
Definition: posegraph3.cpp:400
AISNavigation::Vector3
Definition: transformation3.h:82
AISNavigation::Quaternion
Definition: transformation3.h:140
v
Array< int, Dynamic, 1 > v
AISNavigation::TreePoseGraph3::Ops
Operations3D< double > Ops
Definition: posegraph3.h:62
AISNavigation
Definition: posegraph.h:57
AISNavigation::Operations3D
Definition: transformation3.h:293
AISNavigation::TreePoseGraph3::Transformation
Ops::TransformationType Transformation
Definition: posegraph3.h:67
DMatrix
Definition: dmatrix.h:46
AISNavigation::TreePoseGraph3::InformationMatrix
Ops::InformationType InformationMatrix
Definition: posegraph3.h:69
AISNavigation::Transformation3
Definition: transformation3.h:256


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