g2o
Toggle main menu visibility
Loading...
Searching...
No Matches
g2o
types
slam3d
vertex_se3.h
Go to the documentation of this file.
1
// g2o - General Graph Optimization
2
// Copyright (C) 2011 R. Kuemmerle, G. Grisetti, 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_VERTEX_SE3_
28
#define G2O_VERTEX_SE3_
29
30
#include "g2o/config.h"
31
#include "
g2o/core/base_vertex.h
"
32
#include "
g2o/core/hyper_graph_action.h
"
33
#include "
g2o_types_slam3d_api.h
"
34
#include "
isometry3d_mappings.h
"
35
36
namespace
g2o
{
37
50
class
G2O_TYPES_SLAM3D_API
VertexSE3
:
public
BaseVertex
<6, Isometry3> {
51
public
:
52
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
;
53
54
static
const
int
orthogonalizeAfter
=
55
1000;
//< orthogonalize the rotation matrix after N updates
56
57
VertexSE3
();
58
59
virtual
void
setToOriginImpl
() {
_estimate
= Isometry3::Identity(); }
60
61
virtual
bool
read(std::istream& is);
62
virtual
bool
write(std::ostream& os)
const
;
63
64
virtual
bool
setEstimateDataImpl
(
const
double
* est) {
65
Eigen::Map<const Vector7> v(est);
66
_estimate
=
internal::fromVectorQT
(v);
67
return
true
;
68
}
69
70
virtual
bool
getEstimateData
(
double
* est)
const
{
71
Eigen::Map<Vector7> v(est);
72
v =
internal::toVectorQT
(
_estimate
);
73
return
true
;
74
}
75
76
virtual
int
estimateDimension
()
const
{
return
7; }
77
78
virtual
bool
setMinimalEstimateDataImpl
(
const
double
* est) {
79
Eigen::Map<const Vector6> v(est);
80
_estimate
=
internal::fromVectorMQT
(v);
81
return
true
;
82
}
83
84
virtual
bool
getMinimalEstimateData
(
double
* est)
const
{
85
Eigen::Map<Vector6> v(est);
86
v =
internal::toVectorMQT
(
_estimate
);
87
return
true
;
88
}
89
90
virtual
int
minimalEstimateDimension
()
const
{
return
6; }
91
99
virtual
void
oplusImpl
(
const
double
* update) {
100
Eigen::Map<const Vector6> v(update);
101
Isometry3
increment =
internal::fromVectorMQT
(v);
102
_estimate
=
_estimate
* increment;
103
if
(++
_numOplusCalls
>
orthogonalizeAfter
) {
104
_numOplusCalls
= 0;
105
internal::approximateNearestOrthogonalMatrix
(
106
_estimate
.matrix().topLeftCorner<3, 3>());
107
}
108
}
109
111
SE3Quat
G2O_ATTRIBUTE_DEPRECATED
(estimateAsSE3Quat()
const
) {
112
return
internal::toSE3Quat
(
estimate
());
113
}
114
115
void
G2O_ATTRIBUTE_DEPRECATED
(setEstimateFromSE3Quat(
const
SE3Quat
& se3)) {
116
setEstimate
(
internal::fromSE3Quat
(se3));
117
}
118
119
protected
:
120
int
_numOplusCalls
;
122
};
123
127
class
VertexSE3WriteGnuplotAction
:
public
WriteGnuplotAction
{
128
public
:
129
VertexSE3WriteGnuplotAction
();
130
virtual
HyperGraphElementAction
*
operator()
(
131
HyperGraph::HyperGraphElement
* element,
132
HyperGraphElementAction::Parameters
* params_);
133
};
134
135
#ifdef G2O_HAVE_OPENGL
139
class
G2O_TYPES_SLAM3D_API
VertexSE3DrawAction :
public
DrawAction
{
140
public
:
141
VertexSE3DrawAction();
142
virtual
HyperGraphElementAction
* operator()(
143
HyperGraph::HyperGraphElement
* element,
144
HyperGraphElementAction::Parameters
* params_);
145
146
protected
:
147
virtual
bool
refreshPropertyPtrs(
148
HyperGraphElementAction::Parameters
* params_);
149
FloatProperty
*_triangleX, *_triangleY;
150
};
151
#endif
152
153
}
// namespace g2o
154
155
#endif
base_vertex.h
g2o::BaseVertex< 6, Isometry3 >::BaseVertex
BaseVertex()
Definition
base_vertex.h:29
g2o::BaseVertex< 6, Isometry3 >::estimate
const EstimateType & estimate() const
Definition
base_vertex.h:127
g2o::BaseVertex< 6, Isometry3 >::_estimate
EstimateType _estimate
Definition
base_vertex.h:137
g2o::BaseVertex< 6, Isometry3 >::setEstimate
void setEstimate(const EstimateType &et)
Definition
base_vertex.h:129
g2o::DrawAction
draw actions
Definition
hyper_graph_action.h:201
g2o::HyperGraphElementAction
Abstract action that operates on a graph entity.
Definition
hyper_graph_action.h:74
g2o::SE3Quat
Definition
se3quat.h:39
g2o::VertexSE3WriteGnuplotAction::VertexSE3WriteGnuplotAction
VertexSE3WriteGnuplotAction()
Definition
vertex_se3.cpp:57
g2o::VertexSE3WriteGnuplotAction::operator()
virtual HyperGraphElementAction * operator()(HyperGraph::HyperGraphElement *element, HyperGraphElementAction::Parameters *params_)
Definition
vertex_se3.cpp:60
g2o::VertexSE3::VertexSE3
VertexSE3()
Definition
vertex_se3.cpp:41
g2o::VertexSE3::setEstimateDataImpl
virtual bool setEstimateDataImpl(const double *est)
Definition
vertex_se3.h:64
g2o::VertexSE3::getMinimalEstimateData
virtual bool getMinimalEstimateData(double *est) const
Definition
vertex_se3.h:84
g2o::VertexSE3::getEstimateData
virtual bool getEstimateData(double *est) const
Definition
vertex_se3.h:70
g2o::VertexSE3::setMinimalEstimateDataImpl
virtual bool setMinimalEstimateDataImpl(const double *est)
Definition
vertex_se3.h:78
g2o::VertexSE3::orthogonalizeAfter
static const int orthogonalizeAfter
Definition
vertex_se3.h:54
g2o::VertexSE3::EIGEN_MAKE_ALIGNED_OPERATOR_NEW
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Definition
vertex_se3.h:52
g2o::VertexSE3::oplusImpl
virtual void oplusImpl(const double *update)
Definition
vertex_se3.h:99
g2o::VertexSE3::estimateDimension
virtual int estimateDimension() const
Definition
vertex_se3.h:76
g2o::VertexSE3::minimalEstimateDimension
virtual int minimalEstimateDimension() const
Definition
vertex_se3.h:90
g2o::VertexSE3::G2O_ATTRIBUTE_DEPRECATED
void G2O_ATTRIBUTE_DEPRECATED(setEstimateFromSE3Quat(const SE3Quat &se3))
wrapper function to use the old SE3 type
Definition
vertex_se3.h:115
g2o::VertexSE3::G2O_ATTRIBUTE_DEPRECATED
SE3Quat G2O_ATTRIBUTE_DEPRECATED(estimateAsSE3Quat() const)
wrapper function to use the old SE3 type
Definition
vertex_se3.h:111
g2o::VertexSE3::setToOriginImpl
virtual void setToOriginImpl()
sets the node to the origin (used in the multilevel stuff)
Definition
vertex_se3.h:59
g2o::VertexSE3::_numOplusCalls
int _numOplusCalls
Definition
vertex_se3.h:120
g2o::WriteGnuplotAction::WriteGnuplotAction
WriteGnuplotAction(const std::string &typeName_)
Definition
hyper_graph_action.cpp:206
g2o_types_slam3d_api.h
G2O_TYPES_SLAM3D_API
#define G2O_TYPES_SLAM3D_API
Definition
g2o_types_slam3d_api.h:55
hyper_graph_action.h
isometry3d_mappings.h
g2o::internal::toVectorQT
Vector7 toVectorQT(const Isometry3 &t)
Definition
isometry3d_mappings.cpp:111
g2o::internal::fromVectorQT
Isometry3 fromVectorQT(const Vector7 &v)
Definition
isometry3d_mappings.cpp:137
g2o::internal::approximateNearestOrthogonalMatrix
void approximateNearestOrthogonalMatrix(const Eigen::MatrixBase< Derived > &R)
Definition
isometry3d_mappings.h:81
g2o::internal::fromVectorMQT
Isometry3 fromVectorMQT(const Vector6 &v)
Definition
isometry3d_mappings.cpp:123
g2o::internal::fromSE3Quat
Isometry3 fromSE3Quat(const SE3Quat &t)
Definition
isometry3d_mappings.cpp:149
g2o::internal::toVectorMQT
Vector6 toVectorMQT(const Isometry3 &t)
Definition
isometry3d_mappings.cpp:97
g2o::internal::toSE3Quat
SE3Quat toSE3Quat(const Isometry3 &t)
Definition
isometry3d_mappings.cpp:144
g2o
Definition
dl_wrapper.cpp:55
g2o::Isometry3
Eigen::Transform< double, 3, Eigen::Isometry, Eigen::ColMajor > Isometry3
Definition
eigen_types.h:77
g2o::FloatProperty
Property< float > FloatProperty
Definition
property.h:150
g2o::HyperGraphElementAction::Parameters
Definition
hyper_graph_action.h:76
g2o::HyperGraph::HyperGraphElement
Definition
hyper_graph.h:80
Generated on
for g2o by
1.17.0