g2o
Toggle main menu visibility
Loading...
Searching...
No Matches
g2o
types
sba
sbacam.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
37
38
#ifndef G2O_SBACam_H
39
#define G2O_SBACam_H
40
41
#include "
g2o/types/slam3d/se3quat.h
"
42
#include "
g2o_types_sba_api.h
"
43
44
namespace
g2o
{
45
46
class
G2O_TYPES_SBA_API
SBACam
:
public
SE3Quat
{
47
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
48
49
public
:
50
// camera matrix and stereo baseline
51
Matrix3
Kcam
;
52
double
baseline
;
53
54
// transformations
55
Eigen::Matrix<double, 3, 4>
w2n
;
// transform from world to node coordinates
56
Eigen::Matrix<double, 3, 4>
w2i
;
// transform from world to image coordinates
57
58
// Derivatives of the rotation matrix transpose wrt quaternion xyz, used for
59
// calculating Jacobian wrt pose of a projection.
60
Matrix3
dRdx
,
dRdy
,
dRdz
;
61
62
// initialize an object
63
SBACam
();
64
65
// set the object pose
66
SBACam
(
const
Quaternion
& r_,
const
Vector3
& t_);
67
68
SBACam
(
const
SE3Quat
& p);
69
70
// update from the linear solution
71
// defined in se3quat
72
void
update
(
const
Vector6
&
update
);
73
74
// transforms
75
static
void
transformW2F
(Eigen::Matrix<double, 3, 4>& m,
const
Vector3
& trans,
76
const
Quaternion
& qrot);
77
78
static
void
transformF2W
(Eigen::Matrix<double, 3, 4>& m,
const
Vector3
& trans,
79
const
Quaternion
& qrot);
80
81
// set up camera matrix
82
void
setKcam
(
double
fx,
double
fy,
double
cx,
double
cy,
double
tx);
83
84
// set transform from world to cam coords
85
void
setTransform
() {
transformW2F
(
w2n
,
_t
,
_r
); }
86
87
// Set up world-to-image projection matrix (w2i), assumes camera parameters
88
// are filled.
89
void
setProjection
() {
w2i
=
Kcam
*
w2n
; }
90
91
// sets angle derivatives
92
void
setDr();
93
};
94
95
// human-readable SBACam object
96
std::ostream&
operator<<
(std::ostream& out_str,
const
SBACam& cam);
97
98
}
// namespace g2o
99
100
#endif
// SBACam
g2o::SBACam::setTransform
void setTransform()
Definition
sbacam.h:85
g2o::SBACam::Kcam
Matrix3 Kcam
Definition
sbacam.h:51
g2o::SBACam::update
void update(const Vector6 &update)
Definition
sbacam.cpp:59
g2o::SBACam::setProjection
void setProjection()
Definition
sbacam.h:89
g2o::SBACam::w2i
Eigen::Matrix< double, 3, 4 > w2i
Definition
sbacam.h:56
g2o::SBACam::baseline
double baseline
Definition
sbacam.h:52
g2o::SBACam::dRdx
Matrix3 dRdx
Definition
sbacam.h:60
g2o::SBACam::transformF2W
static void transformF2W(Eigen::Matrix< double, 3, 4 > &m, const Vector3 &trans, const Quaternion &qrot)
Definition
sbacam.cpp:85
g2o::SBACam::SBACam
SBACam()
Definition
sbacam.cpp:38
g2o::SBACam::setKcam
void setKcam(double fx, double fy, double cx, double cy, double tx)
Definition
sbacam.cpp:92
g2o::SBACam::w2n
Eigen::Matrix< double, 3, 4 > w2n
Definition
sbacam.h:55
g2o::SBACam::dRdy
Matrix3 dRdy
Definition
sbacam.h:60
g2o::SBACam::transformW2F
static void transformW2F(Eigen::Matrix< double, 3, 4 > &m, const Vector3 &trans, const Quaternion &qrot)
Definition
sbacam.cpp:75
g2o::SBACam::dRdz
Matrix3 dRdz
Definition
sbacam.h:60
g2o::SE3Quat::_r
Quaternion _r
Definition
se3quat.h:44
g2o::SE3Quat::EIGEN_MAKE_ALIGNED_OPERATOR_NEW
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Definition
se3quat.h:41
g2o::SE3Quat::SE3Quat
SE3Quat()
Definition
se3quat.h:48
g2o::SE3Quat::_t
Vector3 _t
Definition
se3quat.h:45
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
g2o::Matrix3
MatrixN< 3 > Matrix3
Definition
eigen_types.h:72
g2o::Vector3
VectorN< 3 > Vector3
Definition
eigen_types.h:51
g2o::Vector6
VectorN< 6 > Vector6
Definition
eigen_types.h:53
g2o::operator<<
std::ostream & operator<<(std::ostream &os, const G2OBatchStatistics &st)
Definition
batch_stats.cpp:48
g2o::Quaternion
Eigen::Quaternion< double > Quaternion
Definition
eigen_types.h:81
se3quat.h
Generated on
for g2o by
1.17.0