g2o
Toggle main menu visibility
Loading...
Searching...
No Matches
g2o
types
sba
vertex_cam.h
Go to the documentation of this file.
1
// g2o - General Graph Optimization
2
// Copyright (C) 2011 Kurt Konolige
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_SBA_VERTEX_CAM_H
28
#define G2O_SBA_VERTEX_CAM_H
29
30
#include "
g2o/core/base_vertex.h
"
31
#include "
g2o_types_sba_api.h
"
32
#include "
sbacam.h
"
33
34
namespace
g2o
{
35
43
class
G2O_TYPES_SBA_API
VertexCam
:
public
BaseVertex
<6, SBACam> {
44
public
:
45
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
;
46
VertexCam
();
47
48
virtual
bool
read
(std::istream& is);
49
virtual
bool
write
(std::ostream& os)
const
;
50
51
virtual
void
setToOriginImpl
() {
_estimate
=
SBACam
(); }
52
53
virtual
void
setEstimate
(
const
SBACam
& cam) {
54
BaseVertex<6, SBACam>::setEstimate
(cam);
55
_estimate
.setTransform();
56
_estimate
.setProjection();
57
_estimate
.setDr();
58
}
59
60
virtual
void
oplusImpl
(
const
double
* update) {
61
Eigen::Map<const Vector6> v(update);
62
_estimate
.update(v);
63
_estimate
.setTransform();
64
_estimate
.setProjection();
65
_estimate
.setDr();
66
}
67
68
virtual
bool
setEstimateDataImpl
(
const
double
* est) {
69
Eigen::Map<const Vector7> v(est);
70
_estimate
.fromVector(v);
71
return
true
;
72
}
73
74
virtual
bool
getEstimateData
(
double
* est)
const
{
75
Eigen::Map<Vector7> v(est);
76
v =
estimate
().toVector();
77
return
true
;
78
}
79
80
virtual
int
estimateDimension
()
const
{
return
7; }
81
82
virtual
bool
setMinimalEstimateDataImpl
(
const
double
* est) {
83
Eigen::Map<const Vector6> v(est);
84
_estimate
.fromMinimalVector(v);
85
return
true
;
86
}
87
88
virtual
bool
getMinimalEstimateData
(
double
* est)
const
{
89
Eigen::Map<Vector6> v(est);
90
v =
_estimate
.toMinimalVector();
91
return
true
;
92
}
93
94
virtual
int
minimalEstimateDimension
()
const
{
return
6; }
95
};
96
}
// namespace g2o
97
98
#endif
base_vertex.h
g2o::BaseVertex< 6, SBACam >::BaseVertex
BaseVertex()
Definition
base_vertex.h:29
g2o::BaseVertex< 6, SBACam >::estimate
const EstimateType & estimate() const
Definition
base_vertex.h:127
g2o::BaseVertex< 6, SBACam >::_estimate
EstimateType _estimate
Definition
base_vertex.h:137
g2o::BaseVertex::setEstimate
void setEstimate(const EstimateType &et)
set the estimate for the vertex also calls updateCache()
Definition
base_vertex.h:129
g2o::SBACam
Definition
sbacam.h:46
g2o::VertexCam::minimalEstimateDimension
virtual int minimalEstimateDimension() const
Definition
vertex_cam.h:94
g2o::VertexCam::read
virtual bool read(std::istream &is)
read the vertex from a stream, i.e., the internal state of the vertex
Definition
vertex_cam.cpp:36
g2o::VertexCam::setToOriginImpl
virtual void setToOriginImpl()
sets the node to the origin (used in the multilevel stuff)
Definition
vertex_cam.h:51
g2o::VertexCam::setMinimalEstimateDataImpl
virtual bool setMinimalEstimateDataImpl(const double *est)
Definition
vertex_cam.h:82
g2o::VertexCam::write
virtual bool write(std::ostream &os) const
write the vertex to a stream
Definition
vertex_cam.cpp:66
g2o::VertexCam::setEstimate
virtual void setEstimate(const SBACam &cam)
Definition
vertex_cam.h:53
g2o::VertexCam::VertexCam
VertexCam()
Definition
vertex_cam.cpp:34
g2o::VertexCam::getEstimateData
virtual bool getEstimateData(double *est) const
Definition
vertex_cam.h:74
g2o::VertexCam::setEstimateDataImpl
virtual bool setEstimateDataImpl(const double *est)
Definition
vertex_cam.h:68
g2o::VertexCam::EIGEN_MAKE_ALIGNED_OPERATOR_NEW
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Definition
vertex_cam.h:45
g2o::VertexCam::getMinimalEstimateData
virtual bool getMinimalEstimateData(double *est) const
Definition
vertex_cam.h:88
g2o::VertexCam::oplusImpl
virtual void oplusImpl(const double *update)
Definition
vertex_cam.h:60
g2o::VertexCam::estimateDimension
virtual int estimateDimension() const
Definition
vertex_cam.h:80
g2o_types_sba_api.h
G2O_TYPES_SBA_API
#define G2O_TYPES_SBA_API
Definition
g2o_types_sba_api.h:55
g2o
Definition
dl_wrapper.cpp:55
sbacam.h
Generated on
for g2o by
1.17.0